File: rules

package info (click to toggle)
dspam 3.6.8-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,372 kB
  • ctags: 1,457
  • sloc: ansic: 24,738; sh: 9,860; perl: 2,378; makefile: 546; sql: 327
file content (175 lines) | stat: -rwxr-xr-x 5,192 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
#
# This rules file is coming from dh_make and is modified by the
# Debian DSPAM maintainers team.

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

# 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)

CFLAGS = -Wall -g
STORAGE = "libdb4_drv,mysql_drv,pgsql_drv,sqlite3_drv,hash_drv"
CONFIGURE	= --host=$(DEB_HOST_GNU_TYPE) \
		  --build=$(DEB_BUILD_GNU_TYPE) \
		  --prefix=/usr \
		  --includedir=/usr/include \
		  --mandir=/usr/share/man \
		  --infodir=/usr/share/info \
		  --with-logdir=/var/log/dspam/ \
		  --localstatedir=/var \
		  --libexecdir=/usr/lib/dspam \
		  --srcdir=.. \
		  --with-dspam-home=/var/spool/dspam \
		  --sysconfdir=/etc/dspam \
		  --enable-domain-scale \
		  --enable-signature-headers \
		  --with-delivery-agent=/usr/bin/procmail \
		  --enable-daemon \
		  --with-mysql-includes=/usr/include/mysql \
		  --with-pgsql-includes=`pg_config --includedir` \
		  --with-storage-driver=${STORAGE} \
		  --enable-ldap \
		  --enable-debug

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

ifeq (,$(findstring disable_virtual_users,$(DEB_BUILD_OPTIONS)))
	CONFIGURE += --enable-virtual-users
endif
ifeq (,$(findstring disable_preferences_extension,$(DEB_BUILD_OPTIONS)))
	CONFIGURE += --enable-preferences-extension
endif
ifneq (,$(findstring verbose_debug,$(DEB_BUILD_OPTIONS)))
	CONFIGURE += --verbose-debug
endif
ifeq (,$(findstring disable_clamav,$(DEB_BUILD_OPTIONS)))
	CONFIGURE += --enable-clamav
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	mkdir build--tmp
	./autogen.sh
	(cd build--tmp && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ../configure $(CONFIGURE))
	touch configure-stamp

# Build target.
build: patch build-stamp
build-stamp: configure
	(cd build--tmp && $(MAKE))
	chmod 644 webui/cgi-bin/templates/*
	chmod 644 webui/cgi-bin/admins
	chmod 644 webui/cgi-bin/default.prefs
	chmod 644 webui/cgi-bin/rgb.txt
	chmod 644 webui/htdocs/base.css
	chmod 644 webui/htdocs/dspam-logo-small.gif
	chmod 644 src/tools.sqlite_drv/purge-3.sql
	touch build-stamp

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot
	rm -rf debian/dspam-webfrontend
	rm -rf build--tmp
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) 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 

install: build
	dh_testdir
	dh_testroot
	
	dh_clean -k
	dh_installdirs
	(cd build--tmp && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp)
	dh_install --list-missing
	
	# Install override for conffiles into /usr/share
	cp debian/dspam-webfrontend.override $(CURDIR)/debian/dspam-webfrontend/usr/share/lintian/overrides/dspam-webfrontend
	cp debian/libdspam7-drv-mysql.override $(CURDIR)/debian/libdspam7-drv-mysql/usr/share/lintian/overrides/libdspam7-drv-mysql
	cp debian/libdspam7-drv-pgsql.override $(CURDIR)/debian/libdspam7-drv-pgsql/usr/share/lintian/overrides/libdspam7-drv-pgsql
	
	# Install configure.pl as /etc/dspam/webfrontend.conf
	install -d -g root -m 755 -o root $(CURDIR)/debian/dspam-webfrontend/etc/dspam
	cp build--tmp/webui/cgi-bin/configure.pl $(CURDIR)/debian/dspam-webfrontend/etc/dspam/webfrontend.conf
	
	# Install PostgreSQL data file
	cp debian/sqlfiles/pgsql-dbadmin $(CURDIR)/debian/libdspam7-drv-pgsql/usr/share/dbconfig-common/data/libdspam7-drv-pgsql/install-dbadmin/pgsql

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i CHANGELOG
	dh_installdocs -i
	# removing svn-related directory from dspam-doc package
	#find debian/dspam-doc -type d -name '.svn' -exec rm -rf {} \; || true
	dh_compress -i -A
	dh_link -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture dependant packages using the common target.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a CHANGELOG
	dh_install -a
	dh_installdocs -a
	dh_installcron -a
	dh_installlogrotate -a
	dh_installman -a
	dh_installinit -a -- start 21 2 3 4 5 . stop 21 0 1 6 .
	dh_installdebconf -a
	dh_makeshlibs -a -Nlibdspam7-drv-pgsql -Nlibdspam7-drv-mysql -Nlibdspam7-drv-db4 -Nlibdspam7-drv-sqlite3 -Ndspam
	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 configure