File: rules

package info (click to toggle)
ngs-sdk 2.10.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,836 kB
  • sloc: cpp: 20,467; perl: 5,677; java: 5,069; python: 1,514; makefile: 687; xml: 230; sh: 70; ansic: 35
file content (93 lines) | stat: -rwxr-xr-x 3,649 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
#!/usr/bin/make -f

# DH_VERBOSE := 1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

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)/$(MULTIARCH)/$(DEB_SOURCE)/$(OS)/gcc/*

build3vers := $(shell py3versions -sv)

%:
	dh $@ --with python3,javahelper,jh_maven_repo_helper

override_dh_auto_clean:
	if [ -e ngs-sdk/Makefile.config.$(OS).$(CPU) ] ; then \
	#    dh_auto_clean --sourcedirectory=$(DEB_SOURCE) ; \
	dh_auto_clean ; \
	fi
	rm -rf ngs-java/$(MULTIARCH)
	rm -rf ngs-bam/$(MULTIARCH)
	rm -f ngs-bam/Makefile.config
	rm -f ngs-bam/Makefile.config.install.linux.x86_64.prl
	rm -f ngs-bam/Makefile.config.linux.x86_64
	rm -f ngs-bam/reconfigure
	rm -rf ngs-sdk/ngs/unix/generic

	rm -rf $(DEB_SOURCE)/$(MULTIARCH)
	rm -rf ngs-python/build

override_dh_auto_configure:
	mkdir ngs-sdk/ngs/unix/generic && cp debian/atomic32.h ngs-sdk/ngs/unix/generic/
	# # that's no standard configure script lacking support of default options \
	./configure --build=$(MULTIARCH) --prefix=/usr -- --source=1.7

override_dh_auto_build:
	#dh_auto_build --sourcedirectory=$(DEB_SOURCE)
	echo "DEBPKGNAME: $DEBPKGNAME"
	dh_auto_build --sourcedirectory=$(DEB_SOURCE)
	# Remove ngs-bam generation, expects ngs-sdk and cannot find a way
	# to specify it
	#cd ngs-bam && LD_LIBRARY_PATH=../$(SODIR)/rel/lib ./configure --build=$(MULTIARCH) --prefix=/usr --with-ngs-sdk-prefix=../ngs-sdk
	#dh_auto_build --sourcedirectory=ngs-bam
	dh_auto_build --sourcedirectory=ngs-java -- JAVAC="javac -source 1.7 -target 1.7"
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	markdown README.md > README.html
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	make -C $(DEB_SOURCE)/test
	# Tests of Java binding disabled because need external lib ncbi-vdb,
	# not available in Debian at this time
	#CLASSPATH=../$(MULTIARCH)/ngs-java/jar/ngs-java.jar LD_LIBRARY_PATH=$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C ngs-java/examples
	#CLASSPATH=../$(MULTIARCH)/ngs-java/jar/ngs-java.jar LD_LIBRARY_PATH=../../$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C ngs-java/examples run_all
endif

override_dh_auto_install:
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
		    --exclude-a \
		    --exclude-la \
		    --movedev "$(SODIR)/rel/lib/*.a*" usr/lib/$(MULTIARCH) \
		    --movedev "$(SODIR)/rel/ilib/*.a" usr/lib/$(MULTIARCH) \
		    --movedev ngs-sdk/ngs usr/include \
		    $(SODIR)/rel/lib/libngs-sdk.so

override_dh_install:
	dh_install -ppython3-ngs
	set -e && for i in $(build3vers); do \
		cd ngs-python ; \
		python$$i ./setup.py install --install-layout=deb --root ../debian/python3-ngs; \
		cd .. ; \
	done
	find debian -name "*.pyc" -delete
	find debian -type d -name __pycache__ | xargs rm -rf

# require network, not automatically run
# use it when the pom file must be re-downloaded from maven repo
BASE_URL:=https://repo.maven.apache.org/maven2/gov/nih/nlm/ncbi/ngs-java
WGET=wget --no-clobber
get-poms:
	$(RM) debian/ngs-java.pom debian/ngs-java.pom.asc
	# extract upstream version
	$(WGET) -O debian/ngs-java.pom $(BASE_URL)/$(DEB_VERSION_UPSTREAM)/ngs-java-$(DEB_VERSION_UPSTREAM).pom && \
	$(WGET) -O debian/ngs-java.pom.asc $(BASE_URL)/$(DEB_VERSION_UPSTREAM)/ngs-java-$(DEB_VERSION_UPSTREAM).pom.asc
	gpg --trust-model=always --status-fd 1 --no-default-keyring --keyring debian/sra-tools.gpg --verify debian/ngs-java.pom.asc