File: rules

package info (click to toggle)
smail 3.2.0.115-7.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,192 kB
  • ctags: 4,249
  • sloc: ansic: 48,248; sh: 4,321; makefile: 2,074; perl: 1,147; awk: 884; yacc: 428; sed: 256; xml: 57
file content (215 lines) | stat: -rwxr-xr-x 6,844 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
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
# 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

# This is the debhelper compatability version to use.
export DH_COMPAT=4
export LC_ALL=C

#export PREFIX:=$(shell pwd)/debian/smail
DIR:=$(shell pwd)

configure: configure-stamp
configure-stamp:
	set -e
	dh_testdir
	make debian/arch-test
	# Add here commands to configure the package.
	#ln -s EDITME-dist conf/EDITME
	cat conf/EDITME-dist > conf/EDITME
	debian/arch-test >> conf/EDITME

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	set -e
	dh_testdir

	# Add here commands to compile the package.
	(cd src && $(MAKE) iobpeek.h) 
	$(MAKE) depend

	$(MAKE)

	for f in `find . -name defs.sh`; do \
		echo munging "$$f" ... ; \
		d=`dirname $$f`/debian-defs.sh ; \
		perl -pe 's,(['"'"' ])/(usr|var|etc),$$1$(DIR)/debian/smail/$$2,g' $$f > $$d ; \
		touch -m -r $$f $$d ; \
	done

	(cd contrib/striphdrs&& make striphdrs)

	touch build-stamp

clean:
	set -e
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp 
	
	# Add here commands to clean up after the build process.
	$(MAKE) clobber
	$(MAKE) clean
	rm -f debian/arch-test conf/EDITME	

	for f in `find . -name AUX-support -prune -false -o -name Makefile` ; do \
		perl -i.dep~ -ne 'print || die $$! if 1 .. /^# DO NOT REMOVE THIS LINE/' \
			$$f ; \
	done


	rm -f conf/EDITME contrib/striphdrs/striphdrs mkdep.out
	find . -name 'debian-defs.sh' -o -name '*~' -o -name '*.orig' -o -name '*.rej' -o -name '.Makefile' -o -name '.defs.h' \
	-o -name '#*#' | xargs rm -f -

	chmod +x debian/fix_sudo
	debian/fix_sudo
	
	dh_clean

install: build
	set -e
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/smail.

	$(MAKE) install MAKEFILES=$(DIR)/debian/overrides
	$(MAKE) installman MAKEFILES=$(DIR)/debian/overrides
	cp debian/smailconfig debian/smail/usr/sbin/
	cp debian/smailtest debian/smail/usr/sbin/
	cp contrib/striphdrs/striphdrs debian/smail/usr/sbin/striphdrs
	cp debian/crontab debian/smail/etc/smail/crontab
	cp debian/cronroot debian/smail/etc/cron.daily/smail
#	cp debian/aliases debian/smail/etc/aliases
	mkdir -p debian/smail/usr/lib/smail/
	cp debian/stalelog debian/smail/usr/lib/smail/
	rm debian/smail/etc/smail/COPYING
	#rm debian/smail/usr/share/doc/smail/INSTALL.gz

	find debian/smail -type l -ls | perl -n debian/mungelinks
	#rm debian/smail/usr/sbin/mailq debian/smail/usr/sbin/runq
	mv debian/smail/usr/sbin/smtpd debian/smail/usr/sbin/in.smtpd
	mv debian/smail/usr/share/man/man8/smtpd.8  debian/smail/usr/share/man/man8/in.smtpd.8
	rm debian/smail/usr/lib/smail/savelog
	rm debian/smail/usr/share/man/man8/savelog.8
	chmod 755 debian/smail/usr/lib/smail/logsumm.awk
	rm -rf debian/smail/var/mail

	rm $(DIR)/debian/smail/usr/share/man/man1/uupath.1
	rm $(DIR)/debian/smail/usr/share/man/man8/mailq.8
	rm $(DIR)/debian/smail/usr/share/man/man8/newaliases.8
	rm $(DIR)/debian/smail/usr/share/man/man8/rmail.8
	rm $(DIR)/debian/smail/usr/share/man/man8/rsmtp.8
	rm $(DIR)/debian/smail/usr/share/man/man8/sendmail.8
	rm $(DIR)/debian/smail/usr/share/man/man8/in.smtpd.8
	rm $(DIR)/debian/smail/usr/share/man/man8/runq.8
	
	
	dh_link usr/share/man/man1/pathto.1 \
			usr/share/man/man1/uupath.1 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/mailq.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/newaliases.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/rmail.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/rsmtp.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/sendmail.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/in.smtpd.8 \
		usr/share/man/man8/smail.8 \
			usr/share/man/man8/runq.8

	cp debian/smailconfig.1 $(DIR)/debian/smail/usr/share/man/man1/
	cp debian/smailtest.1 $(DIR)/debian/smail/usr/share/man/man1/
	cp debian/striphdrs.1 $(DIR)/debian/smail/usr/share/man/man1/
	
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	set -e
#	dh_testversion
	dh_testdir
	dh_testroot
#	dh_installdebconf	
	dh_installdocs PROJECTS README ToDo NOTES/ESMTP NOTES/SIMPLE.DOMAIN NOTES/SMART-HOST NOTES/IANA debian/README.hosts.allow debian/README.multihomed debian/New-Config-Features debian/README.xinetd
#	cp guide/admin/[a-z]* debian/smail/usr/share/doc/smail/guide/
#	cp debian/guidemakefile debian/smail/usr/share/doc/smail/guide/Makefile
	cat COPYING >> debian/smail/usr/share/doc/smail/copyright
	dh_installexamples samples/*
#	rm -r debian/smail/usr/share/doc/smail/examples/AUX-support
	rm -r debian/smail/usr/share/doc/smail/examples/arcnet
	rm -rf debian/smail/usr/share/doc/smail/guide
	(cd guide/admin/ && make admin.ps && make admin.txt && cp admin.* \
		$(DIR)/debian/smail/usr/share/doc/smail/ )

	#rm debian/smail/usr/share/doc/smail/guide/install.gz
	dh_installmenu
#	dh_installemacsen
#	dh_installpam
	dh_installinit
#	cp debian/init.d debian/smail/etc/init.d/smail
	dh_installcron
#	dh_installmanpages
	dh_installinfo
	dh_undocumented smailconfig.1 smailtest.1 striphdrs.1
	dh_installchangelogs CHANGES
	rm debian/smail/usr/lib/smail/getopt
	dh_link /usr/bin/getopt usr/lib/smail/getopt
	dh_strip
	dh_compress
	(cd debian/smail/usr/share/man/man5 && \
	 ln -s smailconf.5.gz smail-config.5.gz; \
	 ln -s smaildrct.5.gz smail-directors.5.gz; \
	 ln -s smailmeth.5.gz smail-methods.5.gz; \
	 ln -s smailqual.5.gz smail-qualify.5.gz; \
	 ln -s smailrtrs.5.gz smail-routers.5.gz; \
	 ln -s smailrtry.5.gz smail-retry.5.gz; \
	 ln -s smailtrns.5.gz smail-transports.5.gz )

	dh_fixperms

	chown -R mail.root debian/smail/var/spool/uumaps 
	chown -R mail.root debian/smail/usr/lib/smail
	chown -R mail.root debian/smail/var/lib/smail
	chown -R mail.root debian/smail/var/spool/smail
	
	chmod  -R u+w,g-w debian/smail/var/spool/uumaps 
	chmod  -R u+w,g-w debian/smail/etc/smail
	chmod  -R u+w,g-w debian/smail/usr/lib/smail
	chmod  -R u+w,g-w debian/smail/var/lib/smail
	chmod  -R u+w,g-w debian/smail/var/spool/smail
	
	chmod 755 debian/smail/etc/cron.daily/* debian/smail/etc/init.d/* \
		debian/smail/usr/lib/smail/stalelog debian/smail/usr/sbin/* \
		debian/smail/var/spool debian/smail/var/spool/* debian/smail/var/lib/smail
	chmod 2755 debian/smail/var/log/smail

	find debian/smail/usr/sbin debian/smail/usr/lib \! -type l -perm +111 -type f | \
	find debian/smail -type d | xargs chmod g-s
	chmod u+s debian/smail/usr/sbin/smail
	# You may want to make some executables suid here.
#	dh_suidregister /usr/sbin/smail
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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