2 # Sample debian/rules that uses debhelper.
3 # This file is public domain software, originally written by Joey Hess.
10 gcc -D_REENTRANT -fPIC -c libhello.c
11 gcc -o libhello.so.0.0 -shared -Wl,-soname,libhello.so.0 libhello.o
12 ln -s libhello.so.0.0 libhello.so
13 gcc -o hello hello.c -L. -lhello
19 rm -f build-stamp *.o libhello.so.0.0
26 install -D hello $(CURDIR)/debian/hello/usr/bin/hello
27 install -D libhello.so.0.0 \
28 $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0.0
29 ln -s libhello.so.0.0 \
30 $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0
32 # Build architecture-dependent files here.
34 binary-arch: DH_OPTIONS=-a
35 binary-arch: build-stamp install
40 DH_OPTIONS= dh_strip -phello --dbg-package=hello-dbg
41 DH_OPTIONS= dh_strip -plibhello0 --dbg-package=libhello0-dbg
43 # Now break a few things. Copy the debugging data into places it
45 cp $(CURDIR)/debian/hello-dbg/usr/lib/debug/usr/bin/hello \
46 $(CURDIR)/debian/hello/usr/bin/hello.dbg
47 cp $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/usr/lib/libhello.so.0.0 \
48 $(CURDIR)/debian/libhello0-dbg/usr/lib/libhello.so.dbg
50 # Put a full copy of the library in libhello0-dbg in /usr/lib/debug,
52 install -m 644 libhello.so.0.0 \
53 $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/libhello.so.0.0
55 # Also put it in /usr/lib/debug/lib, which isn't.
56 install -D -m 644 libhello.so.0.0 \
57 $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/lib/libhello.so.0.0
59 # Requires a versioned dependency.
65 dh_makeshlibs -X debug
69 # We do this by hand as otherwise dpkg-gensymbols
70 # will error due to the broken symbols file
71 # and abort the build; similarly the file in
72 # the source tree is _symbols so that dpkg
73 # doesn't attempt to sanity check it
74 install -d $(CURDIR)/debian/libhello0/DEBIAN
75 install -m 644 $(CURDIR)/debian/_symbols \
76 $(CURDIR)/debian/libhello0/DEBIAN/symbols
77 # hello doesn't contain any shlibs, but we
78 # make it contain a symbols file
79 install -d $(CURDIR)/debian/hello/DEBIAN
80 install -m 644 $(CURDIR)/debian/_symbols \
81 $(CURDIR)/debian/hello/DEBIAN/symbols
88 binary: binary-indep binary-arch
89 .PHONY: binary binary-indep binary-arch build clean install