| 1 |
#!/usr/bin/make -f |
| 2 |
# Uncomment this to turn on verbose mode. |
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
# The build system doesn't use any flags from the environment! Pass |
| 6 |
# CFLAGS/CPPFLAGS via OPTIMIZER, LDFLAGS by patching the build system. |
| 7 |
|
| 8 |
# temporary fix for bug #1067362 |
| 9 |
CFLAGS:=$(filter-out -Werror=implicit-function-declaration,$(CFLAGS)) |
| 10 |
|
| 11 |
%: |
| 12 |
dh $@ |
| 13 |
|
| 14 |
override_dh_auto_configure: |
| 15 |
cp -p /usr/share/misc/config.* . |
| 16 |
yes | /bin/bash ./configure \ |
| 17 |
--with-HTML=yes \ |
| 18 |
--with-REGEX=no \ |
| 19 |
--with-LIBREGEX='' \ |
| 20 |
--with-REGEXINC='' \ |
| 21 |
--with-UTMP=auto \ |
| 22 |
--with-DIR_BIN="/usr/bin" \ |
| 23 |
--with-DIR_LIBDATA="/etc/hylafax" \ |
| 24 |
--with-DIR_LIB="/usr/lib/hylafax" \ |
| 25 |
--with-DIR_LIBEXEC="/usr/sbin" \ |
| 26 |
--with-DIR_MAN="/usr/share/man" \ |
| 27 |
--with-DIR_SBIN="/usr/sbin" \ |
| 28 |
--with-DIR_LOCKS="/var/lock" \ |
| 29 |
--with-PATH_AFM="/usr/share/fonts/type1/gsfonts" \ |
| 30 |
--with-FONTMAP="/usr/share/ghostscript/9.19/lib" \ |
| 31 |
--with-MANSCHEME="bsd-source-gzip-strip" \ |
| 32 |
--with-DIR_HTML="/usr/share/doc/hylafax" \ |
| 33 |
--with-DIR_CGI="/usr/lib/cgi-bin" \ |
| 34 |
--with-HTMLPATH="/doc/hylafax" \ |
| 35 |
--with-SYSGID="root" \ |
| 36 |
--with-SYSUID="root" \ |
| 37 |
--with-PATH_GETTY="/etc/hylafax/getty-link" \ |
| 38 |
--with-PATH_VGETTY="/etc/hylafax/vgetty-link" \ |
| 39 |
--with-PATH_EGETTY="/etc/hylafax/egetty-link" \ |
| 40 |
--with-CONFIG_MAXGID="65534" \ |
| 41 |
--with-CMP="/usr/bin/cmp" \ |
| 42 |
--with-COL="/usr/bin/col" \ |
| 43 |
--with-MKFIFO="/usr/bin/mkfifo" \ |
| 44 |
--with-SORT="/usr/bin/sort" \ |
| 45 |
--with-OPTIMIZER="$(CFLAGS) $(CPPFLAGS)" \ |
| 46 |
--with-MANDIR="/usr/share/man" \ |
| 47 |
--with-PATH_DPSRIP="" \ |
| 48 |
--with-PATH_IMPRIP="/usr/bin/psrip" \ |
| 49 |
--with-AWK="/usr/bin/awk" |
| 50 |
# --with-INSTALL=/usr/bin/install \ |
| 51 |
|
| 52 |
override_dh_clean: |
| 53 |
[ ! -f Makefile ] || make distclean |
| 54 |
[ ! -d man/cman.apps ] \ |
| 55 |
|| rmdir man/cman.apps man/cman.files man/sman.apps man/sman.files |
| 56 |
rm -f port/Makefile port/install.sh port/mkdepend |
| 57 |
rm -f config.guess config.sub |
| 58 |
rm -f dummy xgnu.c dummy.c xmakeinc t dummy.o dummy.C confMakefile config.log a.out |
| 59 |
dh_clean |
| 60 |
|
| 61 |
PWD := $(shell pwd) |
| 62 |
p_client = hylafax-client |
| 63 |
p_client_dbg = hylafax-client-dbg |
| 64 |
p_server = hylafax-server |
| 65 |
p_server_dbg = hylafax-server-dbg |
| 66 |
|
| 67 |
d_client = debian/$(p_client) |
| 68 |
d_client_dbg = debian/$(p_client_dbg) |
| 69 |
d_server = debian/$(p_server) |
| 70 |
d_server_dbg = debian/$(p_server_dbg) |
| 71 |
|
| 72 |
d_dbg = usr/lib/debug/ |
| 73 |
|
| 74 |
override_dh_auto_install: install-client install-server |
| 75 |
|
| 76 |
install-server: |
| 77 |
cp -p debian/hosts.hfaxd hfaxd/hfaxd.conf util/cover.templ \ |
| 78 |
etc/dialrules etc/dialrules.sf-ba etc/dialrules.europe \ |
| 79 |
etc/lutRS18.pcf debian/hfaxd.systemd.conf \ |
| 80 |
$(d_server)/etc/hylafax/. |
| 81 |
cp -p debian/hylafax.config $(d_server)/etc/hylafax/config |
| 82 |
cp -pR etc/templates $(d_server)/etc/hylafax/ |
| 83 |
rm -r $(d_server)/etc/hylafax/templates/html-sample1 |
| 84 |
|
| 85 |
install --mode=a+rx -p debian/hylafax_wrapper $(d_server)/usr/sbin/hylafax_wrapper |
| 86 |
|
| 87 |
for i in faxd/faxq hfaxd/hfaxd faxd/faxgetty; \ |
| 88 |
do \ |
| 89 |
cp -p $$i $(d_server)/usr/sbin/; \ |
| 90 |
done |
| 91 |
for i in util/faxmsg util/faxconfig util/faxmodem util/faxstate util/faxwatch \ |
| 92 |
util/faxinfo util/tiffcheck util/dialtest util/faxadduser util/faxdeluser \ |
| 93 |
faxd/faxqclean faxd/faxsend \ |
| 94 |
faxd/pagesend faxd/tsitest faxd/tagtest faxd/cqtest \ |
| 95 |
faxd/choptest \ |
| 96 |
etc/ondelay \ |
| 97 |
etc/lockname; \ |
| 98 |
do \ |
| 99 |
b=`basename $$i`; \ |
| 100 |
cp -p $$i $(d_server)/usr/lib/hylafax/bin/$$b; \ |
| 101 |
ln --symbolic --relative $(d_server)/usr/sbin/hylafax_wrapper $(d_server)/usr/sbin/$$b; \ |
| 102 |
done |
| 103 |
for i in \ |
| 104 |
util/xferfaxstats.sh util/recvstats.sh util/faxcron.sh \ |
| 105 |
etc/faxaddmodem.sh etc/faxsetup.sh etc/probemodem.sh; \ |
| 106 |
do \ |
| 107 |
b=`basename $$i .sh`; \ |
| 108 |
cp -p $$i $(d_server)/usr/lib/hylafax/bin/$$b; \ |
| 109 |
chmod a+rx $(d_server)/usr/lib/hylafax/bin/$$b; \ |
| 110 |
ln --symbolic --relative $(d_server)/usr/sbin/hylafax_wrapper $(d_server)/usr/sbin/$$b; \ |
| 111 |
done |
| 112 |
for i in \ |
| 113 |
ps2fax.gs.sh pdf2fax.gs.sh pcl2fax.sh tiff2fax.sh tiff2pdf.sh \ |
| 114 |
archive.sh notify.sh notify-4.1.sh faxrcvd.sh pollrcvd.sh mkcover.sh wedged.sh \ |
| 115 |
common-functions.sh dictionary.sh qp-encode.awk b64-encode.awk; \ |
| 116 |
do \ |
| 117 |
b=`basename $$i .sh`; \ |
| 118 |
install -p util/$$i $(d_server)/var/spool/hylafax/bin/$$b; \ |
| 119 |
done |
| 120 |
install -p util/notify.awk $(d_server)/var/spool/hylafax/bin/ |
| 121 |
chmod a-x $(d_server)/var/spool/hylafax/bin/dictionary |
| 122 |
chmod a-x $(d_server)/var/spool/hylafax/bin/common-functions |
| 123 |
|
| 124 |
cp -p config/* $(d_server)/var/spool/hylafax/config/ |
| 125 |
-rm $(d_server)/var/spool/hylafax/config/Makefile |
| 126 |
-rm $(d_server)/var/spool/hylafax/config/Makefile.in |
| 127 |
|
| 128 |
ln -sf faxmsg $(d_server)/usr/sbin/faxanswer |
| 129 |
ln -sf faxmsg $(d_server)/usr/sbin/faxabort |
| 130 |
ln -sf faxmsg $(d_server)/usr/sbin/faxquit |
| 131 |
ln -sf faxmsg $(d_server)/usr/sbin/faxlock |
| 132 |
|
| 133 |
# override lintian warnings |
| 134 |
cp -p debian/lintian.override.hylafax-server \ |
| 135 |
$(d_server)/usr/share/lintian/overrides/$(p_server) |
| 136 |
|
| 137 |
cp debian/hylafax-server.hylafax.default-maintainer $(d_server)/usr/share/hylafax/hylafax.default-maintainer |
| 138 |
|
| 139 |
|
| 140 |
override_dh_installman: |
| 141 |
: # install server man pages |
| 142 |
for i in man/sman.files/*.4f; do \ |
| 143 |
b=`basename $$i .4f`; \ |
| 144 |
cp -p $$i $(d_server)/usr/share/man/man5/$$b.5; \ |
| 145 |
done |
| 146 |
for i in man/sman.apps/*.1m; do \ |
| 147 |
b=`basename $$i .1m`; \ |
| 148 |
cp -p $$i $(d_server)/usr/share/man/man8/$$b.8; \ |
| 149 |
done |
| 150 |
for i in debian/man/*.8; do \ |
| 151 |
b=`basename $$i .8`; \ |
| 152 |
cp -p $$i $(d_server)/usr/share/man/man8/$$b.8; \ |
| 153 |
done |
| 154 |
|
| 155 |
: # install client man pages |
| 156 |
for i in man/cman.files/*.4f; do \ |
| 157 |
b=`basename $$i .4f`; \ |
| 158 |
cp -p $$i $(d_client)/usr/share/man/man5/$$b.5; \ |
| 159 |
done |
| 160 |
for i in man/cman.apps/*.1; do \ |
| 161 |
b=`basename $$i .1`; \ |
| 162 |
[ $$b != sgi2fax ] && cp -p $$i $(d_client)/usr/share/man/man1/$$b.1; \ |
| 163 |
done |
| 164 |
|
| 165 |
cp -p util/typetest $(d_client)/usr/bin/ |
| 166 |
|
| 167 |
override_dh_installexamples: |
| 168 |
dh_installexamples -p$(p_server) debian/examples/* |
| 169 |
|
| 170 |
override_dh_installinit: |
| 171 |
dh_installinit --no-start --no-enable -p$(p_server) --name=hylafax |
| 172 |
dh_installsystemd --no-start --no-enable -p$(p_server) --name=faxgetty@ |
| 173 |
dh_installsystemd --no-start --no-enable -p$(p_server) --name=hfaxd |
| 174 |
dh_installsystemd --no-start --no-enable -p$(p_server) --name=faxq |
| 175 |
dh_installsystemd --no-start --no-enable -p$(p_server) --name=hylafax |
| 176 |
|
| 177 |
override_dh_installcron: |
| 178 |
dh_installcron -p$(p_server) --name=hylafax |
| 179 |
|
| 180 |
override_dh_installdirs: |
| 181 |
dh_installdirs -p$(p_server) \ |
| 182 |
etc/hylafax \ |
| 183 |
usr/sbin \ |
| 184 |
var/log/hylafax \ |
| 185 |
usr/lib/hylafax/bin \ |
| 186 |
var/spool/hylafax/archive var/spool/hylafax/client var/spool/hylafax/config \ |
| 187 |
var/spool/hylafax/dev var/spool/hylafax/info var/spool/hylafax/log var/spool/hylafax/bin \ |
| 188 |
var/spool/hylafax/etc var/spool/hylafax/recvq var/spool/hylafax/status var/spool/hylafax/sendq \ |
| 189 |
var/spool/hylafax/doneq var/spool/hylafax/docq var/spool/hylafax/tmp var/spool/hylafax/pollq \ |
| 190 |
usr/share/man/man5 usr/share/man/man8 \ |
| 191 |
usr/share/lintian/overrides \ |
| 192 |
usr/share/hylafax |
| 193 |
dh_installdirs -p$(p_client) \ |
| 194 |
etc/hylafax \ |
| 195 |
usr/bin \ |
| 196 |
usr/lib \ |
| 197 |
usr/share/man/man1 usr/share/man/man5 \ |
| 198 |
usr/share/hylafax \ |
| 199 |
usr/share/doc/hylafax-client/faxmail \ |
| 200 |
usr/share/lintian/overrides |
| 201 |
|
| 202 |
install-client: |
| 203 |
cp -p debian/hyla.conf faxcover/faxcover.ps faxmail/faxmail.ps \ |
| 204 |
libhylafax/typerules \ |
| 205 |
$(d_client)/etc/hylafax/. |
| 206 |
touch $(d_client)/etc/hylafax/faxcover.ps |
| 207 |
cp -p libhylafax/pagesizes $(d_client)/usr/share/hylafax/. |
| 208 |
install -p util/textfmt faxalter/faxalter faxcover/faxcover \ |
| 209 |
faxmail/faxmail faxrm/faxrm faxstat/faxstat \ |
| 210 |
sendfax/sendfax sendpage/sendpage \ |
| 211 |
$(d_client)/usr/bin/. |
| 212 |
|
| 213 |
install -p faxmail/mailfax.sh-postfix faxmail/mailfax.sh-qmail \ |
| 214 |
faxmail/mailfax.sh-sendmail faxmail/mailfax.sh-smail \ |
| 215 |
faxmail/README \ |
| 216 |
$(d_client)/usr/share/doc/hylafax-client/faxmail/ |
| 217 |
|
| 218 |
for i in faxcover/edit-faxcover.sh; \ |
| 219 |
do \ |
| 220 |
b=`basename $$i .sh`; \ |
| 221 |
install -p $$i $(d_client)/usr/bin/$$b; \ |
| 222 |
done |
| 223 |
|
| 224 |
# override lintian warnings |
| 225 |
cp -p debian/lintian.override.hylafax-client \ |
| 226 |
$(d_client)/usr/share/lintian/overrides/$(p_client) |
| 227 |
|
| 228 |
override_dh_installchangelogs: |
| 229 |
dh_installchangelogs -a doc/RELEASENOTES-6.0.txt |
| 230 |
|
| 231 |
override_dh_fixperms: |
| 232 |
dh_fixperms |
| 233 |
ifneq (,$(findstring hylafax-server, $(shell dh_listpackages))) |
| 234 |
chgrp uucp $(d_server)/etc/hylafax |
| 235 |
for i in client config dev info log recvq status archive docq doneq pollq sendq tmp .; \ |
| 236 |
do chown uucp:uucp $(d_server)/var/spool/hylafax/$$i; done |
| 237 |
for i in archive docq doneq pollq sendq; \ |
| 238 |
do chmod 755 $(d_server)/var/spool/hylafax/$$i; done |
| 239 |
chmod 775 $(d_server)/var/spool/hylafax |
| 240 |
chmod 1777 $(d_server)/var/spool/hylafax/tmp |
| 241 |
chmod 755 $(d_server)/var/spool/hylafax/dev |
| 242 |
chown uucp $(d_server)/etc/hylafax/hosts.hfaxd |
| 243 |
chmod 600 $(d_server)/etc/hylafax/hosts.hfaxd |
| 244 |
endif |
| 245 |
|
| 246 |
override_dh_makeshlibs: |
| 247 |
dh_makeshlibs -p$(p_client) |
| 248 |
|
| 249 |
#override_dh_shlibdeps: |
| 250 |
# dh_shlibdeps -L libfaxutil -phylafax-server |
| 251 |
|
| 252 |
override_dh_installdocs: |
| 253 |
dh_installdocs -a -A \ |
| 254 |
debian/README.mgetty debian/README.Debian \ |
| 255 |
TODO CONTRIBUTORS |
| 256 |
|
| 257 |
override_dh_strip: |
| 258 |
dh_strip -p$(p_client) --dbg-package=$(p_client_dbg) |
| 259 |
dh_strip -p$(p_server) --dbg-package=$(p_server_dbg) |
| 260 |
|
| 261 |
override_dh_installlogrotate: |
| 262 |
dh_installlogrotate -p$(p_server) --name xferfaxlog |