File: rules

package info (click to toggle)
bandwidthd 2.0.1%2Bcvs20050208-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,048 kB
  • ctags: 378
  • sloc: sh: 3,169; ansic: 1,974; php: 596; yacc: 202; makefile: 131; lex: 33
file content (152 lines) | stat: -rwxr-xr-x 4,241 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
#!/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 = --prefix=/usr --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 -g

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

configure:

configure-bwdstatic: configure-bwdstatic-stamp

configure-bwdstatic-stamp:
	dh_testdir
	#autoconf
	./configure $(configureoptions) --disable-pgsql
	touch $@
	
configure-bwdpgsql: configure-bwdpgsql-stamp

configure-bwdpgsql-stamp:
	dh_testdir
	#autoconf
	./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
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-rm -f configure-*-stamp
	-rm -f conf.l.* conf.tab.*
	-rm -f config.log config.h config.status
	[ ! -f Makefile ] || $(MAKE) distclean

	dh_clean 

install:
	dh_testdir
	dh_testroot
	dh_clean -k 
	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/doc/bandwidthd/
	install -m 644 -o root -g root debian/extras/bandwidthd.conf \
		debian/bandwidthd/usr/share/doc/bandwidthd/
	# Install debconf files for bandwidthd
	dh_installdebconf --mainpackage=$(p_bwdstatic)
	# Install init.d script for bandwidthd
	dh_installinit --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 web-interface.
	install -m 644 phphtdocs/*.php debian/bandwidthd-pgsql/var/lib/bandwidthd/htdocs/
	install -m 644 phphtdocs/*.gif 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/usr/share/doc/bandwidthd/
	install -m 644 -o root -g root debian/extras/bandwidthd-pgsql.conf \
		debian/bandwidthd-pgsql/usr/share/doc/bandwidthd-pgsql/
	# install postgresql-schema in document-directory.
	install -m 644 schema.postgresql debian/bandwidthd-pgsql/usr/share/doc/bandwidthd-pgsql/
	# 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 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