File: rules

package info (click to toggle)
xmail 1.22-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,840 kB
  • ctags: 3,857
  • sloc: cpp: 33,585; sh: 625; makefile: 102; perl: 56; sql: 31
file content (164 lines) | stat: -rwxr-xr-x 4,098 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
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
else
        CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
        INSTALL_PROGRAM += -s
endif

# Include dpatch stuff.
include /usr/share/dpatch/dpatch.make

package=xmail
base=debian/$(package)
docdir=${base}-doc/usr/share/doc/$(package)
MAILROOT=/var/lib/xmail

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	

	touch configure-stamp

build: patch build-stamp

build-stamp: configure-stamp 
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE) -f Makefile.lnx
	#/usr/bin/docbook-to-man debian/xmail.sgml > xmail.1

	touch build-stamp

clean: clean1 unpatch

clean1:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	$(MAKE) -f Makefile.lnx clean

#	cat debian/control.in \
#	| sed "s/@kvm@/`type-handling any kfreebsd-gnu,knetbsd-gnu`/g" \
#	> debian/control
	dh_clean

install-doc: build
	# installing docs in $(docdir)
	install -m 0444 courier-configs/* $(docdir)/courier-configs
	install -m 0444 docs/* $(docdir)
	


DESTDIR=$(CURDIR)/debian/xmail
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/xmail.
	cp bin/XMail bin/XMCrypt bin/MkUsers $(DESTDIR)/usr/sbin
	cp bin/CtrlClnt $(DESTDIR)/usr/bin
	cp bin/sendmail $(DESTDIR)/var/lib/xmail/sendmail/sendmail
	#copy sendmail wrapper
	cp -a debian/sendmail.sh $(DESTDIR)/var/lib/xmail/sendmail/xsendmail
	chmod +x $(DESTDIR)/var/lib/xmail/sendmail/xsendmail
	
	#install sample cfgs
	cp MailRoot/*.tab $(DESTDIR)/usr/share/doc/xmail/sample/	
	cp MailRoot/dnsroots $(DESTDIR)/usr/share/doc/xmail/sample/

	touch $(DESTDIR)/etc/xmail/cmd_line
	#Enable Logging
	echo "Md -Pl -Sl -Fl -Cl -Ll" > $(DESTDIR)/etc/xmail/cmd_line
	
	dh_link /etc/xmail/cmd_line /var/lib/xmail/cmd_line
	
	#make links to real dirs
	dh_link /usr/sbin $(MAILROOT)/bin
	dh_link /var/log/xmail $(MAILROOT)/logs

	#cache
	dh_link /var/cache/xmail/tabindex $(MAILROOT)/tabindex
	dh_link /var/cache/xmail/dnscache $(MAILROOT)/dnscache

	#spool
	dh_link  /var/spool/xmail/spool $(MAILROOT)/spool
	dh_link  /var/spool/xmail/domains $(MAILROOT)/domains
	dh_link  /var/spool/xmail/pop3locks $(MAILROOT)/pop3locks
	dh_link  /var/spool/xmail/pop3linklocks $(MAILROOT)/pop3linklocks

	#sendmail replacement
	dh_link /var/lib/xmail/sendmail/xsendmail /usr/sbin/sendmail
	dh_link /var/lib/xmail/sendmail/xsendmail /usr/lib/sendmail

        #add current version information
	echo `dpkg-parsechangelog |grep Version |cut -d ' ' -f 2` > debian/xmail/var/lib/xmail/curr_ver

	#add lintian overrides
	install -o root -g root -m 0644 debian/xmail.lintian debian/xmail/usr/share/lintian/overrides/xmail

# Build architecture-independent files here.
binary-indep: build install install-doc
	dh_testdir
	dh_testroot	
	dh_installdocs -i
	dh_installchangelogs -i
	dh_installdebconf -i
	dh_testdir -i
	dh_testroot -i
	dh_installinit -i
	dh_installman debian/XMail.8 debian/CtrlClnt.1 debian/sendmail.8 debian/MkUsers.8 debian/XMCrypt.8
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i 
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

		
# Build architecture-dependent files here.
binary-arch: build install install-doc
	dh_testdir
	dh_testroot	
	dh_installdocs -a
	dh_installchangelogs -a
	dh_installdebconf -a
	dh_testdir -a
	dh_testroot -a
	dh_installinit -a
	dh_installman debian/XMail.8 debian/CtrlClnt.1 debian/sendmail.8 debian/MkUsers.8 debian/XMCrypt.8
	dh_link -a
	dh_strip -a
	dh_compress -a 
	dh_fixperms -a 
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a



binary: binary-indep binary-arch
.PHONY: build clean1 binary-indep binary-arch binary install install-doc configure patch unpatch

newtemplate:
	debconf-updatepo