fix install paths
[packages/xinetd.git] / debian / rules
1 #!/usr/bin/make -f
2
3 CFLAGS=-Wall -Wextra -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
4 tmp = $(CURDIR)/debian/xinetd
5
6 srcpkg = $(shell dpkg-parsechangelog | sed -ne 's/Source: *//p')
7 srcver = $(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*:\)\?\(.*\)-[0-9.]*$$/\2/p')
8 pkgdir = '$(CURDIR)'/debian/xinetd
9 #{{{ generic rules
10
11 ../$(srcpkg)_$(srcver).orig.tar.gz:
12         @if git rev-parse --git-dir >/dev/null 2>&1; then                 \
13             echo -n 'Regenerating $(@F)';                                 \
14             git show pristine-tar:$(@F).delta | pristine-tar gentar - $@; \
15             echo .;                                                       \
16         fi
17
18 check-tarball: ../$(srcpkg)_$(srcver).orig.tar.gz
19
20 .PHONY: check-tarball
21
22 #}}}
23 #{{{ maintainer stuff
24
25 refresh-patches: check-tarball
26         @dh_testdir
27         @echo 'refreshing debian/patches:'
28         @rm -rf '$(CURDIR)'/debian/patches
29         @mkdir -p '$(CURDIR)'/debian/patches
30         @cd '$(CURDIR)'/debian/patches && git format-patch upstream..upstream+patches
31         @echo .
32
33 #}}}
34
35 patch: patch-stamp check-tarball
36 patch-stamp:
37         dh_testdir
38         set -e; test -e patch-stamp || \
39             for i in `ls -1 debian/patches/*.patch || :`; do patch -p1 <$$i > /dev/null; done
40         touch $@
41
42 unpatch:
43         dh_testdir
44         set -e; ! test -e patch-stamp || \
45             for i in `ls -1r debian/patches/*.patch || :`; do patch -p1 -R <$$i > /dev/null; done
46         rm -f patch-stamp
47
48 configure: configure-stamp
49 configure-stamp:
50         dh_testdir
51         chmod -R a=rX,u=rwX .
52         CFLAGS="-O2" ./configure --prefix=/usr         \
53                --mandir=\$${prefix}/share/man          \
54                --infodir=\$${prefix}/share/info        \
55                --host=$(DEB_HOST_GNU_TYPE)             \
56                --build=$(DEB_BUILD_GNU_TYPE)           \
57                \
58                --with-loadavg          \
59                --with-libwrap
60         touch $@
61
62 build: configure-stamp build-stamp
63 build-stamp:
64         dh_testdir
65         $(MAKE)
66         touch $@
67
68 clean: unpatch
69         dh_testdir
70         dh_testroot
71         ! test -e Makefile || $(MAKE) distclean
72         rm -f build-stamp configure-stamp
73         dh_clean
74
75 install: build
76         dh_testdir
77         dh_testroot
78         dh_clean -k
79         dh_installdirs
80         $(MAKE) install prefix=$(pkgdir)/usr
81
82 binary-indep: build install
83
84 binary-arch: build install
85         dh_testdir
86         dh_testroot
87         dh_installchangelogs CHANGELOG
88         dh_installdocs README debian/README.update-inetd debian/xinetd.org-FAQ.html
89         dh_installexamples xinetd/sample.conf
90         dh_installinit -r
91         dh_installdebconf
92         dh_install
93         dh_strip
94         dh_compress
95         dh_fixperms
96         dh_installdeb
97         dh_shlibdeps
98         dh_gencontrol
99         dh_md5sums
100         dh_builddeb
101
102 binary: binary-indep binary-arch
103
104 .PHONY: build clean binary-indep binary-arch binary install configure