Update debian/rules file
[anytun.git] / debian / rules
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 #export DH_VERBOSE = 1
5
6 # see FEATURE AREAS in dpkg-buildflags(1)
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
8
9 # see ENVIRONMENT in dpkg-buildflags(1)
10 # package maintainers to append CFLAGS
11 #export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
12 # package maintainers to append LDFLAGS
13 #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
14
15
16 configure: configure-stamp
17 configure-stamp:
18         dh_testdir
19         cd src && ./configure --no-manpage --prefix=/usr --sysconfdir=/etc --examplesdir=/usr/share/anytun/examples && cd ..
20         touch configure-stamp
21
22 build: build-arch build-indep
23
24 build-arch: build-stamp
25 build-indep: build-stamp
26
27 build-stamp: configure-stamp
28         dh_testdir
29
30         cd src && $(MAKE) && cd ..
31
32         touch $@
33
34 clean:
35         dh_testdir
36         dh_testroot
37         rm -f build-stamp configure-stamp
38
39         # Add here commands to clean up after the build process.
40         $(MAKE) --directory=$(CURDIR)/src distclean
41         dh_clean
42
43 install: build
44         dh_testdir
45         dh_testroot
46         dh_installdirs
47
48         # Add here commands to install the package into debian/anytun.
49         cd src && $(MAKE) DESTDIR=$(CURDIR)/debian/anytun install && cd ..
50         # Fix unusual path:
51         mv debian/anytun/usr/share/anytun/examples/anytun debian/anytun/usr/share/anytun/examples/config
52         echo "example configurations can be found at /usr/share/anytun/examples/config" > debian/anytun/etc/anytun/README
53
54 # Build architecture-independent files here.
55 binary-indep: install
56 # We have nothing to do by default.
57
58 # Build architecture-dependent files here.
59 binary-arch: install
60         dh_testdir
61         dh_testroot
62         dh_installchangelogs ChangeLog
63         dh_installdocs
64         dh_installman doc/anytun.8 doc/anytun-config.8 doc/anytun-controld.8 doc/anytun-showtables.8
65         dh_installexamples
66         dh_installinit
67         dh_link
68         dh_strip
69         dh_compress
70         mkdir -p debian/anytun/usr/share/lintian/overrides/
71         cp -av debian/overrides debian/anytun/usr/share/lintian/overrides/anytun
72         dh_fixperms
73         find debian/anytun -type f -name config     -exec chmod 600 {} \;
74         find debian/anytun -type f -name post-up.sh -exec chmod 755 {} \;
75         chmod 600 debian/anytun/usr/share/anytun/examples/config/server/conf.d/*
76         dh_installdeb
77         dh_shlibdeps
78         dh_gencontrol
79         dh_md5sums
80         dh_builddeb
81
82 binary: binary-indep binary-arch
83 .PHONY: build clean binary-indep binary-arch binary install configure