File: rules

package info (click to toggle)
bandwidthd 2.0.1%2Bcvs20090917-13
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 1,308 kB
  • sloc: sh: 3,008; ansic: 2,752; php: 1,263; yacc: 216; makefile: 159; lex: 36; sql: 27
file content (182 lines) | stat: -rwxr-xr-x 6,034 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

configureoptions = --bindir=/usr/sbin/ --sysconfdir=/etc/bandwidthd/ --localstatedir=/var/lib/

p_bwdstatic = bandwidthd
p_bwdpgsql = bandwidthd-pgsql

build_bwdstatic = debian/bandwidthd
build_bwdpgsql = debian/bandwidthd-pgsql


CFLAGS = -Wall

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif

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

configure:

configure-bwdstatic: configure-bwdstatic-stamp

configure-bwdstatic-stamp:
	dh_testdir
	#[ ! -f Makefile ] || $(MAKE) clean
	cp -f /usr/share/misc/config.guess config.guess
	cp -f /usr/share/misc/config.sub config.sub
	dh_autoreconf
	chmod +x configure
	INSTALL='install --strip-program=true' dh_auto_configure -- $(configureoptions) --disable-pgsql
	touch $@
	
configure-bwdpgsql: configure-bwdpgsql-stamp

configure-bwdpgsql-stamp: 
	dh_testdir
	#[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f /usr/share/misc/config.guess ] || cp -f /usr/share/misc/config.guess config.guess
	[ ! -f /usr/share/misc/config.sub ] || cp -f /usr/share/misc/config.sub config.sub
	chmod +x configure
	INSTALL='install --strip-program=true' dh_auto_configure -- $(configureoptions) --enable-pgsql
	touch $@


build:

build-bwdstatic: configure-bwdstatic build-stamp
build-bwdpgsql: configure-bwdpgsql build-stamp

build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch $@


clean:
	dh_testdir
	dh_testroot
	debconf-updatepo # update debian/po/templates.pot
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_autoreconf_clean
	rm -f build-stamp configure-stamp
	rm -f config.guess config.sub
	rm -f configure-*-stamp
	rm -f conf.l.* conf.tab.*
	rm -f config.log config.h config.status
	dh_clean

install:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) -f debian/rules install-bwdstatic
	$(MAKE) clean
	$(MAKE) -f debian/rules install-bwdpgsql

install-bwdstatic: DH_OPTIONS=-p$(p_bwdstatic)
install-bwdstatic: build-bwdstatic
	# Add here commands to install the package into debian/bandwidthd.
	$(MAKE) install DESTDIR=$(CURDIR)/$(build_bwdstatic)
	# install bandwidthd.conf template
	mkdir -p debian/bandwidthd/usr/share/bandwidthd/
	install -m 644 -o root -g root debian/extras/bandwidthd.conf.template \
		debian/bandwidthd/usr/share/bandwidthd/
	# install apache2 config
	mkdir -p debian/bandwidthd/etc/apache2/conf-available/
	install -m 644 -o root -g root debian/extras/apache2.conf \
		debian/bandwidthd/etc/apache2/conf-available/bandwidthd.conf
	# Install debconf files for bandwidthd
	dh_installdebconf --mainpackage=$(p_bwdstatic)
	# Install init.d script for bandwidthd
	dh_installinit --name=bandwidthd --mainpackage=$(p_bwdstatic)
	# Install manpages for bandwidthd
	dh_installman --mainpackage=$(p_bwdstatic)


install-bwdpgsql: DH_OPTIONS=-p$(p_bwdpgsql)
install-bwdpgsql: build-bwdpgsql
	# Add here commands to install the package into debian/bandwidthd-pgsql.
	$(MAKE) install DESTDIR=$(CURDIR)/$(build_bwdpgsql)
	# install summarizer script
	install -m 644 phphtdocs/bd_pgsql_purge.sh debian/bandwidthd-pgsql/usr/sbin/bd_pgsql_purge
	# install web-interface.
	install -m 644 phphtdocs/bandwidthd.css debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/*.gif debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	# ... but only a subset of the php files (the ones that are useful).
	install -m 644 phphtdocs/details.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/failures.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/footer.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/graph.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/header.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/include.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/location_statistics.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/sensors.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	#install -m 644 phphtdocs/uptime.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/

	# install postgresql-connection config, webgroup-readable.
	mkdir -p debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 640 -g www-data phphtdocs/config.conf \
		debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/config.conf
	# install shell scripts in document-directory.
	mkdir -p debian/bandwidthd-pgsql/usr/share/doc/bandwidthd-pgsql/
	install -m 755 phphtdocs/*.sh \
		debian/bandwidthd-pgsql/usr/share/doc/bandwidthd-pgsql/
	# install bandwidthd-pgsql.conf template
	mkdir -p debian/bandwidthd-pgsql/usr/share/bandwidthd-pgsql/
	install -m 644 -o root -g root debian/extras/bandwidthd-pgsql.conf.template \
		debian/bandwidthd-pgsql/usr/share/bandwidthd-pgsql/
	# install apache2 config
	mkdir -p debian/bandwidthd-pgsql/etc/apache2/conf-available/
	install -m 644 -o root -g root debian/extras/apache2.conf \
		debian/bandwidthd-pgsql/etc/apache2/conf-available/bandwidthd.conf
	# Install debconf files for bandwidthd-pgsql
	dh_installdebconf --mainpackage=$(p_bwdpgsql)
	# Install init.d script for bandwidthd-pgsql
	dh_installinit --name=bandwidthd --mainpackage=$(p_bwdpgsql)
	# Install manpages for bandwidthd-pgsql
	dh_installman --mainpackage=$(p_bwdpgsql)


build-arch: build

build-indep:

# Build architecture-independent files here.
binary-indep: install 

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs CHANGELOG
	dh_installdocs
	dh_installdirs
	## ------
	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