File: rules

package info (click to toggle)
ncbi-vdb 3.1.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 42,724 kB
  • sloc: ansic: 313,859; cpp: 73,372; python: 5,557; perl: 3,438; yacc: 2,225; sh: 720; lex: 574; makefile: 436; xml: 4
file content (128 lines) | stat: -rwxr-xr-x 5,095 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

DH_BUILD_MAINT_OPTIONS := nocheck

# DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# since build-results are not ending up in the proper dir its saver to use "*" instead of "$(CPU)"
SODIR := $(DEB_SOURCE)/$(DEB_SOURCE)/$(OS)/gcc
# VDB_ARCH := $(word 1, $(subst -, ,$(DEB_HOST_MULTIARCH)))
VDB_ARCH := *
LIBINSTALLDIR := debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
SCHEMADIR := debian/ncbi-vdb-data/usr/lib/$(DEB_SOURCE)
DSLMFLAGS := --commit --multiarch --devunversioned --exclude-la

# See debian/patches/fix-linking
# export DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,defs -Wl,--as-needed
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

%:
	dh $@ --buildsystem=cmake

override_dh_auto_clean:
	if [ -e ngs-sdk/Makefile.config.$(OS).$(CPU) ] ; then \
		dh_auto_clean ; \
	fi
	rm -rf $(DEB_SOURCE)/$(MULTIARCH)
	rm -rf obj-*
	rm -rf libs/cipher/cipher-1.7/cipher/__pycache__
	rm -rf test/schema/actual
	rm -rf test/vdb/db/SparseCol*
	rm -rf test/vdb/db/VCursorCommit_BufferOverflow
	rm -f libs/ngs-jni/jni.h
	rm -f libs/ngs-jni/jni_md.h
	rm -f build/ld.linux.exe_cmd.sh
	rm -f debian/common-install-stamp
	rm -f interfaces/cc/gcc/aarch64
	rm -f test/cloud/cloud-kfg/.aws/c*
	rm -f test/kdb/root/sra/SRR600096.sra.cache
	rm -f test/kdb/user-settings.mkfg
	rm -f test/vdb/kfg/*/user-settings.mkfg
	rm -f test/vfs/caching-kfg/unix/user-settings.mkfg
	rm -f test/vfs/tmp.perm-file.tmp
	rm -f test/vfs/user-settings.mkfg
	rm -f test/vxf/local_config/user-settings.mkfg

override_dh_auto_configure-indep:;

override_dh_auto_build-arch:
	ln -s arm64 interfaces/cc/gcc/aarch64
	dh_auto_build --no-parallel -- NO_VDB3=1
	# we need to make really sure that no 'vdb_'-prefixed functions will remain ...
	if find . \( -name "*.so" -o -name "*.a" \) -exec strings \{\} \; | tee | grep -q vdb_mbedtls ; then \
	    find . \( -name "*.so" -o -name "*.a" \) -exec strings \{\} \; | tee | grep vdb_mbedtls ; \
	    grep -Rl vdb_mbedtls  debian/tmp/* ; \
	    exit 1 ; \
	    false ; \
	fi

override_dh_auto_build-indep:;

override_dh_auto_test-arch:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	# FIXME: some tests keep on failing despite debian/patches/skip_failing_test.patch - needs to be sorted out later
	dh_auto_test -- NO_VDB3=1 || true
else
	echo "Skip testing which takes a long time"
endif

override_dh_auto_test-indep:;

override_dh_prep:
	dh_prep -Xdebian/tmp

debian/common-install-stamp:
	mkdir -p debian/libncbi-vdb-dev/usr/include/$(DEB_SOURCE)
	cp -a interfaces/* debian/libncbi-vdb-dev/usr/include/$(DEB_SOURCE)
	# move schemata from development packages to library packages since these are used in executables
	mkdir -p $(SCHEMADIR)
	for schema in `find debian/libncbi-vdb-dev/usr/include/$(DEB_SOURCE) -name "*.vschema"` ; do \
	    schemafile=`basename $${schema}` ; \
	    schemadir=`basename $$(dirname $${schema})` ; \
	    mkdir -p $(SCHEMADIR)/$${schemadir} ; \
	    sed -i "s:^include ':&/usr/lib/ncbi-vdb/:" $${schema} ; \
	    mv $${schema} $(SCHEMADIR)/$${schemadir} ; \
	done
	# Move around kfg files to the place where it used to be in version 2.x
	mv debian/libncbi-vdb-dev/usr/include/ncbi-vdb/kfg/ncbi $(SCHEMADIR)/kfg
	touch $@

override_dh_auto_install-arch: debian/common-install-stamp
	dh_auto_install -- NO_VDB3=1
	find $(LIBINSTALLDIR) -name "*-static.a" -delete
	# upstream installs versioned *.a libs - we only want a single version
	for slib in $(LIBINSTALLDIR)/*.a ; do \
	    mv $(LIBINSTALLDIR)/`readlink $$slib` $$slib ; \
	    mv $(LIBINSTALLDIR)/`readlink $$slib` $$slib ; \
	done
#		    --movedev $(LIBINSTALLDIR)/libncbi-ngs-c++.a usr/lib/$(MULTIARCH) \
#		    --movedev $(LIBINSTALLDIR)/libkff.a		usr/lib/$(MULTIARCH) \
#		    --movedev $(LIBINSTALLDIR)/libkxfs.a	usr/lib/$(MULTIARCH) \
#		    --movedev $(LIBINSTALLDIR)/libkxml.a	usr/lib/$(MULTIARCH) \
#                    --movedev $(LIBINSTALLDIR)/libload.a	usr/lib/$(MULTIARCH) \
#		    --movedev $(LIBINSTALLDIR)/libtui.a		usr/lib/$(MULTIARCH) \
#                    --movedev $(LIBINSTALLDIR)/libtui_cpp.a	usr/lib/$(MULTIARCH) \

	d-shlibmove $(DSLMFLAGS) \
		    --movedev $(LIBINSTALLDIR)/libkapp.a	usr/lib/$(MULTIARCH) \
		    --movedev $(LIBINSTALLDIR)/libktst.a	usr/lib/$(MULTIARCH) \
                    --movedev obj-*/ilib/libkapp-norsrc.a	usr/lib/$(MULTIARCH) \
		    $(LIBINSTALLDIR)/libncbi-vdb.so
	# json-response.h and services-priv.h are needed by sra-sdk, but
	# the latter shouldn't replace interfaces/vfs/services-priv.h.
	dh_install -plibncbi-vdb-dev libs/vfs/json-response.h usr/include/ncbi-vdb/vfs
	cp libs/vfs/services-priv.h debian/libncbi-vdb-dev/usr/include/ncbi-vdb/vfs/services-priv-internal.h
	d-shlibmove $(DSLMFLAGS) \
		    $(LIBINSTALLDIR)/libncbi-wvdb.so
	d-shlibmove $(DSLMFLAGS) \
		    $(LIBINSTALLDIR)/libsam-extract.so
	find debian/lib* -name .gitignore -delete

override_dh_auto_install-indep: debian/common-install-stamp