7f83282907dd2792532aec047ca774b624385074
[oweals/tinc.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # This is the debhelper compatability version to use.
9 export DH_COMPAT=1
10
11 build: build-stamp
12 build-stamp:
13         dh_testdir
14
15 #       # If the Makefile.in.in file in po/ already contains DESTDIR support, skip the patching.
16         cd `pwd`/po ; ( \
17           if ! grep DESTDIR Makefile.in.in > /dev/null ; then \
18             patch -Ns -p0 < `pwd`/../debian/po-Makefile.in.in.diff || true ;\
19           fi ;\
20         )
21         env CFLAGS='-O2 -Wall' ./configure --prefix=/usr --mandir=\$${prefix}/share/man \
22                 --infodir=\$${prefix}/share/info --sysconfdir=/etc --localstatedir=/var
23         $(MAKE)
24
25         touch build-stamp
26
27 clean:
28         dh_testdir
29         dh_testroot
30         rm -f build-stamp
31
32         -$(MAKE) distclean
33
34         dh_clean
35
36 install: build
37         dh_testdir
38         dh_testroot
39         dh_clean -k
40         dh_installdirs
41
42         $(MAKE) install DESTDIR=`pwd`/debian/tmp
43         mkdir -p `pwd`/debian/tmp/etc/tinc/example
44         cp doc/tinc.conf.sample `pwd`/debian/tmp/etc/tinc/example/tinc.conf
45         ln -s /usr/share/doc/tinc/README.Debian `pwd`/debian/tmp/etc/tinc/example/README
46
47
48 # Build architecture-independent files here.
49 binary-indep: build install
50 # We have nothing to do by default.
51
52 # Build architecture-dependent files here.
53 binary-arch: build install
54         dh_testdir
55         dh_testroot
56         dh_installdocs
57         dh_installexamples
58         dh_installinit
59         dh_installmanpages
60         dh_installinfo
61         dh_installchangelogs ChangeLog
62         dh_link
63         dh_strip
64         dh_compress
65         dh_fixperms
66         dh_installdeb
67         dh_perl
68         dh_shlibdeps
69         dh_gencontrol
70         dh_md5sums
71         dh_builddeb
72
73 binary: binary-indep binary-arch
74 .PHONY: build clean binary-indep binary-arch binary install