File: rules

package info (click to toggle)
hmmer2 2.3.2%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,704 kB
  • sloc: ansic: 15,984; sh: 2,528; makefile: 324; perl: 266
file content (86 lines) | stat: -rwxr-xr-x 3,309 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
#!/usr/bin/make -f
# DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
ifeq ($(DEB_TARGET_ARCH_CPU),i386)
  export DEB_CFLAGS_MAINT_APPEND  = -ffloat-store
endif

pkgdata:=hmmer2
sampledir:=$(CURDIR)/debian/$(pkgdata)/usr/share/doc/$(pkgdata)/examples
include /usr/share/dpkg/pkg-info.mk
UPSTREAM_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's,+dfsg,,g')

export AUTOHEADER = 'true'

%:
	dh $@

override_dh_clean:
	dh_clean
	if [ -e configure_not_used ] ; then mv configure_not_used configure; fi
	rm -f configure.ac src/config.h

# Trying to address #1025739 but the resulting configure file does not work
override_dh_autoreconf:
	cp -a debian/missing-sources/configure.ac .
	mv configure configure_not_used
#	autoupdate
#	autoreconf -f -i || true
	dh_autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --enable-threads --enable-lfs PTHREAD_CFLAGS="-D_XOPEN_SOURCE=500" # --enable-pvm
	# avoid duplicated definition of PACKAGE_NAME (basically conflicting with biosquid when used together)
	sed -i -e '/^#define PACKAGE_NAME /i #ifndef PACKAGE_NAME' \
	       -e '/^#define PACKAGE_NAME /a #endif' \
	       -e '/^#define PACKAGE_VERSION /i #ifndef PACKAGE_VERSION' \
	       -e '/^#define PACKAGE_VERSION /a #endif' \
	       -e '/^#define _LARGEFILE_SOURCE /i #ifndef _LARGEFILE_SOURCE' \
	       -e '/^#define _LARGEFILE_SOURCE /a #endif' \
	       -e '/^#define _LARGEFILE64_SOURCE /i #ifndef _LARGEFILE64_SOURCE' \
	       -e '/^#define _LARGEFILE64_SOURCE /a #endif' \
	       -e '/^#define VERSION /i #ifndef VERSION' \
	       -e '/^#define VERSION /a #endif' \
	       src/config.h

override_dh_auto_install:
	dh_auto_install -- prefix=$(CURDIR)/debian/tmp
	# lkajan: rename binaries and man pages like this: s/hmm/hmm2/ - except hmmer.1, rename that to hmmer2.1:
	rename 's/^hmm/hmm2/;' $(CURDIR)/debian/tmp/bin/*
	cd $(CURDIR)/debian/tmp/bin; rename 's/^hmm/hmm2/;' *
	cd $(CURDIR)/debian/tmp/share/man/man1; rename 's/^hmm/hmm2/;' *
#	rename 's/^hmm(.+)2/hmm2$$1/;' $(CURDIR)/debian/tmp/bin/*
#	cd $(CURDIR)/debian/tmp/bin; rename 's/^hmm(.+)2/hmm2$$1/;' *
#	cd $(CURDIR)/debian/tmp/share/man/man1; rename 's/^hmm(.+)2/hmm2$$1/;' *
#	rename 's/^hmm(.+)2/hmm2$$1/;' $(CURDIR)/debian/tmp/share/man/man1/*
	mv $(CURDIR)/debian/tmp/share/man/man1/hmm2er.1 $(CURDIR)/debian/tmp/share/man/man1/hmmer2.1
	# lkajan: resolve man page hypen issue:
	sed -i -e 's/--/\\-\\-/g;s/-\([[:alpha:]]\)\b/\\-\1/g;' $(CURDIR)/debian/tmp/share/man/man1/*

override_dh_installchangelogs:
	dh_installchangelogs -k NOTES

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	rm -f testsuite/*.ssi
	cd testsuite && make clean
endif

override_dh_install:
	sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/" \
		-e "s/@VERSION@/$(UPSTREAM_VERSION)/" debian/pkgconfig/libhmmer2.pc.in > debian/pkgconfig/libhmmer2.pc
	dh_install
	rm -f debian/pkgconfig/libhmmer2.pc

override_dh_installexamples:
	cd testsuite && make clean && cd ..
	dh_installexamples
	mkdir -p $(sampledir);
	cp -a testsuite/* $(sampledir)/;
	mkdir $(sampledir)/tutorial;
	cp -a tutorial/* $(sampledir)/tutorial;
	sed -i "s#hmm#hmm2#g" $(sampledir)/exercises.sqc
	sed -i "s#../tut#./tut#g" $(sampledir)/exercises.sqc
	find $(sampledir) -name 'Makefile' | xargs sed -i "s^$(CURDIR)^.^g"