~ubuntu-branches/debian/sid/netatalk/sid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2010-01-23 05:08:37 UTC
  • mfrom: (8.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100123050837-rh5465ophfkjpsn2
* Fix replace/drop bogus and/or obsolete configure options:
  + Use --without-ssl-dir/--with-ssl-dir (not --with-openssl-dir/
    --without-openssl-dir). Closes: bug#565969, thanks to Fabian
    Greffrath.
  + Use --enable-tcp-wrappers (not --with-tcp-wrappers).
  + Use --disable-srvloc (not --disable-slp).
  + Drop --disable-logger (obsolete since 2.0.1).
  + Drop --with-mangling (apparently obsolete since 2.0 alpha 1).
  + Drop --with-nls-dir and --without-xfs (apparently obsolete).
* Autoreconfigure during build (since upstream does not enable
  maintainer-mode). Disable autotools-related patches. Build-depend on
  libtool, automake1.11 and autoconf. Closes: bug#559060, thanks to
  Cyril Brulebois and others.
* Add safety-check to fail build if accidentally linked against
  libssl. Thanks to Fabian Greffrath (see bug#565969).
* Disable atalkd by default, to not require supported network active
  at daemon start time. Closes: bug#565568, thanks to Kurt Roeckx.
  Add NEWS entry about the change.
* Build-depend on and enable hardening-includes.
* Fix adjust "See also" of manpages referring to afile or achfile.
* Set urgency=medium as earlier lack of explicit disabling openssl
  caused the package to violate licensing for some architectures, also
  affecting testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
  DEB_COPYRIGHT_CHECK_STRICT = yes
25
25
  DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes
26
26
endif
27
 
#DEB_AUTO_UPDATE_ACLOCAL = 1.10
28
 
#DEB_AUTO_UPDATE_AUTOMAKE = 1.10
29
 
#DEB_AUTO_UPDATE_AUTOHEADER = 2.50
30
 
#DEB_AUTO_UPDATE_AUTOCONF = 2.61
31
 
#DEB_AUTO_UPDATE_LIBTOOL = post
 
27
DEB_AUTO_UPDATE_ACLOCAL = 1.11
 
28
DEB_AUTO_UPDATE_AUTOMAKE = 1.11
 
29
DEB_AUTO_UPDATE_AUTOHEADER = 2.65
 
30
DEB_AUTO_UPDATE_AUTOCONF = 2.65
 
31
DEB_AUTO_UPDATE_LIBTOOL = post
32
32
include debian/cdbs/1/rules/upstream-tarball.mk
33
33
include /usr/share/cdbs/1/rules/debhelper.mk
34
34
include /usr/share/cdbs/1/class/autotools.mk
37
37
include debian/cdbs/1/rules/copyright-check.mk
38
38
 
39
39
DEB_UPSTREAM_URL = http://downloads.sourceforge.net/netatalk
40
 
DEB_UPSTREAM_TARBALL_VERSION_MANGLE = s/~(alpha|beta|rc)/\1/
41
 
DEB_UPSTREAM_TARBALL_MD5 = f9ce650643f6289dc068984adeaf54b9
 
40
DEB_UPSTREAM_TARBALL_BASENAME_MANGLE = s/~(alpha|beta|rc)/\1/
 
41
DEB_UPSTREAM_TARBALL_MD5 = f35cd7a4ce26c780de380cd2bcae5ce6
 
42
 
 
43
db_stable = 4.2
 
44
db_testing = 4.7
 
45
db_current = 4.8
42
46
 
43
47
autotools-files = Makefile.in aclocal.m4 compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
44
 
 
45
 
DEB_UPDATE_RCD_PARAMS := defaults 50
 
48
autotools-bogusfiles = AUTHORS ChangeLog INSTALL
 
49
automakedirs = bin bin/adv1tov2 bin/aecho bin/afile bin/afppasswd bin/cnid bin/getzones bin/megatron bin/nbp bin/pap bin/psorder bin/uniconv
 
50
automakedirs += config contrib contrib/a2boot contrib/macusers contrib/nu contrib/printing contrib/shell_utils contrib/timelord
 
51
automakedirs += distrib distrib/config distrib/initscripts distrib/m4 doc
 
52
automakedirs += etc etc/afpd etc/atalkd etc/cnid_dbd etc/papd etc/psf etc/uams etc/uams/uams_krb4 include include/atalk
 
53
automakedirs += libatalk libatalk/adouble libatalk/asp libatalk/atp libatalk/cnid libatalk/cnid/cdb libatalk/cnid/db3
 
54
automakedirs += libatalk/cnid/dbd libatalk/cnid/hash libatalk/cnid/last libatalk/cnid/mtab libatalk/cnid/tdb libatalk/compat
 
55
automakedirs += libatalk/dsi libatalk/nbp libatalk/netddp libatalk/tdb libatalk/unicode libatalk/unicode/charsets libatalk/util
 
56
automakedirs += macros man man/man1 man/man3 man/man4 man/man5 man/man8
 
57
automakedirs += sys sys/generic sys/generic/sys sys/netatalk sys/netbsd sys/netbsd/netatalk sys/solaris sys/sunos sys/ultrix
 
58
autoshellfiles = afpd-mtab.pl apple_cp apple_mv apple_rm asip-status.pl cleanappledouble.pl
 
59
upstreamtmpfiles = $(autotools-files) $(automakedirs:%=%/Makefile.in) $(autoshellfiles:%=contrib/shell_utils/%)
 
60
 
 
61
DEB_ACLOCAL_ARGS = -I macros
 
62
 
 
63
# Override defaults for old-style update-rc.d
 
64
#  * Start and stop at priority 50 (FIXME: explain reasoning)
 
65
#  * Stop only in runlevel 1 (let system kill it in runlelels 0 and 6)
 
66
DEB_UPDATE_RCD_PARAMS = start 50 2 3 4 5 . stop 50 1 .
 
67
 
 
68
# Tighten security - more info at http://wiki.debian.org/Hardening
 
69
export DEB_BUILD_HARDENING=1
46
70
 
47
71
DEB_CONFIGURE_EXTRA_FLAGS := \
48
72
        --with-shadow --enable-fhs              \
49
 
        --with-tcp-wrappers --with-mangling     \
 
73
        --enable-tcp-wrappers                   \
50
74
        --enable-timelord --enable-overwrite    \
51
75
        --with-pkgconfdir=/etc/netatalk         \
52
 
        --with-nls-dir=/usr/share/netatalk/nls  \
53
 
        --disable-logger                        \
54
76
        --enable-krb4-uam --enable-krbV-uam     \
55
77
        --with-cnid-dbd-txn                     \
56
78
        --with-libgcrypt-dir                    \
57
79
        --with-cracklib=/var/cache/cracklib/cracklib_dict       \
58
80
        --enable-debian
59
81
 
60
 
# libxfs currently broken: redefines several __swabXXX in xfs/swab.h
61
 
DEB_CONFIGURE_EXTRA_FLAGS += --without-xfs
62
 
 
63
82
DEB_INSTALL_EXAMPLES_netatalk = debian/examples/*
64
83
 
65
84
openssl_build_depends = libssl-dev
67
86
# Zeroconf is cool, but not yet stable, so disabled by default
68
87
# Always disable SLP, as it was never really used by Apple
69
88
ifneq (,$(findstring zeroconf,$(DEB_BUILD_OPTIONS)))
70
 
DEB_CONFIGURE_EXTRA_FLAGS += --disable-slp --enable-zeroconf
 
89
DEB_CONFIGURE_EXTRA_FLAGS += --disable-srvloc --enable-zeroconf
71
90
else
72
 
DEB_CONFIGURE_EXTRA_FLAGS += --disable-slp --disable-zeroconf
 
91
DEB_CONFIGURE_EXTRA_FLAGS += --disable-srvloc --disable-zeroconf
73
92
endif
74
93
 
75
94
# libgcrypt is GPL-compatible, but openssl supports randnum auth
76
95
ifneq (,$(findstring openssl,$(DEB_BUILD_OPTIONS)))
77
 
DEB_CONFIGURE_EXTRA_FLAGS += --with-openssl-dir --enable-pgp-uam
 
96
DEB_CONFIGURE_EXTRA_FLAGS += --with-ssl-dir --enable-pgp-uam
78
97
uamlist = uams_dhx2.so,uams_clrtxt.so,uams_dhx.so,uams_randnum.so
79
98
else
80
 
DEB_CONFIGURE_EXTRA_FLAGS += --without-openssl-dir
 
99
DEB_CONFIGURE_EXTRA_FLAGS += --without-ssl-dir
81
100
uamlist = uams_dhx2.so,uams_clrtxt.so
82
101
endif
83
102
 
84
 
# Cheat autotools (as CDBS lack support for autotools options)
85
 
post-patches::
86
 
        touch AUTHORS ChangeLog INSTALL
87
 
        cp -al macros m4
 
103
# Put aside upstream-shipped autotools before build but after licensecheck
 
104
pre-build:: debian/stamp-upstreamtmpstuff
 
105
debian/stamp-upstreamtmpstuff:
 
106
        for file in $(upstreamtmpfiles); do \
 
107
                [ ! -e $$file ] || [ -e $$file.upstream ] || cp -af $$file $$file.upstream; \
 
108
        done
 
109
        touch $@
 
110
 
 
111
# Revert upstream-shipped autotools that was put aside during build
88
112
clean::
89
 
        rm -f AUTHORS ChangeLog INSTALL
90
 
        rm -rf m4
 
113
        for file in $(autotools-bogusfiles); do \
 
114
                [ -s $$file ] || rm -f $$file; \
 
115
        done
 
116
        for file in $(upstreamtmpfiles); do \
 
117
                [ ! -e $$file.upstream ] || mv -v -f $$file.upstream $$file; \
 
118
        done
 
119
        rm -f debian/stamp-upstreamtmpstuff
91
120
 
92
121
# Refuse GPL build with openssl build-dependencies included
93
122
post-patches::
94
123
        $(if $(findstring openssl,$(DEB_BUILD_OPTIONS)),,$(if $(shell egrep -i '^Build-Depends.*$(openssl_build_depends)' debian/control),$(error OpenSSL build-dependencies found in GPL build!)))
95
124
 
 
125
# Check that we do not install anything linked with libssl in a GPL build
 
126
binary-post-install/netatalk::
 
127
        $(if $(findstring openssl,$(DEB_BUILD_OPTIONS)),,$(if $(shell objdump -x debian/netatalk/usr/lib/netatalk/* 2> /dev/null | sed -n '/NEEDED \+libssl\.so/p'),$(error OpenSSL dependencies found in GPL build!)))
 
128
 
96
129
# Re-install initscript with debhelper to add pre- and postinst routines
97
130
install/netatalk::
98
131
        mv debian/netatalk/etc/init.d/netatalk debian/netatalk.init
119
152
        mv $(bindir)/achfile $(bindir)/apple_chfile
120
153
        perl -p -e 's/(?<!Title: )achfile\\b/apple_chfile/g' <$(man1dir)/achfile.1 >$(man1dir)/apple_chfile.1
121
154
        rm $(man1dir)/uniconv.1 $(man1dir)/afile.1 $(man1dir)/achfile.1
122
 
        find $(man1dir) -type f -exec grep -Eq 'afile|achfile' -exec perl -i -pe 's/(\\fBa)((ch)?file\\fR)/$$1pple_$$2/g' '{}' ';'
 
155
        find $(man1dir) -type f -exec grep -Eq 'afile|achfile' '{}' ';' -exec perl -i -pe 's/(\\fBa)((ch)?file\\fR)/$$1pple_$$2/g' '{}' ';'
123
156
 
124
157
# Adjust PAM modules and UAMs loaded by default, depending on ssl support
125
158
binary-post-install/netatalk::
154
187
        rm -rf "$(DEB_UPSTREAM_WORKDIR)/vcstemp"
155
188
 
156
189
# Needed for by upstream build process
157
 
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), libdb4.7-dev, libwrap0-dev, libpam0g-dev, libavahi-client-dev (>= 0.6), libcups2-dev, libkrb5-dev, libltdl3-dev
158
 
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), libgcrypt11-dev | libgcrypt-dev, cracklib-dev
 
190
CDBS_BUILD_DEPENDS += , libdb$(db_current)-dev, libwrap0-dev, libpam0g-dev, libcups2-dev, libkrb5-dev, libltdl3-dev
 
191
CDBS_BUILD_DEPENDS += , libgcrypt11-dev | libgcrypt-dev, libcrack2-dev | cracklib-dev
 
192
ifneq (,$(findstring zeroconf,$(DEB_BUILD_OPTIONS)))
 
193
CDBS_BUILD_DEPENDS += , libavahi-client-dev (>= 0.6)
 
194
endif
159
195
ifneq (,$(findstring openssl,$(DEB_BUILD_OPTIONS)))
160
 
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), $(openssl_build_depends)
 
196
CDBS_BUILD_DEPENDS += , $(openssl_build_depends)
161
197
endif
162
198
 
163
199
# Needed for our packaging routines
164
 
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), d-shlibs (>> 0.19)
 
200
CDBS_BUILD_DEPENDS += , d-shlibs (>> 0.19), hardening-includes
 
201
 
 
202
# Needed (always/often/seldom) at runtime
 
203
#  * netbase needed by network-facing daemons
 
204
#  * libpam-modules, libpam-cracklib and cracklib-runtime needed by daemons afpd and papd
 
205
#  * lsof and procps needed by script macusers
 
206
#  * rc needed by script acleandir.rc
 
207
#  * db4.8-util needed by script cnid_maint
 
208
#  * texlive-base-bin (dvips) and groff (roff2ps) needed by script etc2ps
 
209
#  * quota needed by daemon afpd
 
210
#  * db4.2-util needed by example script netatalk_update.sh for upgrades
 
211
#    from 2.0.4~beta2-4 and earlier: can be dropped after Squeeze+1
 
212
#  * db4.7-util needed by example script netatalk_update.sh for upgrades
 
213
#    from 2.0.5-1 and earlier: can be dropped when 2.0.5-2 is in testing
 
214
CDBS_DEPENDS = netbase, libpam-modules
 
215
CDBS_RECOMMENDS = lsof, rc, db$(db_current)-util, procps, cracklib-runtime, libpam-cracklib
 
216
CDBS_SUGGESTS = texlive-base-bin, groff, quota, $(db_stable:%=db%-util), $(db_testing:%=db%-util)
165
217
 
166
218
# Resolve, cleanup and apply CDBS-declared dependencies
167
219
include debian/cdbs/1/rules/package-relations.mk