File: rules

package info (click to toggle)
pdns 2.9.17-13sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,332 kB
  • ctags: 2,682
  • sloc: cpp: 20,168; sh: 16,689; makefile: 475; yacc: 188; lex: 131; sql: 69; perl: 39
file content (150 lines) | stat: -rwxr-xr-x 4,259 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/make -f
# 
# debian/rules file

# Environment
#export DH_VERBOSE=1
export DH_COMPAT=4

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CXXFLAGS = -Wall -g
CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
	CXXFLAGS += -O0
else
	CFLAGS += -O2
	CXXFLAGS += -O2
endif

backends := ldap mysql pipe gmysql gpgsql gsqlite geo

# Targets
config.status:
	dh_testdir
	# Add here commands to configure the package.
	CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--sysconfdir=/etc/powerdns \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--libdir='$${prefix}/lib/powerdns' \
		--libexecdir='$${prefix}/lib' \
		--with-dynmodules="$(backends)" \
		--with-modules="" \
		--enable-recursor


build: patch build-stamp
build-stamp: config.status

	# Clean up stuff in the debian directory
	rm -f debian/.cvsignore debian/CVS/Entries debian/CVS/Repository \
	      debian/CVS/Root debian/doc-base debian/pdns-doc.postinst \
				debian/pdns-doc.prerm debian/pdns.conffiles debian/pdns.postinst \
				debian/pdns.postrm debian/pdns.prerm debian/shlibs.local
	rm -rf debian/CVS

	# Add here commands to compile the arch part of the package.
	-$(MAKE) 

	test ! -f debian/pdns.conffiles || mv debian/pdns.conffiles debian/bogus-pdns.conffiles

	touch build-stamp

clean: clean1 unpatch
clean1:
	dh_testdir
	dh_testroot
	rm -f build-stamp config.log

	# Add here commands to clean up after the build process.
	-$(MAKE) -C modules/db2backend/ distclean
	-$(MAKE) -C modules/pdnsbackend/ distclean
	-$(MAKE) -C modules/xdbbackend/ distclean
	-$(MAKE) distclean
	-$(MAKE) -C pdns/docs clean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif

	dh_clean 
	test ! -f debian/bogus-pdns.conffiles || mv debian/bogus-pdns.conffiles debian/pdns.conffiles

install:
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Install the stuff
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C pdns/docs html/index.html

	# Install configuration files
	/usr/bin/install -c -m 600 debian/config/pdns.conf $(CURDIR)/debian/pdns-server/usr/share/pdns-server/
	/usr/bin/install -c -m 600 debian/config/pdns.local $(CURDIR)/debian/pdns-server/usr/share/pdns-server/
	/usr/bin/install -c -m 600 debian/config/recursor.conf $(CURDIR)/debian/pdns-recursor/etc/powerdns/
	/usr/bin/install -c -m 755 debian/pdns-server.init $(CURDIR)/debian/pdns-server/etc/init.d/pdns
	/usr/bin/install -c -m 644 debian/pdns-server.default $(CURDIR)/debian/pdns-server/usr/share/pdns-server/pdns
	/usr/bin/install -c -m 755 debian/pdns-recursor.init $(CURDIR)/debian/pdns-recursor/etc/init.d/pdns-recursor
	/usr/bin/install -c -m 644 debian/pdns-recursor.default $(CURDIR)/debian/pdns-recursor/etc/default/pdns-recursor
	/usr/bin/install -c -m 644 debian/config/dnsdomain2.schema $(CURDIR)/debian/pdns-backend-ldap/etc/ldap/schema

	dh_install --sourcedir=debian/tmp

# Build architecture independant packages.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i
	dh_link -i
	dh_compress -i -X changelog.html
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture dependant packages.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a
	dh_installdebconf -a
	dh_installman -a
	dh_installexamples -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

patch: patch-stamp
patch-stamp:
	dpatch apply-all
	touch patch-stamp

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install