File: rules

package info (click to toggle)
sra-sdk 2.10.9+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 38,576 kB
  • sloc: ansic: 211,129; cpp: 54,855; perl: 7,788; sh: 6,988; makefile: 5,174; python: 3,840; java: 2,363; yacc: 786; lex: 416; ruby: 329; lisp: 268; xml: 55
file content (82 lines) | stat: -rwxr-xr-x 2,768 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
#!/usr/bin/make -f

# Pregenerated with uuidgen -r
DEBIAN_GUID = 806b5c3b-0088-4732-8359-51630950d723

# +pie breaks the build
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

pkg := sra-toolkit

export DEB_CFLAGS_MAINT_APPEND   = -I/usr/include/ncbi-vdb
export DEB_CXXFLAGS_MAINT_APPEND = -I/usr/include/ncbi-vdb
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --no-parallel

OUTDIR=$(CURDIR)/debian/tmp
MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

override_dh_auto_clean:
	-dh_auto_clean

override_dh_clean:
	dh_clean
	rm -f reconfigure build/ld.linux.exe_cmd.sh build/Makefile.config build/Makefile.config.linux.x86_64
	rm -rf test/*/actual test/*/tmp.kfg tools/kqsh/kqsh-sra.[ch]

override_dh_update_autotools_config:
	echo "do nothing"

override_dh_auto_configure:
	# output dir will be checked so create it before
	mkdir -p debian/tmp/usr/lib
	ln -s /usr/lib/$(MULTIARCH) debian/tmp/usr/lib
	#
        # that's no standard configure script lacking support of default options
	#
	# --with-debug sets some options that require header files like compiler.h which
	# is internal to ncbi-vcb and not installed into the package - so this option
	# should not be used.
	./configure --build=$(MULTIARCH) --prefix=$(CURDIR)/debian/tmp/usr --build-prefix=$(CURDIR)/debian/tmp/usr --with-ngs-sdk-prefix=/usr

override_dh_auto_build:
	export LD_LIBRARY_PATH="$$LD_LIBRARY_PATH:$(OUTDIR)/lib"; export OUTDIR=$(OUTDIR) ; make DEB_CFLAGS="$(CFLAGS)" DEB_CXXFLAGS="$(CXXFLAGS)" DEB_LDFLAGS="$(LDFLAGS)"

override_dh_auto_install:
	dh_auto_install -- KONFIG_DIR=$(CURDIR)/debian/sra-toolkit/etc/ncbi

override_dh_install:
	# upstream installs versioned *.a libs - we only want a single version
	ls -l debian/tmp/usr/bin
	cd debian/tmp/usr/bin && \
	for bin in *-orig.* ; do \
	    base=$${bin%-orig.*} && \
	    vbase=$$(readlink "$$(readlink $$base)") && \
	    vdriver=$$(readlink "$$vbase") && \
	    mv -v $$bin $$base-orig && \
	    ln -snfv $${vdriver%%.[0-9]*} $$vbase || exit $$? ; \
	done && \
	for bin in *[a-z] ; do \
	    bin2=$$(readlink $$bin) ; \
	    bin3=$$(readlink "$$bin2") ; \
	    case $$bin2 in \
	        $$bin.* ) rm -v $$bin2 && mv -v $$bin3 $$bin || exit $$? ;; \
	    esac ; \
	done
	dh_install
	# remove susipcious file which is not executable and conflicts with package magic
	rm -f debian/*/usr/bin/magic
	# rename kget which conflicts with kget download manager (see #851219)
	mv debian/$(pkg)/usr/bin/kget debian/$(pkg)/usr/bin/vdb-get
	# Formally supply a standard installation ID to satisfy sratools
	echo '/LIBS/GUID = "$(DEBIAN_GUID)"' >debian/$(pkg)/etc/ncbi/debian.kfg

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test --no-parallel -- -k
endif

override_dh_prep:
	dh_prep -X debian/tmp