File: rules

package info (click to toggle)
biosquid 1.9g%2Bcvs20050121-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,624 kB
  • sloc: ansic: 12,750; sh: 1,412; perl: 243; makefile: 233
file content (75 lines) | stat: -rwxr-xr-x 2,675 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

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

include /usr/share/dpkg/default.mk
LIBNAME	       := libsquid

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -f configure

override_dh_auto_configure:
	# autoreconf && true
	autoconf
	dh_auto_configure --  --enable-lfs # --enable-pvm
	# avoid duplicated definition of PACKAGE_NAME (basically conflicting with hmmer2 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' \
	       squidconf.h

override_dh_install:
	mv $(CURDIR)/debian/tmp/usr/bin/translate $(CURDIR)/debian/tmp/usr/bin/stranslate
	dh_install
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
		    --exclude-la \
		    --movedev debian/tmp/usr/include/* usr/include \
		    --movedev squid.h usr/include/$(DEB_SOURCE) \
		    --movedev squidconf.h usr/include/$(DEB_SOURCE) \
		    --movedev "debian/tmp/usr/lib/*/pkgconfig/*.pc" usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
		    debian/tmp/usr/lib/*/$(LIBNAME).so
	find debian -name "lib*.la" -delete
	# resolve @LICENSE@ by text in header files
	for HEADER in $(CURDIR)/debian/$(LIBNAME)-dev/usr/include/$(DEB_SOURCE)/*.h ; do \
	  if grep -q '@LICENSE@' $${HEADER} ; then \
	    sed '/@LICENSE@/,$$d' $${HEADER} > $${HEADER}_tmp ; \
	    sed 's/^/ * /' Licenses/gnu     >> $${HEADER}_tmp ; \
	    sed '0,/@LICENSE@/d' $${HEADER} >> $${HEADER}_tmp ; \
	    mv $${HEADER}_tmp $${HEADER} ; \
	  fi ; \
	done

override_dh_installexamples:
	dh_installexamples
	cd $(CURDIR)/debian/biosquid-dev/usr/share/doc/biosquid-dev/examples/Testsuite; make clean
	sed -i 's#/usr/local/bin/perl#/usr/bin/perl#' $(CURDIR)/debian/$(LIBNAME)-dev/usr/share/doc/$(LIBNAME)-dev/examples/Formats/*.pl

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	chmod u+x Testsuite/x-base-* Testsuite/bug-1-sfetch*
	ln -s .libs/libsquid.a
	dh_auto_test
	cd Testsuite && make clean
endif

override_dh_installman:
	dh_installman
	for manpage in Man/*.man; do \
	    cp -a $${manpage} $(CURDIR)/debian/biosquid/usr/share/man/man1/`basename $${manpage} .man`.1 ; \
	done