File: rules

package info (click to toggle)
emboss 6.6.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 571,536 kB
  • ctags: 40,250
  • sloc: ansic: 460,579; java: 29,439; perl: 13,573; sh: 12,754; makefile: 3,283; csh: 706; asm: 351; xml: 239; pascal: 237; modula3: 8
file content (136 lines) | stat: -rwxr-xr-x 5,944 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
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
129
130
131
132
133
134
135
136
#!/usr/bin/make -f

export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# TODO - migrate all binary JARs to use the packaged versions instead.
#  activation.jar never used??  Or sould we use the system version?
#  Note activation.jar was included in upstream but unused.
#export CLASSPATH=/usr/share/java/activation.jar:

%:
	dh $@ --with autotools-dev,autoreconf

VERSION := $(shell dpkg-parsechangelog | grep Ver | cut -d' ' -f2 | cut -d- -f1)
RENAMED := cons pscan

EMBOSS-TMP  = $(CURDIR)/debian/emboss_tmp
EMBOSS      = $(CURDIR)/debian/emboss
EMBOSS-TEST = $(CURDIR)/debian/emboss-test
EMBOSS-LIB  = $(CURDIR)/debian/emboss-lib

CONFFLAGS    = --bindir=/usr/lib/emboss
CONFFLAGS   += --libdir=/usr/lib/emboss/lib
CONFFLAGS   += --includedir=/usr/lib/emboss/include
CONFFLAGS   += --enable-systemlibs
CONFFLAGS   += --with-java=/usr/lib/jvm/default-java/include
CONFFLAGS   += --with-javaos=/usr/lib/jvm/default-java/include/linux

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)

DEB_LDFLAGS += -lexpat
DEB_LDFLAGS += $(shell mysql_config --libs)
DEB_LDFLAGS += -lpq
DEB_LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
#DEB_LDFLAGS += $(shell pg_config  | grep LIBS | cut -f2 -d=)

override_dh_auto_configure:
	dh_autotools-dev_updateconfig
	dh_auto_configure -- $(CONFFLAGS)

override_dh_auto_build:
	dh_auto_build -- AJAX_FIXED_ROOT=\\\"/usr/share/EMBOSS\\\" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(DEB_LDFLAGS)"
	# Add 2 extra files wanted in jemboss.jar
	cd jemboss/lib && make jemboss.jar
	cd jemboss && jar uf lib/jemboss.jar resources/version resources/*.properties

override_dh_clean:
	dh_autotools-dev_restoreconfig
	rm -rf debian/emboss_tmp
	find jemboss/ -type f -name "*.class" -delete
	[ ! -d debian/testbackup ] || ( $(RM) --recursive test ; mv debian/testbackup test )
	dh_clean  --exclude=feattext.html~ config.status test-stamp install-stamp
	rm -f jemboss/runJemboss.sh
	rm -f jemboss/utils/makeJar.csh
	rm -f jemboss/lib/jemboss.jar jemboss/resources/resources.jar jemboss/lib/activation.jar
	find test '(' -name 'Makefile' -o -name 'Makefile.in' ')' -delete
	rm -f config.guess

override_dh_auto_install-arch:
	### Binaries and data go to a temporary dir before being moved to their own package ###
	$(MAKE) -C emboss install DESTDIR=$(EMBOSS-TMP)

	# Make symbolic links from /usr/bin to /usr/lib/emboss
	cd $(EMBOSS)/usr/bin/ ; \
		for i in $(EMBOSS-TMP)/usr/lib/emboss/* ; \
		do ln -sf ../lib/emboss/`basename $$i` . ; \
		done

	### Renaming conflicting binaries (see also in binary-arch) ###
	for i in $(RENAMED) ; \
		do mv $(EMBOSS)/usr/bin/$$i $(EMBOSS)/usr/bin/em_$$i ; \
		done

	### EMBOSS libraries go in the emboss-lib package. ###
	$(MAKE) -C ajax install DESTDIR=$(EMBOSS-LIB)
	$(MAKE) -C nucleus install DESTDIR=$(EMBOSS-LIB)
	$(MAKE) -C plplot install DESTDIR=$(EMBOSS-LIB)
	find $(EMBOSS-LIB)/usr/lib -name '*.la' -exec rm {} \;

	### Documentation goes in emboss-doc. ###
	$(MAKE) -C doc install DESTDIR=$(CURDIR)/debian/emboss-doc
	antiword debian/emboss-doc/usr/share/EMBOSS/doc/manuals/domainatrix.doc > debian/emboss-doc/usr/share/EMBOSS/doc/manuals/domainatrix.txt
	# Remove this file when the relicenced file becomes part of the upstream tarball.
	uudecode -o debian/emboss-doc/usr/share/EMBOSS/doc/manuals/EMBOSS_qg.pdf debian/EMBOSS_qg_new.pdf.uu

override_dh_auto_install-indep:
	### While the next call repeats a statement from install-arch it is needed to get the
	### data dir right into place.  Make should be clever enough to not duplicate the process
	$(MAKE) -C emboss install DESTDIR=$(EMBOSS-TMP)
	$(MAKE) -C jemboss install DESTDIR=$(CURDIR)/debian/jemboss bindir=/usr/bin
	# install target seems to remove executable flag which is claimed by lintian
	find debian/jemboss/usr/share/EMBOSS/jemboss/utils -type f -not -executable -name "*sh" -exec chmod a+x \{\} \;
	# dangling LICEN[CS]E FILE
	rm debian/jemboss/usr/share/EMBOSS/jemboss/LICENSE
	# resources.jar not needed as we use the data files in /usr/share/EMBOSS/data/
	rm -f debian/jemboss/usr/share/EMBOSS/jemboss/resources/resources.jar

	### Installation of the test suite
	cp -a test debian/emboss-test/usr/share/EMBOSS/
	sed -i "/SET emboss_tempdata/cSET emboss_tempdata /usr/share/EMBOSS/test" debian/emboss-test/usr/share/EMBOSS/test/.embossrc
	sed -i "/SET emboss_qadata/cSET emboss_qadata /usr/share/EMBOSS/test" debian/emboss-test/usr/share/EMBOSS/test/.embossrc
	mv debian/emboss-test/usr/share/EMBOSS/test/.embossrc debian/emboss-test/etc/emboss/embossrc.d/emboss-test
	find debian/emboss-test/usr/share/EMBOSS/test/data -executable -type f -exec chmod a-x \{\} \;
	find debian/emboss-test/usr/share/EMBOSS/test -type d -name CVS | xargs rm -rf
	find debian/emboss-test/usr/share/EMBOSS/test -type f -name .cvsignore -delete

override_dh_auto_test:
	$(RM) test-stamp
	[ -d debian/testbackup ] || cp -a test debian/testbackup
	sed -i "/SET emboss_tempdata/cSET emboss_tempdata $(CURDIR)/test" test/.embossrc
	sed -i "/SET emboss_qadata/cSET emboss_qadata $(CURDIR)/test" test/.embossrc
	echo "SET emboss_acdroot $(CURDIR)/emboss/acd" >> test/.embossrc
	echo "SET emboss_data $(CURDIR)/emboss/data" >> test/.embossrc
	echo "SET emboss_docroot $(CURDIR)/doc" >> test/.embossrc
	cd test/qa && LS_COLORS='' EMBOSSRC=$(CURDIR)/test PATH=$(CURDIR)/emboss:$$PATH EMBOSS_ROOT=../../../ ./qatest.csh

override_dh_installchangelogs:
	dh_installchangelogs -k ChangeLog

override_dh_installman-arch:
	dh_installman -a -p emboss
	for i in $(RENAMED) ; \
		do dh_link usr/share/man/man1/$$i.1e.gz usr/share/man/man1/em_$$i.1e.gz ; \
		done

override_dh_builddeb:
	dh_builddeb -- -Z xz


# Target to refresh the manpages; needs libemboss-acd-perl, xsltproc, docbook-xml and docbook-xsl
manpages: debian/manpages/success
debian/manpages/success:
	debian/build-manpages.sh
	echo "The manpages have been sucessfully built" > debian/manpages/success