Simplify debian/rules and sync with uanytun
[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
51 # Build architecture-independent files here.
52 binary-indep: install
53 # We have nothing to do by default.
54
55 # Build architecture-dependent files here.
56 binary-arch: install
57         dh_testdir
58         dh_testroot
59         dh_installchangelogs ChangeLog
60         dh_installdocs
61         dh_installexamples
62         dh_installinit
63         # dh_installman src/man/anytun.8
64         dh_link
65         dh_strip
66         dh_compress
67         dh_fixperms
68         find debian/anytun -type f -name config     -exec chmod 600 {} \;
69         find debian/anytun -type f -name post-up.sh -exec chmod 755 {} \;
70         dh_installdeb
71         dh_shlibdeps
72         dh_gencontrol
73         dh_md5sums
74         dh_builddeb
75
76 binary: binary-indep binary-arch
77 .PHONY: build clean binary-indep binary-arch binary install configure