File: rules

package info (click to toggle)
seqan2 2.3.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 222,320 kB
  • ctags: 40,872
  • sloc: cpp: 252,894; ansic: 86,805; python: 6,534; sh: 985; xml: 570; makefile: 236; awk: 51
file content (118 lines) | stat: -rwxr-xr-x 4,515 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
UPSTREAM_VERSION = $(shell dpkg-parsechangelog -SVersion | egrep -o '^[0-9.]+')
export HOME=$(shell echo $$PWD"/fakehome")

# import hardening, adding CPPFLAGS to CFLAGS, in case dh doesn't
# See https://wiki.debian.org/Hardening#Notes_for_packages_using_CMake
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS) -O3
CXXFLAGS+=$(CPPFLAGS) -O3

# Droping -fstack-protector flag helps **drastically** reducing memory consumption when building the package!!!!
# export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS | sed 's/-fstack-protector *//')  ## don't do this, it simply triggers #759978
# export DEB_BUILD_MAINT_OPTIONS = hardening=-stackprotector
# alternatively: export DEB_CXXFLAGS_STRIP='-fstack-protector'

DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

DEB_BUILD_ARCH          ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifneq (,$(filter mips mipsel,$(DEB_BUILD_ARCH)))
    export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS | sed 's/-O[1-9]//') -O1 -mxgot
endif
# Disable parallel building on some archs to save memory
ifneq (,$(filter armhf mips kfreebsd%,$(DEB_BUILD_ARCH)))
    $(info $$DEB_BUILD_OPTIONS was [${DEB_BUILD_OPTIONS}])
    TDBO := $(DEB_BUILD_OPTIONS)
    export DEB_BUILD_OPTIONS=parallel=1,$(filter $(TDBO), parallel)
endif
$(info $$DEB_BUILD_OPTIONS is [${DEB_BUILD_OPTIONS}])

# Try to save memory on kfreebsd-*
ifneq (,$(filter kfreebsd%,$(DEB_BUILD_ARCH)))
	export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS | sed 's/-O[1-9]//') -O1
endif

pkgapps=seqan-apps
pkgdev=libseqan2-dev

%:
	dh $@ --parallel

override_dh_auto_configure-arch:
	dh_auto_configure -- -DSEQAN_BUILD_SYSTEM=SEQAN_RELEASE_APPS -DSEQAN_STATIC_APPS=False  # skip the tests for now

override_dh_auto_configure-indep: ;

override_dh_auto_build-arch:
	dh_auto_build --arch
	#cd obj-$(DEB_BUILD_GNU_TYPE); make dox # FIXME: This does nothing and no *.html files will be created at all
	# This ends up in:
	# Could not import extension sphinxcontrib.bibtex (exception: No module named sphinxcontrib.bibtex)
	# Seems there is no sphinx module bibtex - thus deactivating creation of html manual
	# cd manual && make html

override_dh_auto_build-indep:
	sed -e "s#@CMAKE_INSTALL_PREFIX@#/usr#g" \
	    -e "s/@SEQAN_VERSION_STRING@/$(UPSTREAM_VERSION)/g" \
	    -e "s/@CMAKE_PROJECT_NAME@/seqan/g" \
	    util/pkgconfig/seqan.pc.in > seqan-2.pc

override_dh_install:
	dh_install
	# Delete additional LICENSE files
	find $(CURDIR)/debian/$(pkgapps) -type f -name LICENSE -delete || /bin/true
	if [ -d $(CURDIR)/debian/$(pkgdev) ] ; then \
	    find $(CURDIR)/debian/$(pkgdev) -type f -name LICENSE -delete ; \
	    find $(CURDIR)/debian/$(pkgdev) -type f -name "*.pyc" -delete ; \
	fi

override_dh_auto_clean:
	dh_auto_clean
	find . -type f -name "*.pyc" -delete
	if [ -d orig ] ; then \
	  for header in `find orig -name "*generated_forwards.h"` ; do \
	    mv $${header} `echo $$header | sed 's?orig/??'` ; \
	  done ; \
	fi
	rm -rf orig seqan-2.pc

override_dh_installman:
	dh_link
	$(CURDIR)/debian/generate_manpages
	#for bin in `ls $(CURDIR)/debian/$(pkgapps)/usr/lib/seqan/bin` ; do \
	#    if [ -x $(CURDIR)/debian/$(pkgapps)/usr/lib/seqan/bin/`basename $${bin}` ] ; then \
	#        ln -s ../lib/seqan/bin/`basename $${bin}` $(CURDIR)/debian/$(pkgapps)/usr/bin/`basename $${bin}` ; \
	#    fi ; \
	#    if echo $${bin} | grep -q '\.sh$$' ; then \
	#        ln -s ../lib/seqan/bin/$${bin} $(CURDIR)/debian/$(pkgapps)/usr/bin/`basename $${bin} .sh` ; \
	#    fi ; \
	#done
	# we generate only those manpages where binaries are linked to /usr/bin
	dh_installman

override_dh_link-arch:
	dh_link
	# Some binaries (eg. splazer) are not built in 32-bit architectures so
	# remove their (broken) symlinks.
	find $(CURDIR)/debian/$(pkgapps)/usr/bin -type l -xtype l -delete

override_dh_fixperms-indep:
	dh_fixperms
	for bin in `ls $(CURDIR)/debian/$(pkgapps)/usr/lib/seqan/bin/*.sh` ; do \
	    chmod +x $(CURDIR)/debian/$(pkgapps)/usr/lib/seqan/bin/`basename $${bin}` ; \
	done
	find $(CURDIR)/debian/$(pkgdev)/usr/share/cmake -type f -exec chmod -x {} \;

override_dh_auto_test:
# Run test suite only on powerfull architectures (amd64) at build time
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 kfreebsd-amd64))
	dh_auto_test || true
else
	echo "Do not run test suite when building on architecture $(DEB_HOST_ARCH)"
endif