File: rules

package info (click to toggle)
mailagent 1%3A3.1-106-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 3,184 kB
  • sloc: perl: 15,877; sh: 8,600; ansic: 2,756; makefile: 75
file content (91 lines) | stat: -rwxr-xr-x 3,457 bytes parent folder | download
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
#!/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: