| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Copyright (C) Andreas Tille <[email protected]> |
| 4 |
# License: GPL |
| 5 |
|
| 6 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 7 |
|
| 8 |
include /usr/share/dpkg/default.mk |
| 9 |
exe=raxmlHPC |
| 10 |
|
| 11 |
ifeq (amd64,$(DEB_TARGET_ARCH_CPU)) |
| 12 |
##MFILES:=Makefile.gcc \ # we use a wrapper to the faster versions instead of shipping the "plain" version |
| 13 |
MFILES =Makefile.PTHREADS.gcc \ |
| 14 |
Makefile.SSE3.PTHREADS.gcc \ |
| 15 |
Makefile.AVX.PTHREADS.gcc |
| 16 |
MFLAGS= |
| 17 |
else |
| 18 |
MFILES = Makefile.AVX.PTHREADS.gcc |
| 19 |
MFLAGS = CFLAGS="$(shell dpkg-buildflags --get CFLAGS) -DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3" |
| 20 |
endif |
| 21 |
|
| 22 |
BINDIR=$(CURDIR)/debian/tmpbuild |
| 23 |
|
| 24 |
%: |
| 25 |
dh $@ |
| 26 |
|
| 27 |
override_dh_auto_clean: |
| 28 |
for mfile in $(MFILES); do $(MAKE) -f $${mfile} clean ; done |
| 29 |
rm -rf $(BINDIR) |
| 30 |
|
| 31 |
override_dh_auto_build: |
| 32 |
mkdir -p $(BINDIR) |
| 33 |
set -e ; for mfile in $(MFILES); do \ |
| 34 |
dh_auto_build --buildsystem=makefile -- -f $${mfile} $(MFLAGS); \ |
| 35 |
curexe=`ls $(exe)* | head -n 1` ; \ |
| 36 |
if [ -e $(BINDIR)/$${curexe} ] ; then \ |
| 37 |
echo "**** ERROR: $${curexe} was created before!!" && false ; \ |
| 38 |
else \ |
| 39 |
mv $${curexe} $(BINDIR)/$${curexe} ; \ |
| 40 |
fi ; \ |
| 41 |
$(MAKE) -f $${mfile} clean ; \ |
| 42 |
done |
| 43 |
|
| 44 |
override_dh_install: |
| 45 |
dh_install |
| 46 |
ifeq (amd64,$(DEB_TARGET_ARCH_CPU)) |
| 47 |
dh_install debian/bin/raxmlHPC usr/bin |
| 48 |
else |
| 49 |
dh_link usr/bin/raxmlHPC-PTHREADS-AVX usr/bin/raxmlHPC |
| 50 |
endif |
| 51 |
|
| 52 |
override_dh_installman: |
| 53 |
dh_installman |
| 54 |
for cexe in `ls $(BINDIR)/$(exe)*` ; do \ |
| 55 |
curexe=`basename $${cexe}` ; \ |
| 56 |
if [ $${curexe} != $(exe) ] ; then \ |
| 57 |
ln -s $(exe).1.gz $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1/$${curexe}.1.gz ; \ |
| 58 |
fi ; \ |
| 59 |
done |
| 60 |
|
| 61 |
override_dh_installexamples: |
| 62 |
dh_installexamples |
| 63 |
# fix perl path in example scripts |
| 64 |
for pscript in `ls usefulScripts/*.pl` ; do \ |
| 65 |
sed 's?/usr/local/bin/perl?/usr/bin/perl?' $${pscript} > $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples/`basename $${pscript}` ; \ |
| 66 |
done |
| 67 |
|
| 68 |
override_dh_gencontrol: |
| 69 |
dh_gencontrol -- -Vsimde:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")" |