File: rules

package info (click to toggle)
lintian 2.4.3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,228 kB
  • ctags: 457
  • sloc: perl: 8,492; sh: 5,561; makefile: 1,971; ansic: 143; python: 19; tcl: 4; sed: 2
file content (89 lines) | stat: -rwxr-xr-x 2,612 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# This file is public domain software, originally written by Joey Hess.

export DH_COMPAT := 5

build: build-stamp
build-stamp:
	dh_testdir
	gcc -D_REENTRANT -fPIC -c libhello.c
	gcc -o libhello.so.0.0 -shared -Wl,-soname,libhello.so.0 libhello.o
	ln -s libhello.so.0.0 libhello.so
	gcc -o hello hello.c -L. -lhello
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp *.o libhello.so.0.0
	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	install -D hello $(CURDIR)/debian/hello/usr/bin/hello
	install -D libhello.so.0.0 \
	    $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0.0
	ln -s libhello.so.0.0 \
	    $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0

# Build architecture-dependent files here.
export DH_OPTIONS
binary-arch: DH_OPTIONS=-a
binary-arch: build-stamp install
	dh_testdir
	dh_testroot
	dh_installchangelogs -N hello-dbg
	dh_installdocs
	DH_OPTIONS= dh_strip -phello --dbg-package=hello-dbg
	DH_OPTIONS= dh_strip -plibhello0 --dbg-package=libhello0-dbg

	# Now break a few things.  Copy the debugging data into places it
	# shouldn't be.
	cp $(CURDIR)/debian/hello-dbg/usr/lib/debug/usr/bin/hello \
	    $(CURDIR)/debian/hello/usr/bin/hello.dbg
	cp $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/usr/lib/libhello.so.0.0 \
	    $(CURDIR)/debian/libhello0-dbg/usr/lib/libhello.so.dbg

	# Put a full copy of the library in libhello0-dbg in /usr/lib/debug,
	# which is okay.
	install -m 644 libhello.so.0.0 \
	    $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/libhello.so.0.0

	# Also put it in /usr/lib/debug/lib, which isn't.
	install -D -m 644 libhello.so.0.0 \
	    $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/lib/libhello.so.0.0

	# Requires a versioned dependency.
	dh_icons

	dh_link
	dh_compress
	dh_fixperms
	dh_makeshlibs -X debug
	dh_installdeb
	dh_shlibdeps -X debug

	# We do this by hand as otherwise dpkg-gensymbols
	# will error due to the broken symbols file
	# and abort the build; similarly the file in
	# the source tree is _symbols so that dpkg
	# doesn't attempt to sanity check it
	install -d $(CURDIR)/debian/libhello0/DEBIAN
	install -m 644 $(CURDIR)/debian/_symbols \
	    $(CURDIR)/debian/libhello0/DEBIAN/symbols
	# hello doesn't contain any shlibs, but we
	# make it contain a symbols file
	install -d $(CURDIR)/debian/hello/DEBIAN
	install -m 644 $(CURDIR)/debian/_symbols \
	    $(CURDIR)/debian/hello/DEBIAN/symbols

	dh_gencontrol
	dh_md5sums
	dh_builddeb

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