#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/default.mk WRAPPERS=evec2pca-ped \ evec2pca \ smarteigenstrat \ smartpca %: dh $@ override_dh_auto_build: $(MAKE) DEBUG_OPTIONS=-g -C src all cd src && make install override_dh_clean: dh_clean $(MAKE) -C src clobber override_dh_install: dh_install find debian/eigensoft/usr/share/ -type f -empty -delete # file consists only from single line with wrong interpreter find debian/eigensoft/usr/share/ -type f -name HGDP.X.perl -delete # Fix wrappers and drop *.perl extension in /usr/bin while keeping # the original name in /usr/lib/debian-med/bin mkdir -p debian/$(DEB_SOURCE)/usr/lib/debian-med/bin for pl in $(WRAPPERS) ; do \ rm debian/$(DEB_SOURCE)/usr/bin/$${pl} ; \ sed -i \ -e "s?\(command[[:space:]]*=[[:space:]]*\"\)\($${pl}\)?\1/usr/lib/$(DEB_SOURCE)/\2?" \ -e "s?\(cmd[[:space:]]*=[[:space:]]*\"\)\($${pl}\)?\1/usr/lib/$(DEB_SOURCE)/\2?" \ -e "s?\(cmd[[:space:]]*=[[:space:]]*\"\)\(evec2pca.*\)\.perl?\1?" \ -e "s?\($${pl}\)\.perl?\1?" \ debian/$(DEB_SOURCE)/usr/bin/$${pl}.perl ; \ cp -a debian/$(DEB_SOURCE)/usr/bin/$${pl}.perl debian/$(DEB_SOURCE)/usr/bin/$${pl} ; \ mv debian/$(DEB_SOURCE)/usr/bin/$${pl}.perl debian/$(DEB_SOURCE)/usr/lib/debian-med/bin ; \ done for pl in `grep -lR '/usr/.*/bin/perl' | grep -v debian/rules` ; do \ sed -i -e "s?/usr/.*/bin/perl?/usr/bin/perl?" $${pl} ; \ done rm debian/$(DEB_SOURCE)/usr/bin/gc.perl override_dh_fixperms: dh_fixperms find debian/*/usr/share/eigensoft -type f -name "*.perl" -exec chmod +x \{\} \;