File: rules

package info (click to toggle)
pdnsd 1.2.6-par-11
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,528 kB
  • ctags: 1,485
  • sloc: ansic: 14,357; sh: 1,278; makefile: 197; perl: 185
file content (110 lines) | stat: -rwxr-xr-x 3,076 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/make -f

CFLAGS=-Wall -Wextra -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
CPPFLAGS=-DDEBIAN
build_target:=$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS|sed -e s/kfree//)

srcpkg = $(shell dpkg-parsechangelog | sed -ne 's/Source: *//p')
srcver = $(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*:\)\?\(.*\)-[0-9.]*$$/\2/p')
#{{{ generic rules

../$(srcpkg)_$(srcver).orig.tar.gz:
	@if git rev-parse --git-dir >/dev/null 2>&1; then                 \
	    echo -n 'Regenerating $(@F)';                                 \
	    git show pristine-tar:$(@F).delta | pristine-tar gentar - $@; \
	    echo .;                                                       \
	fi

check-tarball: ../$(srcpkg)_$(srcver).orig.tar.gz

.PHONY: check-tarball

#}}}
#{{{ maintainer stuff

refresh-patches: check-tarball
	@dh_testdir
	@echo 'refreshing debian/patches:'
	@rm -rf '$(CURDIR)'/debian/patches
	@mkdir -p '$(CURDIR)'/debian/patches
	@cd '$(CURDIR)'/debian/patches && git format-patch upstream..upstream+patches
	@echo .

#}}}

patch: patch-stamp check-tarball
patch-stamp:
	dh_testdir
	set -e; test -e patch-stamp || \
	    for i in `ls -1 debian/patches/*.patch || :`; do patch -p1 <$$i > /dev/null; done
	touch $@

unpatch:
	dh_testdir
	set -e; ! test -e patch-stamp || \
	    for i in `ls -1r debian/patches/*.patch || :`; do patch -p1 -R <$$i > /dev/null; done
	rm -f patch-stamp

configure: configure-stamp
configure-stamp: patch
	dh_testdir
	CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" ./configure \
	       --prefix=/usr                                  \
	       --sysconfdir=/etc                              \
	       --with-target=$(build_target)                  \
	       \
	       --enable-ipv6                                  \
	       --enable-new-rrs                               \
	       --enable-isdn                                  \
	       --enable-tcp-queries
	touch $@

build: configure build-stamp
build-stamp:
	dh_testdir
	$(MAKE)
	touch $@

clean:
	dh_testdir
	dh_testroot
	! test -f Makefile || $(MAKE) distclean
	rm -rf *-stamp autom4te.cache config.status config.log
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) DESTDIR=$(CURDIR)/debian/pdnsd install
	cp debian/pdnsd.conf debian/pdnsd/etc/pdnsd.conf
	cp debian/pdnsd-*.conf debian/pdnsd/usr/share/pdnsd/
	rm -f debian/pdnsd/var/cache/pdnsd/pdnsd.cache
	rm -f debian/pdnsd/etc/pdnsd.conf.sample
	install -m 755 debian/resolvconf debian/pdnsd/etc/resolvconf/update.d/pdnsd

binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs
	dh_installexamples doc/pdnsd.conf
	dh_installmenu
#       39 is just after resolvconf
	dh_installinit -- start 20 2 3 4 5 . start 39 S . stop 80 0 1 6 .
	dh_installman
	dh_installchangelogs ChangeLog Changelog.old
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch