Adjust path of example files in README file on the fly
[anytun.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 configure: configure-stamp
13 configure-stamp:
14         dh_testdir
15         cd src && ./configure --prefix=/usr --sysconfdir=/etc --examplesdir=/usr/share/anytun/examples && cd ..
16         touch configure-stamp
17
18 build: build-stamp
19
20 build-stamp: configure-stamp
21         dh_testdir
22
23         cd src && $(MAKE) && cd ..
24
25         touch $@
26
27 clean:
28         dh_testdir
29         dh_testroot
30         rm -f build-stamp configure-stamp
31
32         cd src && $(MAKE) distclean && cd ..
33
34         # drop leftover file:
35         rm -f src/tun.c
36
37         # Add here commands to clean up after the build process.
38         $(MAKE) --directory=$(CURDIR)/src distclean
39         dh_clean
40
41 install: build
42         dh_testdir
43         dh_testroot
44         dh_installdirs
45
46         # Add here commands to install the package into debian/anytun.
47         cd src && $(MAKE) DESTDIR=$(CURDIR)/debian/anytun install && cd ..
48         # Fix unusual path:
49         mv debian/anytun/usr/share/anytun/examples/anytun debian/anytun/usr/share/anytun/examples/config
50         echo "example configurations can be found at /usr/share/anytun/examples/config" > debian/anytun/etc/anytun/README
51
52 # Build architecture-independent files here.
53 binary-indep: install
54 # We have nothing to do by default.
55
56 # Build architecture-dependent files here.
57 binary-arch: install
58         dh_testdir
59         dh_testroot
60         dh_installchangelogs ChangeLog
61         dh_installdocs
62         dh_installexamples
63         dh_installinit
64         # dh_installman src/man/anytun.8
65         dh_link
66         dh_strip
67         dh_compress
68         mkdir -p debian/anytun/usr/share/lintian/overrides/ 
69         cp -av debian/overrides debian/anytun/usr/share/lintian/overrides/anytun
70         dh_fixperms
71         find debian/anytun -type f -name config     -exec chmod 600 {} \;
72         find debian/anytun -type f -name post-up.sh -exec chmod 755 {} \;
73         dh_installdeb
74         dh_shlibdeps
75         dh_gencontrol
76         dh_md5sums
77         dh_builddeb
78
79 binary: binary-indep binary-arch
80 .PHONY: build clean binary-indep binary-arch binary install configure