File: rules

package info (click to toggle)
ncbi-blast+ 2.11.0+ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 338,708 kB
  • sloc: cpp: 893,747; ansic: 253,588; sh: 13,309; xml: 5,050; javascript: 3,434; python: 2,831; perl: 2,304; java: 2,284; makefile: 1,287; awk: 162; pascal: 66; sql: 18
file content (170 lines) | stat: -rwxr-xr-x 6,488 bytes parent folder | download
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export HOME=$(CURDIR)/fakehome

NUMJOBS=1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

DEB_CONFIGURE_COMMON_FLAGS=--without-autodep --without-makefile-auto-update \
    --with-flat-makefile --without-caution --without-dbapi --without-lzo \
    --without-debug --without-downloaded-vdb --without-sse42
DEB_CONFIGURE_EXTRA_FLAGS=$(DEB_CONFIGURE_COMMON_FLAGS) --with-dll --with-mt \
    --with-runpath=/usr/lib/ncbi-blast+ --with-build-root=BUILD --with-mbedtls

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
# Kept for the sake of backports, which can't rely on GCC 9+.
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk

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_COMMON_FLAGS +=  CFLAGS_FOR_BUILD="$(CFLAGS) -fPIE"
DEB_CONFIGURE_COMMON_FLAGS += LDFLAGS_FOR_BUILD="$(LDFLAGS)"

ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
NATIVE=.native
DEB_CONFIGURE_EXTRA_FLAGS += --build=$(DEB_BUILD_GNU_TYPE) \
    --host=$(DEB_HOST_GNU_TYPE)
NATIVE_BINDIR=$(CURDIR)/c++/BUILD$(NATIVE)/bin
PREBUILT_DATATOOL_EXE=$(NATIVE_BINDIR)/datatool
PREBUILT_PTB_EXE=$(NATIVE_BINDIR)/project_tree_builder
export PREBUILT_DATATOOL_EXE PREBUILT_PTB_EXE

$(PREBUILT_DATATOOL_EXE):
	cd c++  &&  PREBUILT_PTB_EXE=bootstrap \
            ./configure $(DEB_CONFIGURE_COMMON_FLAGS) --without-objects \
            --without-algo --without-app --with-build-root=BUILD.native  ||  \
            (tail -v -n +0 config.log BUILD.native/status/config.log; exit 1)
	make -j$(NUMJOBS) -C c++/BUILD$(NATIVE)/build -f Makefile.flat \
	    datatool.exe
endif

override_dh_auto_configure-indep:;
override_dh_auto_configure-arch: $(PREBUILT_DATATOOL_EXE)
	mkdir -p $(HOME)
	cd c++  &&  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:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	-dh_auto_test
	-c++/BUILD/build/check.sh concat_err
	-cat c++/BUILD/build/check.sh.out_err
endif

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/get_species_taxids.sh \
	    $(instroot)/bin/get_species_taxids
	mv $(instroot)/bin/cleanup-blastdb-volumes.py \
	    $(instroot)/bin/cleanup-blastdb-volumes
	mv $(instroot)/bin/legacy_blast.pl   $(instroot)/bin/legacy_blast
	mv $(instroot)/bin/update_blastdb.pl $(instroot)/bin/update_blastdb
	sed -e '1s/$$/3/' $(instroot)/bin/windowmasker_2.2.22_adapter.py \
	   > $(instroot)/bin/windowmasker_2.2.22_adapter
	2to3 -w --nobackups $(instroot)/bin/windowmasker_2.2.22_adapter
	chmod +x $(instroot)/bin/windowmasker_2.2.22_adapter
	rm $(instroot)/bin/windowmasker_2.2.22_adapter.py*
# 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
	mkdir c++/BUILD/lib.observed
	d=$(instroot)/bin; \
	while :; do \
	    (for x in $$d/*; do \
	        readelf -d $$x 2>/dev/null \
	        | sed -ne 's/.*NEEDED.* \[\(.*\)]$$/\1/p'; \
            done; rm -f c++/BUILD/lib.observed/*) | sort -u | while read l; do \
	        [ -f $(instroot)/lib/ncbi-blast+/$$l \
	          -o \! -f c++/BUILD/lib/$$l ]  || \
	            cp -av c++/BUILD/lib/$$l c++/BUILD/lib.observed/; \
	    done; \
	    [ -n "$$(ls c++/BUILD/lib.observed)" ] || break; \
	    echo ------------------------------------------------------------; \
	    cp -a c++/BUILD/lib.observed/* $(instroot)/lib/ncbi-blast+; \
	    d=c++/BUILD/lib.observed; \
	done

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++/src/util/lmdb/Makefile.orig c++/src/util/lmdb/Makefile.orig.save
	cp c++/src/util/lmdbxx/Makefile.orig c++/src/util/lmdbxx/Makefile.orig.save
	cp c++/src/util/lmdbxx/lmdb++.h.orig c++/src/util/lmdbxx/lmdb++.h.orig.save

	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$(NATIVE)/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
	rm -f c++/include/common/ncbi_revision.h
	find -name check_exec.pid -delete
	rm -rf c++/BUILD c++/BUILD.native fakehome
	mv configure.orig.save c++/configure.orig
	mv c++/src/util/lmdb/Makefile.orig.save c++/src/util/lmdb/Makefile.orig
	mv c++/src/util/lmdbxx/Makefile.orig.save c++/src/util/lmdbxx/Makefile.orig
	mv c++/src/util/lmdbxx/lmdb++.h.orig.save c++/src/util/lmdbxx/lmdb++.h.orig

%:
	dh $@ --sourcedirectory=c++