1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
NUMJOBS=1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
DEB_CONFIGURE_EXTRA_FLAGS=--with-dll --with-mt --without-autodep \
--without-makefile-auto-update --with-flat-makefile --without-caution \
--without-dbapi --without-lzo --with-runpath=/usr/lib/ncbi-blast+ \
--with-build-root=BUILD --without-debug --without-downloaded-vdb \
--with-mbedtls --without-sse42
proj=algo/blast/ app/ objmgr/ objtools/align_format/ objtools/blast/
#ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
DEB_CONFIGURE_EXTRA_FLAGS += --with-symbols
#endif
#export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
export DEB_CFLAGS_MAINT_APPEND=-Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
ifneq (,$(findstring mips,$(DEB_HOST_ARCH)))
CXXFLAGS := $(CXXFLAGS:-O%=-O)
DEB_CONFIGURE_EXTRA_FLAGS += FAST_CXXFLAGS=-O
endif
export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MAKE
# used for run_with_lock
DEB_CONFIGURE_EXTRA_FLAGS += CFLAGS_FOR_BUILD="$(CFLAGS) -fPIE"
DEB_CONFIGURE_EXTRA_FLAGS += LDFLAGS_FOR_BUILD="$(LDFLAGS)"
BLAST2_VERSION=1:$(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')
llp=LD_LIBRARY_PATH
override_dh_auto_configure-indep:;
override_dh_auto_configure-arch:
cd c++ && $(llp)=$(CURDIR)/c++/BUILD/lib$${$(llp)+:$$$(llp)} \
CONFIG_SHELL=/bin/bash ./configure $(DEB_CONFIGURE_EXTRA_FLAGS) \
|| (tail -v -n +0 config.log BUILD/status/config.log; exit 1)
override_dh_auto_build-arch:
cd c++/BUILD/build && \
make -j$(NUMJOBS) -f Makefile.flat all_projects="$(proj)"
# make all_r
override_dh_auto_build-indep:
echo "Save time and do nothing for architecture independent builds"
override_dh_auto_test:
-dh_auto_test
-c++/BUILD/build/check.sh concat_err
-cat c++/BUILD/build/check.sh.out_err
instroot = debian/ncbi-blast+/usr
leg_bin = debian/ncbi-blast+-legacy/usr/bin
override_dh_auto_install-arch:
# cp c++/BUILD/lib/*.so $(instroot)/lib/ncbi-blast+/
cp c++/BUILD/bin/* $(instroot)/bin/
override_dh_auto_install-indep:
echo "Nothing to do for architecture independant installs"
override_dh_install-arch:
# dh_install
mv $(instroot)/bin/rpsblast $(instroot)/bin/rpsblast+
mv $(instroot)/bin/seedtop $(instroot)/bin/seedtop+
mv $(instroot)/bin/legacy_blast.pl $(instroot)/bin/legacy_blast
mv $(instroot)/bin/update_blastdb.pl $(instroot)/bin/update_blastdb
mv $(instroot)/bin/windowmasker_2.2.22_adapter.py \
$(instroot)/bin/windowmasker_2.2.22_adapter
# Clean up tests, demos, and internal build tools
rm -f $(instroot)/bin/*test* $(instroot)/bin/seqdb_demo \
$(instroot)/bin/datatool $(instroot)/bin/run_with_lock \
$(instroot)/bin/project_tree_builder
for x in $(instroot)/bin/*; do \
LD_LIBRARY_PATH=c++/BUILD/lib ldd $$x; \
done 2>/dev/null | awk '/BUILD/ { print $$3 }' | sort -u | \
xargs cp -v -t $(instroot)/lib/ncbi-blast+
override_dh_install-indep:
#if test -d $(leg_bin); then cp debian/legacy/legacy.sh $(leg_bin)/; fi
for x in blastall megablast blastpgp bl2seq rpsblast fastacmd formatdb \
seedtop; do \
sed -e "s/.{.*}/$$x/" debian/legacy/legacy.sh > $(leg_bin)/$$x; \
chmod +x $(leg_bin)/$$x; \
done
override_dh_clean:
cp c++/configure.orig configure.orig.save
dh_clean
#Tricky - for each module directory there may be several module files
#or there may be none but then there is still a module named after the
#directory. Clean everything!
-for x in c++/src/objects/* ; do \
(cd "$$x" && ( \
mods="`echo *.module`" ; \
[ "$${mods#*\*}" = "$$mods" ] || mods="`basename $$x`" ; \
for mod in $$mods ; do \
../../../BUILD/build/new_module.sh $$mod purge_sources ; \
done ) ; \
) ; \
done
rm -rf c++/compilers/dll c++/config.log c++/Makefile
rm -f c++/configure.lineno c++/src/objects/blastxml/blastxml.module
find -name check_exec.pid -delete
rm -rf c++/BUILD
mv configure.orig.save c++/configure.orig
override_dh_gencontrol-indep:
dh_gencontrol -pblast2 -- -v$(BLAST2_VERSION)
dh_gencontrol -Nblast2
%:
#dh $@ -Dc++ --with autotools_dev
dh $@ -Dc++
|