#!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 package:=mailagent SRCTOP:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) INSTALL = install ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif install_file = $(INSTALL) -p -o root -g root -m 644 install_program = $(INSTALL) -p -o root -g root -m 755 install_script = $(INSTALL) -p -o root -g root -m 755 make_directory = $(INSTALL) -p -d -o root -g root -m 755 email := srivasta@debian.org TMPTOP:=debian/tmp DOCDIR=debian/$(package)/usr/share/doc/$(package) DEBDOCDIR=$(TMPTOP)/usr/share/doc/$(package) DEBLIBDIR=$(TMPTOP)/usr/lib/$(package) PKG_DIR = $(TMPTOP)/usr/share/$(package) MAN1DIR = $(TMPTOP)/usr/share/man/man1 DPKG_ARCH := dpkg-architecture export DEB_HOST_MULTIARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH) %: dh $@ override_dh_auto_configure: /bin/cp -rpf debian/Config .config && \ /bin/cp -pf debian/config.over config.over && \ touch .config/nomail && \ eval "$(dpkg-buildflags --export=sh)" && \ sh ./Configure \ -de \ -D cat=/bin/cat -D zcat=/bin/zcat \ -D prefix=$(PREFIX) \ -D orgname=/etc/news/organization \ -D myhostname=localhost \ -D mydomain=localdomain \ -D defeditor=/usr/ae \ -D usenm=no \ -D privlib=/usr/share/$(package) \ -D utmp="/var/run/utmp" \ -D optimize="$(CFLAGS)" \ -D ldflags="$(LDFLAGS)" \ -D cf_email='$(email)' \ -D d_berknames='define' override_dh_auto_build: dh_auto_build pod2man debian/getspam > debian/getspam.1 perl -wc debian/mailagent.postinst bash -n debian/mailagent.config bash -n debian/mailagent.postrm bash -n debian/mailagent.prerm override_dh_installdocs: dh_installdocs $(install_file) agent/README $(DOCDIR)/README.agent $(install_file) agent/filter/README $(DOCDIR)/README.filter $(install_file) agent/files/README $(DOCDIR)/README.shell $(install_file) agent/files/help/README $(DOCDIR)/README.server find $(DOCDIR)/help -name \*.SH -exec rm {} \; find $(DOCDIR)/help -name \*Makefile -exec rm {} \; override_dh_install: test -d $(MAN1DIR) || $(make_directory) $(MAN1DIR) $(make_directory) $(PKG_DIR) $(make_directory) $(DEBLIBDIR) $(MAKE) install $(MAKE) install.man test ! -f $(DEBDOCDIR)/filter || \ $(install_program) $(DEBDOCDIR)/filter $(DEBLIBDIR)/filter test ! -f $(DEBDOCDIR)/filter || rm $(DEBDOCDIR)/filter for i in chkagent.sh filter.sh setup.cf mailagent.cf commands; do \ test ! -f $(DEBDOCDIR)/$$i || mv $(DEBDOCDIR)/$$i $(PKG_DIR); \ done test ! -f $(PKG_DIR)/chkagent.sh || chmod ugo+x $(PKG_DIR)/chkagent.sh test ! -f $(PKG_DIR)/filter.sh || chmod ugo+x $(PKG_DIR)/filter.sh dh_install dh_link usr/share/mailagent/filter.sh usr/lib/mailagent/filter.sh override_dh_clean: dh_clean test ! -d .config || rm -rf .config #Local variables: #mode: makefile #End: