| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 6 |
|
| 7 |
include /usr/share/dpkg/default.mk |
| 8 |
export DEB_CFLAGS_MAINT_APPEND = -I/usr/lib/$(DEB_HOST_MULTIARCH)/openmpi/include/ -DSIMDE_ENABLE_OPENMP |
| 9 |
export DEB_CXXFLAGS_MAINT_APPEND = -I/usr/lib/$(DEB_HOST_MULTIARCH)/openmpi/include/ -DSIMDE_ENABLE_OPENMP |
| 10 |
|
| 11 |
mandir=$(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1/ |
| 12 |
|
| 13 |
%: |
| 14 |
dh $@ |
| 15 |
|
| 16 |
VARIANTS = omp serial mpi |
| 17 |
|
| 18 |
override_dh_auto_configure: $(foreach variant,$(VARIANTS),dh_auto_configure_$(variant)) |
| 19 |
override_dh_auto_build: $(foreach variant,$(VARIANTS),dh_auto_build_$(variant)) |
| 20 |
override_dh_auto_install: $(foreach variant,$(VARIANTS),dh_auto_install_$(variant)) |
| 21 |
override_dh_auto_clean: $(foreach variant,$(VARIANTS),dh_auto_clean_$(variant)) |
| 22 |
|
| 23 |
dh_auto_configure_mpi: |
| 24 |
dh_auto_configure -Bbuild.mpi -- -DIQTREE_FLAGS="mpi" |
| 25 |
|
| 26 |
dh_auto_configure_omp: |
| 27 |
dh_auto_configure -Bbuild.omp -- -DIQTREE_FLAGS="omp" |
| 28 |
|
| 29 |
dh_auto_configure_serial: |
| 30 |
dh_auto_configure -Bbuild.serial -- -DIQTREE_FLAGS="" |
| 31 |
|
| 32 |
dh_auto_build_%: |
| 33 |
dh_auto_build -Bbuild.$(subst dh_auto_build_,,$@) |
| 34 |
|
| 35 |
if [ -x build.omp/iqtree2 ] ; then mv build.omp/iqtree2 build.omp/iqtree2-omp ; fi |
| 36 |
|
| 37 |
dh_auto_install_%: |
| 38 |
if [ "$(subst dh_auto_install_,,$@)" != "omp" ] ; then dh_auto_install -Bbuild.$(subst dh_auto_install_,,$@); fi |
| 39 |
|
| 40 |
override_dh_install: |
| 41 |
dh_install |
| 42 |
find debian -name iqtree2-mpi -exec chrpath --delete \{\} \; |
| 43 |
find debian -name iqtree2-omp -exec chrpath --delete \{\} \; |
| 44 |
|
| 45 |
dh_auto_clean_%: |
| 46 |
dh_auto_clean -Bbuild.$(subst dh_auto_clean_,,$@) |
| 47 |
|
| 48 |
override_dh_installexamples: |
| 49 |
|
| 50 |
find debian/$(DEB_SOURCE) -name example.cf -delete |
| 51 |
dh_installexamples |
| 52 |
|
| 53 |
rm -f debian/*/usr/models.nex |
| 54 |
rm -f debian/*/usr/example.[np][eh][xy] |
| 55 |
|
| 56 |
override_dh_installman: |
| 57 |
mkdir -p $(mandir) |
| 58 |
help2man --no-info --no-discard-stderr --help-option="-h" \ |
| 59 |
--name='efficient phylogenetic software by maximum likelihood' \ |
| 60 |
--version-string="$(DEB_VERSION_UPSTREAM)" $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin/iqtree2 > $(mandir)/iqtree2.1 |
| 61 |
help2man --no-info --no-discard-stderr --help-option="-h" \ |
| 62 |
--name='efficient phylogenetic software by maximum likelihood (multiprocessor version)' \ |
| 63 |
--version-string="$(DEB_VERSION_UPSTREAM)" $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin/iqtree2-omp > $(mandir)/iqtree2-omp.1 |
| 64 |
help2man --no-info --no-discard-stderr --help-option="-h" \ |
| 65 |
--name='efficient phylogenetic software by maximum likelihood (multiprocessor version)' \ |
| 66 |
--version-string="$(DEB_VERSION_UPSTREAM)" $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin/iqtree2-mpi > $(mandir)/iqtree2-mpi.1 |
| 67 |
|
| 68 |
override_dh_auto_test: |
| 69 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
ifneq ($(shell nproc), 1) |
| 76 |
sed '/ myprefix/,$$d' debian/Documents_source/example.sh > example.short |
| 77 |
echo 'time $(CURDIR)/build.omp/iqtree2-omp -s example.phy -redo' >> example.short |
| 78 |
time sh example.short |
| 79 |
rm example.short |
| 80 |
endif |
| 81 |
endif |