File: rules

package info (click to toggle)
prelink 0.0.20130503-1.1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,084 kB
  • ctags: 2,579
  • sloc: ansic: 27,104; sh: 11,023; cpp: 206; makefile: 185
file content (97 lines) | stat: -rwxr-xr-x 2,402 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

SHELL+= -e

#export DH_VERBOSE=1

objdir := $(CURDIR)/obj
D := $(CURDIR)/debian/prelink
E := $(CURDIR)/debian/execstack

LIBC_DEV := $(shell grep-status -F Provides libc-dev -n -sPackage)
ifeq (linux,$(DEB_HOST_ARCH_OS))
LIBSELINUX_DEV := libselinux1-dev
endif
BUILT_USING := $(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W libelf-dev $(LIBSELINUX_DEV) $(LIBC_DEV))

configure: configure-stamp
configure-stamp:
	dh_testdir

	dh_autoreconf
	mkdir -p $(objdir)
	cd $(objdir) && ../configure \
		--prefix=/ --mandir=/usr/share/man/ --disable-shared \
		--disable-libtool-lock --disable-dependency-tracking

	touch $@

build: build-arch build-indep
build-arch: build-stamp
build-indep:
build-stamp: configure-stamp 
	dh_testdir

	cd $(objdir) && $(MAKE)
	
	# Commented out until a stable test suite has been added
	#@echo "====================TESTING========================="
	#cd $(objdir) && $(MAKE) -C testsuite check-harder
	#cd $(objdir) && $(MAKE) -C testsuite check-cycle
	#@echo "====================TESTING END====================="

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	rm -rf $(objdir)

	dh_autoreconf_clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k

	dh_installdirs etc/ etc/default/ usr/sbin/
	cp $(objdir)/src/prelink $(objdir)/src/execstack $D/usr/sbin/
	mv $D/usr/sbin/prelink  $D/usr/sbin/prelink.bin
	cp $(CURDIR)/debian/prelink.sh $D/usr/sbin/prelink
	chmod 0755 $D/usr/sbin/prelink
	cp debian/prelink.conf $D/etc/
	dh_installdirs -pexecstack usr/sbin/
	mv $D/usr/sbin/execstack $E/usr/sbin/

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	( cat debian/prelink.spec || \
		printf "\n%%changelog\nNo upstream changelog\n" ) | \
	sed -e '1,/^%changelog$$/d' \
		> $D/usr/share/doc/prelink/changelog
	dh_installdocs TODO doc/prelink.pdf
	dh_installman doc/prelink.8 debian/prelink.bin.8
	dh_installman -pexecstack doc/execstack.8
	dh_installcron
	cp debian/prelink.default $D/etc/default/prelink
	dh_lintian
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- -V"built-using=$(BUILT_USING)"
	dh_builddeb

binary: binary-arch

.PHONY: build-indep build-arch build clean
.PHONY: binary-indep binary-arch binary install configure