File: rules

package info (click to toggle)
hylafax 3:6.0.6-8.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,508 kB
  • sloc: sh: 15,371; ansic: 13,242; makefile: 1,545; cpp: 781; awk: 529
file content (246 lines) | stat: -rwxr-xr-x 8,164 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# The build system doesn't use any flags from the environment! Pass
# CFLAGS/CPPFLAGS via OPTIMIZER, LDFLAGS by patching the build system.

%:
	dh $@

override_dh_auto_configure:
	cp -p /usr/share/misc/config.* .
	yes | /bin/bash ./configure \
		--with-HTML=yes \
		--with-REGEX=no \
		--with-LIBREGEX='' \
		--with-REGEXINC='' \
		--with-UTMP=auto \
		--with-DIR_BIN="/usr/bin" \
		--with-DIR_LIBDATA="/etc/hylafax" \
		--with-DIR_LIB="/usr/lib/hylafax" \
		--with-DIR_LIBEXEC="/usr/sbin" \
		--with-DIR_MAN="/usr/share/man" \
		--with-DIR_SBIN="/usr/sbin" \
		--with-DIR_LOCKS="/var/lock" \
		--with-PATH_AFM="/usr/share/fonts/type1/gsfonts" \
		--with-FONTMAP="/usr/share/ghostscript/9.19/lib" \
		--with-MANSCHEME="bsd-source-gzip-strip" \
		--with-DIR_HTML="/usr/share/doc/hylafax" \
		--with-DIR_CGI="/usr/lib/cgi-bin" \
		--with-HTMLPATH="/doc/hylafax" \
		--with-SYSGID="root" \
		--with-SYSUID="root" \
		--with-PATH_GETTY="/etc/hylafax/getty-link" \
		--with-PATH_VGETTY="/etc/hylafax/vgetty-link" \
		--with-PATH_EGETTY="/etc/hylafax/egetty-link" \
		--with-CONFIG_MAXGID="65534" \
		--with-CMP="/usr/bin/cmp" \
		--with-COL="/usr/bin/col" \
		--with-MKFIFO="/usr/bin/mkfifo" \
		--with-SORT="/usr/bin/sort" \
		--with-OPTIMIZER="$(CFLAGS) $(CPPFLAGS)" \
		--with-MANDIR="/usr/share/man" \
		--with-PATH_DPSRIP="" \
		--with-PATH_IMPRIP="/usr/bin/psrip" \
		--with-AWK="/usr/bin/awk"
#		--with-INSTALL=/usr/bin/install \
 
override_dh_clean:
	[ ! -f Makefile ] || make distclean
	[ ! -d man/cman.apps ] \
	    || rmdir man/cman.apps man/cman.files man/sman.apps man/sman.files
	rm -f port/Makefile port/install.sh port/mkdepend
	rm -f config.guess config.sub
	rm -f dummy xgnu.c dummy.c xmakeinc t dummy.o dummy.C confMakefile config.log a.out
	dh_clean
 
PWD		:= $(shell pwd)
p_client	= hylafax-client
p_client_dbg	= hylafax-client-dbg
p_server	= hylafax-server
p_server_dbg	= hylafax-server-dbg

d_client	= debian/$(p_client)
d_client_dbg	= debian/$(p_client_dbg)
d_server	= debian/$(p_server)
d_server_dbg	= debian/$(p_server_dbg)

d_dbg		= usr/lib/debug/

override_dh_auto_install: install-client install-server

install-server:
	cp -p debian/hosts.hfaxd hfaxd/hfaxd.conf util/cover.templ \
		etc/dialrules etc/dialrules.sf-ba etc/dialrules.europe \
		etc/lutRS18.pcf \
	    $(d_server)/etc/hylafax/.
	cp -p debian/hylafax.config $(d_server)/etc/hylafax/config
	cp -pR etc/templates $(d_server)/etc/hylafax/
	rm -r $(d_server)/etc/hylafax/templates/html-sample1

	cp -p util/faxmsg util/faxconfig util/faxmodem util/faxstate util/faxwatch \
		util/faxinfo util/tiffcheck util/dialtest util/faxadduser util/faxdeluser \
		faxd/faxq faxd/faxqclean faxd/faxgetty faxd/faxsend \
		faxd/pagesend faxd/tsitest faxd/tagtest faxd/cqtest \
		faxd/choptest \
		hfaxd/hfaxd \
		etc/ondelay \
		etc/lockname \
	    $(d_server)/usr/sbin/.
	for i in \
	  util/xferfaxstats.sh util/recvstats.sh util/faxcron.sh \
	  etc/faxaddmodem.sh etc/faxsetup.sh etc/probemodem.sh; \
	do \
	  b=`basename $$i .sh`; \
	  install -p $$i $(d_server)/usr/sbin/$$b; \
	done
	for i in \
	  ps2fax.gs.sh pdf2fax.gs.sh pcl2fax.sh tiff2fax.sh tiff2pdf.sh \
	  archive.sh notify.sh notify-4.1.sh faxrcvd.sh pollrcvd.sh mkcover.sh wedged.sh \
	  common-functions.sh dictionary.sh qp-encode.awk b64-encode.awk; \
	do \
	  b=`basename $$i .sh`; \
	  install -p util/$$i $(d_server)/var/spool/hylafax/bin/$$b; \
	done
	install -p util/notify.awk $(d_server)/var/spool/hylafax/bin/
	chmod a-x $(d_server)/var/spool/hylafax/bin/dictionary
	chmod a-x $(d_server)/var/spool/hylafax/bin/common-functions

	cp -p config/* $(d_server)/var/spool/hylafax/config/
	-rm $(d_server)/var/spool/hylafax/config/Makefile
	-rm $(d_server)/var/spool/hylafax/config/Makefile.in

	ln -sf faxmsg $(d_server)/usr/sbin/faxanswer
	ln -sf faxmsg $(d_server)/usr/sbin/faxabort
	ln -sf faxmsg $(d_server)/usr/sbin/faxquit
	ln -sf faxmsg $(d_server)/usr/sbin/faxlock

	# override lintian warnings
	cp -p debian/lintian.override.hylafax-server \
		$(d_server)/usr/share/lintian/overrides/$(p_server)

	cp debian/hylafax-server.hylafax.default-maintainer $(d_server)/usr/share/hylafax/hylafax.default-maintainer

	install --mode=a+rx -p debian/copy_configuration_from_spool $(d_server)/usr/lib/hylafax/bin/

override_dh_installman:
	: # install server man pages
	for i in man/sman.files/*.4f; do \
	  b=`basename $$i .4f`; \
	  cp -p $$i $(d_server)/usr/share/man/man5/$$b.5; \
	done
	for i in man/sman.apps/*.1m; do \
	  b=`basename $$i .1m`; \
	  cp -p $$i $(d_server)/usr/share/man/man8/$$b.8; \
	done
	for i in debian/man/*.8; do \
	  b=`basename $$i .8`; \
	  cp -p $$i $(d_server)/usr/share/man/man8/$$b.8; \
	done

	: # install client man pages
	for i in man/cman.files/*.4f; do \
	  b=`basename $$i .4f`; \
	  cp -p $$i $(d_client)/usr/share/man/man5/$$b.5; \
	done
	for i in man/cman.apps/*.1; do \
	  b=`basename $$i .1`; \
	  [ $$b != sgi2fax ] && cp -p $$i $(d_client)/usr/share/man/man1/$$b.1; \
	done

	cp -p util/typetest $(d_client)/usr/bin/

override_dh_installexamples:
	dh_installexamples -p$(p_server) debian/examples/*

override_dh_installinit:
	dh_installinit -p$(p_server) --name=hylafax --no-start

override_dh_installcron:
	dh_installcron -p$(p_server) --name=hylafax

override_dh_installdirs:
	dh_installdirs -p$(p_server) \
		etc/hylafax \
		usr/sbin \
		var/log/hylafax \
		usr/lib/hylafax/bin \
		var/spool/hylafax/archive var/spool/hylafax/client var/spool/hylafax/config \
		var/spool/hylafax/dev var/spool/hylafax/info var/spool/hylafax/log var/spool/hylafax/bin \
		var/spool/hylafax/etc var/spool/hylafax/recvq var/spool/hylafax/status var/spool/hylafax/sendq \
		var/spool/hylafax/doneq var/spool/hylafax/docq var/spool/hylafax/tmp var/spool/hylafax/pollq \
		usr/share/man/man5 usr/share/man/man8 \
		usr/share/lintian/overrides \
		usr/share/hylafax
	dh_installdirs -p$(p_client) \
		etc/hylafax \
		usr/bin \
		usr/lib \
		usr/share/man/man1 usr/share/man/man5 \
		usr/share/hylafax \
		usr/share/doc/hylafax-client/faxmail \
		usr/share/lintian/overrides

install-client:
	cp -p debian/hyla.conf faxcover/faxcover.ps faxmail/faxmail.ps \
		libhylafax/typerules \
	    $(d_client)/etc/hylafax/.
	touch $(d_client)/etc/hylafax/faxcover.ps
	cp -p libhylafax/pagesizes $(d_client)/usr/share/hylafax/.
	install -p util/textfmt faxalter/faxalter faxcover/faxcover \
		faxmail/faxmail faxrm/faxrm faxstat/faxstat \
		sendfax/sendfax sendpage/sendpage \
	$(d_client)/usr/bin/.

	install -p faxmail/mailfax.sh-postfix faxmail/mailfax.sh-qmail \
		faxmail/mailfax.sh-sendmail faxmail/mailfax.sh-smail \
		faxmail/README \
	$(d_client)/usr/share/doc/hylafax-client/faxmail/

	for i in faxcover/edit-faxcover.sh; \
	do \
	  b=`basename $$i .sh`; \
	  install -p $$i $(d_client)/usr/bin/$$b; \
	done

	# override lintian warnings
	cp -p debian/lintian.override.hylafax-client \
		$(d_client)/usr/share/lintian/overrides/$(p_client)

	# needed by sendfax ...
	mkdir -p $(d_client)/usr/sbin
	ln -sf ../bin/textfmt $(d_client)/usr/sbin/textfmt

override_dh_installchangelogs:
	dh_installchangelogs -a doc/RELEASENOTES-6.0.txt

override_dh_fixperms:
	dh_fixperms
ifneq (,$(findstring hylafax-server, $(shell dh_listpackages)))
	chgrp uucp $(d_server)/etc/hylafax
	for i in client config dev info log recvq status archive docq doneq pollq sendq tmp .; \
	do chown uucp:uucp $(d_server)/var/spool/hylafax/$$i; done
	for i in archive docq doneq pollq sendq; \
	do chmod 755 $(d_server)/var/spool/hylafax/$$i; done
	chmod 775 $(d_server)/var/spool/hylafax
	chmod 1777 $(d_server)/var/spool/hylafax/tmp
	chmod 755  $(d_server)/var/spool/hylafax/dev
	chown uucp $(d_server)/etc/hylafax/hosts.hfaxd
	chmod 600  $(d_server)/etc/hylafax/hosts.hfaxd
endif

override_dh_makeshlibs:
	dh_makeshlibs -p$(p_client)

#override_dh_shlibdeps:
#	dh_shlibdeps -L libfaxutil -phylafax-server

override_dh_installdocs:
	dh_installdocs -a -A \
		debian/README.mgetty debian/README.Debian \
		TODO CONTRIBUTORS

override_dh_strip:
	dh_strip -p$(p_client) --dbg-package=$(p_client_dbg)
	dh_strip -p$(p_server) --dbg-package=$(p_server_dbg)