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
|
#!/usr/bin/make -f
# modifications for use as mgetty's rules file
# Copyright (c) 1998 Philip Hands <phil@hands.com>
# Taken over in 2001-2003 by Wolfgang Sourdeau <was@debian.org>
# major reworks in 2003 by Andreas Barth <aba@not.so.argh.org>
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
PKG_VER = $(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog)
#PKG_UPVER = $(shell perl -e 'print <> =~ /\((.*)-[^-]*\)/' debian/changelog)
PACKAGE=mgetty
VFDIR = frontends/X11/viewfax
DEBIAN_DIR = $(shell pwd)/debian
PVFTOOLS = autopvf pvfsine pvffilter rmdtopvf pvfcut pvftormd basictopvf \
pvfspeed pvfmix pvfecho pvftovoc pvftoau voctopvf \
pvfnoise lintopvf pvffft pvftowav pvftobasic wavtopvf pvfreverse \
pvffile rmdfile pvfamp pvftolin
build:
build:
dh_testdir
touch start-build
-cp $(DEBIAN_DIR)/policy.h $(DEBIAN_DIR)/voice-defs.h .
$(MAKE)
$(MAKE) vgetty
$(MAKE) -C contrib g3toxwd g3tolj
$(MAKE) -C $(VFDIR)
touch build
build-arch: build
build-indep: build
clean:
dh_testdir
dh_testroot
-if [ -f start-build ]; then \
rm -f start-build; \
rm -f build; \
$(MAKE) clean; \
$(MAKE) fullclean; \
rm -f contrib/g3tolj contrib/g3toxwd; \
rm -f fax/faxq-helper fax/faxq-helper.o \
rm -f policy.h voice-defs.h; \
$(MAKE) -C $(VFDIR) clean; \
fi
-rm frontends/X11/viewfax/viewfax
debconf-updatepo
dh_clean
binary-indep: build
dh_testdir -i
dh_testroot -i
dh_prep -i
dh_installdirs -i
# Add here commands to install the files into debian/mgetty
install -m644 callback/README \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/README.callback
install -m644 $(VFDIR)/README \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/README.viewfax
install -m644 voice/doc/* \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice
install -m644 voice/Perl/* \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice/examples/perl
install -m644 voice/scripts/* \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts
cp $(DEBIAN_DIR)/inittab \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/examples/inittab.DEBIAN
# dh_movefiles -i --sourcedir=debian/mgetty
dh_installdocs -i
# FAQ
cp -a contrib frontends doc/*.txt doc/mgetty.texi doc/modems.db \
doc/fhng-codes $(DEBIAN_DIR)/win95.ppp BUGS FTP \
README.1st THANKS TODO \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/
-rm -rf $(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/frontends/X11/viewfax/
# dh_installexamples -i
cp -a samples/* \
$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/examples
chmod +x debian/fixpaths.pl
debian/fixpaths.pl
dh_installmenu -i
# dh_installinit -i
# dh_installcron -i
# dh_installmanpages -i
dh_installinfo -i
dh_installchangelogs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_prep -a
dh_installdirs -a
# Mgetty install
mkdir -p $(DEBIAN_DIR)/mgetty/etc/logrotate.d
cp $(DEBIAN_DIR)/mgetty.logrotate $(DEBIAN_DIR)/mgetty/etc/logrotate.d/mgetty
$(MAKE) install DESTDIR=$(DEBIAN_DIR)/mgetty
$(MAKE) vgetty-install DESTDIR=$(DEBIAN_DIR)/mgetty-voice
cp voice/ChangeLog \
$(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/changelog.voice
# And usr/sbin stuff
mv $(DEBIAN_DIR)/mgetty/usr/bin/faxrunq \
$(DEBIAN_DIR)/mgetty-fax/usr/bin/
mv $(DEBIAN_DIR)/mgetty/usr/sbin/faxrunqd \
$(DEBIAN_DIR)/mgetty-fax/usr/sbin/
mkdir -p $(DEBIAN_DIR)/mgetty-fax/etc/logrotate.d
cp $(DEBIAN_DIR)/mgetty-fax.logrotate $(DEBIAN_DIR)/mgetty-fax/etc/logrotate.d/mgetty-fax
mv $(DEBIAN_DIR)/mgetty/usr/bin/newslock $(DEBIAN_DIR)/mgetty-fax/usr/bin/
# man pages for vm and newslock
pod2man --section=1 --center="mgetty" $(DEBIAN_DIR)/vm.pod $(DEBIAN_DIR)/mgetty-voice/usr/share/man/man1/vm.1
cp $(DEBIAN_DIR)/newslock.1 $(DEBIAN_DIR)/mgetty-fax/usr/share/man/man1/
po2debconf -e utf8 debian/mgetty-fax.templates.master > debian/mgetty-fax.templates
# Separate pvftools from mgetty-voice
mkdir -p $(DEBIAN_DIR)/mgetty-pvftools/usr/bin \
$(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1
mv -f $(DEBIAN_DIR)/mgetty-voice/usr/share/man/man1/pvf.1 \
$(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1/; \
for i in $(PVFTOOLS); do \
mv -f $(DEBIAN_DIR)/mgetty-voice/usr/bin/$$i \
$(DEBIAN_DIR)/mgetty-pvftools/usr/bin/; \
mv -f $(DEBIAN_DIR)/mgetty-voice/usr/share/man/man1/$$i.1 \
$(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1/; \
done
# Contrib stuff
install -s contrib/g3toxwd contrib/g3tolj $(DEBIAN_DIR)/mgetty-fax/usr/bin
install -p -m644 contrib/g3toxwd.1 contrib/g3tolj.1 $(DEBIAN_DIR)/mgetty-fax/usr/share/man/man1/
# viewfax
mkdir -p $(DEBIAN_DIR)/mgetty-viewfax/usr/share/doc/mgetty-viewfax
$(MAKE) -C $(VFDIR) install DESTDIR=../../../debian/mgetty-viewfax
# callback stuff
install -s callback/callback $(DEBIAN_DIR)/mgetty/usr/sbin
# Setup a default configuration
cp *.config $(DEBIAN_DIR)/faxheader $(DEBIAN_DIR)/mgetty/etc/mgetty
cp $(DEBIAN_DIR)/issue.mgetty $(DEBIAN_DIR)/mgetty/etc/issue.mgetty
install samples/new_fax.mime4 \
$(DEBIAN_DIR)/mgetty-fax/etc/mgetty/new_fax
cp voice/voice.conf-dist \
$(DEBIAN_DIR)/mgetty-voice/etc/mgetty/voice.conf
cp fax/etc-magic \
$(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty/fax.magic
cp voice/magic.voice \
$(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/voice.magic
rm $(DEBIAN_DIR)/mgetty/usr/bin/g3topbm
# Make appropriate symlinks.
ln -s mgetty $(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty-fax
ln -s mgetty $(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty-voice
# move fax.1 manpage to mgetty-fax.1
mv $(DEBIAN_DIR)/mgetty/usr/share/man/man1/fax.1 \
$(DEBIAN_DIR)/mgetty/usr/share/man/man1/mgetty-fax.1
# And continue with debian control files
dh_movefiles -a --sourcedir=debian/mgetty
rm -rf $(DEBIAN_DIR)/mgetty/usr/info $(DEBIAN_DIR)/mgetty/usr/lib $(DEBIAN_DIR)/mgetty/var/spool/fax/outgoing
dh_installdocs -pmgetty
dh_installdocs -pmgetty-viewfax
dh_installdocs -pmgetty-voice
dh_installdocs -pmgetty-fax
dh_installdocs -pmgetty-pvftools
-rm -f $(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty/copyright
-rm -f $(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/copyright
# move the config templates to the right place
mv $(DEBIAN_DIR)/mgetty/etc/mgetty/* $(DEBIAN_DIR)/mgetty/usr/share/mgetty/templates/etc/
# faxheader faxrunq.config sendfax.config
mv $(DEBIAN_DIR)/mgetty-fax/etc/mgetty/*config $(DEBIAN_DIR)/mgetty-fax/etc/mgetty/faxheader $(DEBIAN_DIR)/mgetty-fax/usr/share/mgetty/templates/etc/
mv $(DEBIAN_DIR)/mgetty-fax/etc/mgetty/faxspool.rules.sample $(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty/fax/
mv $(DEBIAN_DIR)/mgetty-voice/etc/mgetty/* $(DEBIAN_DIR)/mgetty-voice/usr/share/mgetty/templates/etc/
rm -rf $(DEBIAN_DIR)/mgetty/usr/share/doc/mgetty/voice
# chown $(FAX_USER).$(FAX_GROUP) $(DEBIAN_DIR)/mgetty-fax/usr/lib/mgetty-fax/faxq-helper
# chmod 4755 $(DEBIAN_DIR)/mgetty-fax/usr/lib/mgetty-fax/faxq-helper
# chown $(FAX_USER).root $(DEBIAN_DIR)/mgetty-fax/var/spool/fax/outgoing
# chmod 700 $(DEBIAN_DIR)/mgetty-fax/var/spool/fax/outgoing
# chown $(FAX_USER).root $(DEBIAN_DIR)/mgetty-fax/var/lock/fax
# chmod 755 $(DEBIAN_DIR)/mgetty-fax/var/lock/fax
dh_installexamples -a
dh_installmenu -a
dh_installinit -a
dh_installsystemd -a
dh_installmime -a
dh_installdebconf -a
# dh_installmanpages -a
dh_installchangelogs -pmgetty ChangeLog
dh_installchangelogs -pmgetty-viewfax $(VFDIR)/ChangeLog $(VFDIR)/README
dh_installchangelogs -pmgetty-pvftools voice/ChangeLog
dh_strip -a
dh_compress -a -Xviewfax.tif
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
# dh_makeshlibs -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean
|