#!/usr/bin/make -f # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # # modifications for use as mgetty's rules file # Copyright (c) 1998 Philip Hands # Taken over in 2001-2003 by Wolfgang Sourdeau # major reworks in 2003 by Andreas Barth # 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 cd contrib; $(MAKE) g3toxwd g3tolj cd $(VFDIR); $(MAKE) 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; \ cd $(VFDIR);$(MAKE) 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 cd $(VFDIR);$(MAKE) 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_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