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