File: rules

package info (click to toggle)
sympa 5.2.3-1.2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 21,384 kB
  • ctags: 3,566
  • sloc: perl: 27,368; sh: 3,990; makefile: 1,366; ansic: 226; php: 105; lisp: 32
file content (215 lines) | stat: -rwxr-xr-x 7,149 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.

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

export DH_COMPAT=4

# Include patch-speficic rules
include debian/rules.patch

# Package temporary directories
SYMPA=$(shell pwd)/debian/sympa

GENCAT=`which gencat || echo '/usr/bin/gencat'`

# Additional directories
CONF=$(shell pwd)/debian/conf
DB=$(shell pwd)/debian/db
DOC=$(shell pwd)/debian/doc

PERL=/usr/bin/perl

SCRIPTS = p12topem.pl testldap.pl load_subscribers.pl orphan_killer.pl \
	crypt_passwd.pl init_comment.pl arc2webarc.pl


build: build-stamp
build-stamp: patched-stamp

	# Use customized version of sympa_wizard
	install debian/sympa_wizard.pl src/sympa_wizard.pl

	# Configure
	./configure --prefix=/usr/lib/sympa \
		    --with-confdir=/etc/sympa --with-cgidir=/usr/lib/cgi-bin/sympa \
			--with-etcdir=/etc/sympa \
		    --with-iconsdir=/usr/share/sympa/icons --with-bindir=/usr/lib/sympa/bin \
		    --with-sbindir=/usr/lib/sympa/bin --with-libexecdir=/usr/lib/sympa/bin \
		    --with-libdir=/usr/lib/sympa/bin --with-datadir=/usr/share/sympa \
		    --with-expldir=/var/lib/sympa/expl --with-mandir=/usr/share/man \
                    --with-initdir=/etc/init.d --with-piddir=/var/run/sympa \
			--with-spooldir=/var/spool/sympa \
		    --with-perl=$(PERL) --with-openssl=/usr/bin/openssl \
		    --with-gencat=$(GENCAT) \
                   --with-user=root --with-group=root \
		    --with-sendmail_aliases=/etc/mail/sympa.aliases \
		    --with-virtual_aliases=/etc/mail/sympa.virtual

	# enforce sympa user/groups in sources/scripts
	find . -path './debian' -prune -o -type f | xargs perl -i -pe "s%\'(--USER--|--GROUP--)\'%'sympa'%"
	$(MAKE) sources

	# Docs are a pain to be generated ...
	# I'll use default submitted ones

	# You'll need transfig, latex2html, tetex, ...
	#$(MAKE) doc

	touch build-stamp

clean: reverse-patches
	dh_testdir
	dh_testroot
	debconf-updatepo
	rm -f build-stamp install-stamp

	-$(MAKE) clean
	-$(MAKE) distclean
	#-cd doc; $(MAKE) clean; cd ..

	debconf-updatepo

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) DESTDIR=$(SYMPA) SSLCERTDIR=/var/lib/sympa/x509-user-certs install
	# correct authorization_reject.tt2 symlink
	rm $(SYMPA)/usr/share/sympa/web_tt2/authorization_reject.tt2
	dh_link /usr/share/sympa/mail_tt2/authorization_reject.tt2 /usr/share/sympa/web_tt2/authorization_reject.tt2

	# Install config-files
	install -m 0644 $(CONF)/sympa.conf-smime.in \
		$(CONF)/topics.conf $(CONF)/httpd.conf* \
		$(CONF)/apache-soap \
		$(CONF)/auth.conf \
		$(SYMPA)/etc/sympa

	mkdir -p $(SYMPA)/etc/apache/conf.d
	install -m 0644 $(CONF)/apache $(SYMPA)/etc/apache/conf.d/sympa
	mkdir -p $(SYMPA)/etc/apache2/conf.d
	install -m 0644 $(CONF)/apache $(SYMPA)/etc/apache2/conf.d/sympa

	# Install logrotate configuration
	install -m 0644 $(CONF)/logrotate $(SYMPA)/etc/logrotate.d/sympa

	# Correct permission on file in /usr/lib/sympa
	chmod 0644 $(SYMPA)/usr/lib/sympa/bin/*.pm
#	chmod 0644 $(SYMPA)/usr/lib/sympa/bin/*.pl
	chmod 0644 $(SYMPA)/usr/lib/sympa/bin/Marc/*.pm

	# Manpages installation (from .pod files)
	pod2man --section=1 --lax --center=" " --release=" " \
	$(DOC)/sympa.pod | gzip -v9 > $(SYMPA)/usr/share/man/man1/sympa.1.gz
	pod2man --section=8 --lax --center=" " --release=" " \
	$(DOC)/alias_manager.pod | gzip -v9 > $(SYMPA)/usr/share/man/man8/alias_manager.8.gz
	pod2man --section=1 --lax --center=" " --release=" " \
	$(DOC)/archived.pod | gzip -v9 > $(SYMPA)/usr/share/man/man1/archived.1.gz
	pod2man --section=1 --lax --center=" " --release=" " \
	$(DOC)/bounced.pod | gzip -v9 > $(SYMPA)/usr/share/man/man1/bounced.1.gz

	# Install HTML docs
	cp -r doc/html $(SYMPA)/usr/share/doc/sympa/html 
	rm -f $(SYMPA)/usr/share/doc/sympa/html/sympa.ps
	# Remove the useless sympa.html which is a symlink to index.html
	rm $(SYMPA)/usr/share/doc/sympa/html/sympa.html
	dh_installdocs

	# Install examples
	$(MAKE) installsample DESTDIR=$(SYMPA) \
	DIR=/usr/share/doc/sympa/examples

	install -m 0644 $(CONF)/wwsympa.conf \
		$(SYMPA)/usr/share/doc/sympa/examples/config
	install -m 0644 $(CONF)/topics.conf \
		$(SYMPA)/usr/share/doc/sympa/examples/config/topics.us.conf

	# Remove unnecessary files
	rm -f $(SYMPA)/usr/share/doc/sympa/examples/sample/*.conf \
		$(SYMPA)/usr/lib/cgi-bin/sympa/mime.types

	# Remove directories installed in the wrong place
	rmdir $(SYMPA)/usr/lib/sympa/arc
	rmdir $(SYMPA)/usr/lib/sympa/bounce

	# Install misc scripts
	@( \
		cd src/etc/script; \
		PERL=$(PERL); export PERL; \
		DESTDIR=$(SYMPA); export DESTDIR; \
		INSTALLDIR=/usr/share/doc/sympa/examples/script; \
		export INSTALLDIR; \
		BINDIR=/usr/lib/sympa/bin; export BINDIR; \
		CONFIG=/etc/sympa/sympa.conf; export CONFIG; \
		$(PERL) ../../../subst.pl $(SCRIPTS); \
		cd ../../.. \
	)

	# Install config script examples
	install -m 0644 $(CONF)/sympa.conf \
		src/etc/sample/robot.conf src/etc/sample/employees.ldap \
		$(SYMPA)/usr/share/doc/sympa/examples/config

	# Install database scripts
	install -m 0644 src/etc/script/create_db.* $(SYMPA)/usr/share/doc/sympa/examples/db
	install -m 0755 $(DB)/install-pg-db.pl $(SYMPA)/usr/share/sympa/db/install-pg-db
	install -m 0755 $(DB)/install-mysql-db.pl $(SYMPA)/usr/share/sympa/db/install-mysql-db
	install -m 0755 $(DB)/upgrade-pg-db.pl $(SYMPA)/usr/share/sympa/db/upgrade-pg-db
	install -m 0755 $(DB)/upgrade-mysql-db.pl $(SYMPA)/usr/share/sympa/db/upgrade-mysql-db
	install -m 0755 debian/prepare_db $(SYMPA)/usr/share/sympa/db/prepare_db

	# Copy lintian overrides
	install -m 0644 debian/overrides $(SYMPA)/usr/share/lintian/overrides/sympa

	touch install-stamp

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


# Build architecture-dependent files here.
binary-arch: build install

	dh_testdir
	dh_testroot
	dh_installdebconf
# next line is only necessary for builds on woody with po-debconf added
	po2debconf debian/templates > debian/sympa/DEBIAN/templates
#	dh_installexamples
#	dh_installmenu
	dh_installinit --update-rcd-params="defaults 50"
#	dh_installcron
#	dh_installmanpages
	dh_undocumented task_manager.8 sympa_wizard.8
	dh_installchangelogs ChangeLog
	dh_strip
	dh_compress
	dh_fixperms -X/usr/lib/sympa/bin/queue -X/usr/lib/sympa/bin/bouncequeue
	dh_link usr/lib/sympa/bin/alias_manager.pl usr/bin/alias_manager
	dh_link usr/lib/sympa/bin/task_manager.pl usr/bin/task_manager
	dh_link usr/lib/sympa/bin/sympa.pl usr/bin/sympa
	dh_link usr/lib/sympa/bin/sympa_wizard.pl usr/bin/sympa_wizard
	dh_link usr/lib/sympa/bin/archived.pl usr/bin/archived
	dh_link usr/lib/sympa/bin/bounced.pl usr/bin/bounced
	dh_installdeb
	dh_perl
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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