File: rules

package info (click to toggle)
fetchmail 6.2.5-12sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,048 kB
  • ctags: 2,362
  • sloc: ansic: 19,329; sh: 3,735; python: 1,797; perl: 564; makefile: 501; yacc: 461; lex: 262; awk: 124; sed: 93; lisp: 84
file content (188 lines) | stat: -rwxr-xr-x 5,626 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#!/usr/bin/make -f
#
# $Id: rules 146 2004-05-31 06:05:59Z bob $
#
# Originally by Henrique M. Holschuh <hmh@debian.org>, and based on
# previous work by Paul Haggard <phaggart@debian.org>, and in a
# debmake-created rules file.
#
# Special package build-time options:
#   POP2, RPA, NTLM, SDPS, OPIE, KRB4, KRB5, GSSAPI
#   NOPOP3, NOIMAP, NOETRN, NOODMR, IPV6, IPV6SEC
#
# To use them, add the ones you need to the environment variable 
# DEB_FETCHMAIL_BUILD_OPTIONS before building the package.
#
# e.g.
# export DEB_FETCHMAIL_BUILD_OPTIONS="KRB4,NOIMAP,NOETRN,NOODMR" 
# dpkg-buildpackage -rfakeroot -uc -us
#
# If DEB_FETCHMAIL_BUILD_OPTIONS is undefined, SSl, NTLM and SDPS will
# be enabled by default.
#
# The targets KRB4, KRB5, GSSAPI and OPIE require the proper libraries 
# to be installed in the system.
#
# IPV6 and IPV6SEC support is untested, and breaks the 'interface'
# keyword (which is why they will not be enabled by default).

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# for autoconf 2.52 and newer only
CONFFLAGS =
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
  CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# Defaults for official debian package
ifeq (,$(DEB_FETCHMAIL_BUILD_OPTIONS))
	DEB_FETCHMAIL_BUILD_OPTIONS="SSL,NTLM,SDPS"
endif

# Process build-time options
FETCHCONFOPT =
ifneq (,$(findstring SSL,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --with-ssl=/usr
endif
ifneq (,$(findstring POP2,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-POP2
endif
ifneq (,$(findstring RPA,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-RPA
endif
ifneq (,$(findstring NTLM,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-NTLM
endif
ifneq (,$(findstring SDPS,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-SDPS
endif
ifneq (,$(findstring OPIE,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-opie
endif
ifneq (,$(findstring KRB4,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --with-kerberos=/usr
endif
ifneq (,$(findstring KRB5,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --with-kerberos5=/usr
endif
ifneq (,$(findstring GSSAPI,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --with-gssapi=/usr
endif
ifneq (,$(findstring NOPOP3,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --disable-POP3
endif
ifneq (,$(findstring NOIMAP,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --disable-IMAP
endif
ifneq (,$(findstring NOETRN,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --disable-ETRN
endif
ifneq (,$(findstring NOODMR,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --disable-ODMR
endif
ifneq (,$(findstring IPV6,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-inet6
endif
ifneq (,$(findstring IPV6SEC,$(DEB_FETCHMAIL_BUILD_OPTIONS)))
	FETCHCONFOPT += --enable-inet6 --enable-netsec
endif

# Turn off optimization if the user requests it.
CFLAGS = -Wall -pipe -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
export CFLAGS

clean:
	dh_testdir
	dh_testroot
	-rm -f build-stamp po/*.gmo NEWS.truncated
	-$(MAKE) -i distclean
	dh_clean -X.orig -X.rej

config.status: configure
	dh_testdir
	./configure $(CONFFLAGS) --prefix=/usr --enable-nls \
		    --disable-fallback $(FETCHCONFOPT)

build: build-stamp
build-stamp: config.status
	dh_testdir

	$(MAKE)
	sed -e '/fetchmail-5.3.3/ { s/.*/=== file truncated, see source package for complete changelog ===/; q; }' < NEWS > NEWS.truncated

	-chmod 644 build-stamp
	touch build-stamp

tmpdir=$(CURDIR)/debian/tmp
pckdir=$(CURDIR)/debian/fetchmail

install: build
	dh_testdir
	dh_testroot
	dh_clean -k -X.orig -X.rej
	dh_installdirs

	$(MAKE) install prefix=$(tmpdir)/usr mandir=$(tmpdir)/usr/share/man/man1
	-install -D -m 644 debian/fetchmailconf.xpm $(tmpdir)/usr/share/pixmaps/fetchmailconf.xpm

# Build architecture-independent files here. [ fetchmailconf ]
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_install -i --sourcedir=$(tmpdir)
	dh_installdocs -i
	dh_installmenu -i
	dh_installman -i
	dh_installchangelogs -i NEWS.truncated
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.  [ fetchmail ]
binary-arch: build install debian/fetchmail.postinst
	dh_testdir
	dh_testroot

	mkdir -p $(pckdir)/usr/share/doc/fetchmail/contrib
	xargs -r -i install "{}" $(pckdir)/usr/share/doc/fetchmail/contrib < debian/contrib.files
	-install -m 644 debian/README.contrib $(pckdir)/usr/share/doc/fetchmail/contrib/README.Debian

	install -D -m 755 debian/ip-up $(pckdir)/etc/ppp/ip-up.d/fetchmail
	install -D -m 755 debian/ip-down $(pckdir)/etc/ppp/ip-down.d/fetchmail

	install -D -m 755 debian/resolvconf $(pckdir)/etc/resolvconf/update-libc.d/fetchmail

	install -D -m 644 debian/workstation $(pckdir)/etc/logcheck/ignore.d.workstation/fetchmail
	install -D -m 644 debian/server $(pckdir)/etc/logcheck/ignore.d.server/fetchmail

	dh_install -a --sourcedir=$(tmpdir)
	dh_installdocs -a NOTES README fetchmail-features.html design-notes.html todo.html fetchmail-FAQ.html README.SSL
	dh_installexamples -a
	dh_installinit -a -n
	dh_installchangelogs -a NEWS.truncated
	dh_installman -a
	dh_strip -a
	dh_link -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 clean binary-indep binary-arch binary install