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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
|
#!/usr/bin/make -f
#
# $Id: rules 504 2010-02-02 11:40:24Z hector $
#
# 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)
PYVER=$(shell pyversions -vd)
# quilt support
include /usr/share/quilt/quilt.make
# 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,KRB5,GSSAPI"
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
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
# enable hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS += -Wall -pipe
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
export CFLAGS
clean: unpatch
dh_testdir
dh_testroot
-rm -f build-stamp configure-stamp
[ ! -f Makefile ] || $(MAKE) distclean
-rm -f po/*.gmo config.sub config.guess config.status
dh_clean -X.orig -X.rej
configure: configure-stamp
configure-stamp: patch
set -e
dh_testdir
cp /usr/share/misc/config.sub config.sub
cp /usr/share/misc/config.guess config.guess
./configure $(CONFFLAGS) --prefix=/usr --enable-nls \
--disable-fallback $(FETCHCONFOPT)
sed -e "s/-lcrypt//; s/-lk5crypto//g;" < Makefile > Makefile.tmp
mv Makefile.tmp Makefile
touch configure-stamp
build: configure-stamp build-arch
build-arch: configure-stamp build-stamp
build-indep: configure-stamp build-stamp
build-stamp:
set -e
dh_testdir
$(MAKE)
# recreate gmo-files as workaround
(cd po; $(MAKE) update-gmo)
# sed -e '/fetchmail-5.3.3/ { s/.*/=== file truncated, see source package for complete changelog ===/; q; }' < NEWS > NEWS.truncated
touch build-stamp
tmpdir = $(CURDIR)/debian/tmp
pckdir = $(CURDIR)/debian/fetchmail
install: build-stamp
dh_testdir
dh_testroot
dh_prep -X.orig -X.rej
dh_installdirs
$(MAKE) install prefix=$(tmpdir)/usr mandir=$(tmpdir)/usr/share/man
-install -D -m 644 debian/fetchmailconf.xpm \
$(tmpdir)/usr/share/pixmaps/fetchmailconf.xpm
gzip -9 $(tmpdir)/usr/share/man/man1/fetchmail.1
# not needed we set a symlink
# gzip -9 $(tmpdir)/usr/share/man/man1/fetchmailconf.1
# mkdir -p debian/fetchmailconf/usr/lib/python$(PYVER)/site-packages/
# mv debian/tmp/usr/lib/python$(PYVER)/site-packages/fetchmailconf.py \
# debian/fetchmailconf/usr/lib/python$(PYVER)/site-packages/
# Build architecture-independent files here. [ fetchmailconf ]
binary-indep: build-stamp install
dh_testdir
dh_testroot
dh_install -i --sourcedir=$(tmpdir)
dh_installdocs -i
dh_installmenu -i
dh_installman -i
dh_installchangelogs -i
dh_link -i usr/share/man/man1/fetchmail.1.gz usr/share/man/man1/fetchmailconf.1.gz
dh_python2 -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-stamp install
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 OLDNEWS
dh_installexamples -a
dh_installinit -a -n
dh_installchangelogs -a NEWS
dh_installman
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
|