28 | 28 |
# Save Berkeley DB used for building the package
|
29 | 29 |
BDB_VERSION ?= $(shell LC_ALL=C dpkg-query -l 'libdb[45].[0-9]-dev' | grep ^ii | sed -e 's|.*\s\libdb\([45]\.[0-9]\)-dev\s.*|\1|')
|
30 | 30 |
|
31 | |
ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
|
32 | |
CONFIGURE_PROFILE=--enable-sql --with-ldap --enable-ldapdb
|
33 | |
DH_PACKAGE_EXCLUDES=
|
|
31 |
# SQL support may be turned off during the build, but is on by default.
|
|
32 |
ifeq (,$(findstring no-sql,$(DEB_BUILD_OPTIONS)))
|
|
33 |
CONFIGURE_SQL=--enable-sql
|
34 | 34 |
else
|
35 | |
CONFIGURE_PROFILE=--disable-sql --without-ldap --disable-ldapdb
|
36 | |
DH_PACKAGE_EXCLUDES=-Nlibsasl2-modules-sql -Nlibsasl2-modules-ldap \
|
37 | |
-Nlibsasl2-modules-gssapi-heimdal -Ncyrus-sasl2-heimdal-dbg
|
38 | |
|
39 | |
SASL_SKIP_SQL= 1
|
40 | |
SASL_SKIP_HEIMDAL= 1
|
|
35 |
CONFIGURE_SQL=--disable-sql
|
|
36 |
DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-sql
|
|
37 |
endif
|
|
38 |
|
|
39 |
# LDAP support may be turned off during the build, but is on by default.
|
|
40 |
ifeq (,$(findstring no-ldap,$(DEB_BUILD_OPTIONS)))
|
|
41 |
CONFIGURE_LDAP=--with-ldap
|
|
42 |
CONFIGURE_LDAPDB=--enable-ldapdb
|
|
43 |
else
|
|
44 |
CONFIGURE_LDAP=--without-ldap
|
|
45 |
CONFIGURE_LDAPDB=--disable-ldapdb
|
|
46 |
DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-ldap
|
|
47 |
endif
|
|
48 |
|
|
49 |
# GSSAPI support may be turned off during the build, but is on by default
|
|
50 |
ifeq (,$(findstring no-gssapi,$(DEB_BUILD_OPTIONS)))
|
|
51 |
CONFIGURE_GSSAPI=--enable-gssapi
|
|
52 |
else
|
|
53 |
CONFIGURE_GSSAPI=--disable-gssapi
|
|
54 |
DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-gssapi-mit \
|
|
55 |
-Nlibsasl2-modules-gssapi-heimdal \
|
|
56 |
-Ncyrus-sasl2-mit-dbg \
|
|
57 |
-Ncyrus-sasl2-heimdal-dbg
|
41 | 58 |
endif
|
42 | 59 |
|
43 | 60 |
CONFIGURE_COMMON_OPTIONS= \
|
|
55 | 72 |
--disable-srp \
|
56 | 73 |
--disable-srp-setpass \
|
57 | 74 |
--disable-krb4 \
|
58 | |
--enable-gssapi \
|
|
75 |
$(CONFIGURE_GSSAPI) \
|
59 | 76 |
--enable-gss_mutexes \
|
60 | 77 |
--enable-auth-sasldb \
|
61 | 78 |
--enable-plain \
|
|
63 | 80 |
--enable-login \
|
64 | 81 |
--enable-ntlm \
|
65 | 82 |
--disable-passdss \
|
|
83 |
$(CONFIGURE_SQL) \
|
66 | 84 |
--with-sqlite3=/usr \
|
67 | 85 |
--with-mysql=/usr \
|
68 | 86 |
--with-pgsql=/usr/include/postgresql \
|
|
87 |
$(CONFIGURE_LDAPDB) \
|
69 | 88 |
--disable-macos-framework \
|
70 | 89 |
--with-pam=/usr \
|
71 | 90 |
--with-saslauthd=/var/run/saslauthd \
|
72 | |
$(CONFIGURE_PROFILE) \
|
|
91 |
$(CONFIGURE_LDAP) \
|
73 | 92 |
--with-configdir=/etc/sasl2:/etc/sasl:/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2:/usr/lib/sasl2 \
|
74 | 93 |
--with-plugindir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2:/usr/lib/sasl2 \
|
75 | 94 |
--sysconfdir=/etc \
|
|
78 | 97 |
# Some convenience variables
|
79 | 98 |
export TMPBUILD_MIT := $(CURDIR)/build-mit
|
80 | 99 |
export TMPBUILD_HEIMDAL := $(CURDIR)/build-heimdal
|
81 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
82 | 100 |
export HEIMDAL_LDFLAGS := $(shell krb5-config.heimdal --libs gssapi | sed -e 's/ -l.*//')
|
83 | 101 |
export HEIMDAL_CPPFLAGS := $(shell krb5-config.heimdal --cflags gssapi)
|
84 | |
endif
|
85 | 102 |
export TMPPKG_MIT := $(CURDIR)/debian/tmp-mit
|
86 | 103 |
export TMPPKG_HEIMDAL := $(CURDIR)/debian/tmp-heimdal
|
87 | 104 |
|
|
96 | 113 |
|
97 | 114 |
override_dh_auto_clean:
|
98 | 115 |
dh_auto_clean -B$(TMPBUILD_MIT)
|
99 | |
[ ! -d "$(TMPBUILD_HEIMDAL)" ] || dh_auto_clean -B$(TMPBUILD_HEIMDAL)
|
|
116 |
dh_auto_clean -B$(TMPBUILD_HEIMDAL)
|
100 | 117 |
|
101 | 118 |
rm -f $(CURDIR)/sample/sample-client \
|
102 | 119 |
$(CURDIR)/sample/sample-server
|
|
121 | 138 |
CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -I/usr/include/mit-krb5" \
|
122 | 139 |
dh_auto_configure -B$(TMPBUILD_MIT) -- $(CONFIGURE_COMMON_OPTIONS) --with-gss_impl=mit
|
123 | 140 |
|
124 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
125 | 141 |
LDFLAGS="$(LDFLAGS) $(HEIMDAL_LDFLAGS) -Wl,-z,defs" \
|
126 | 142 |
CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) $(HEIMDAL_CPPFLAGS)" \
|
127 | 143 |
dh_auto_configure -B$(TMPBUILD_HEIMDAL) -- $(CONFIGURE_COMMON_OPTIONS) --with-gss_impl=heimdal
|
128 | |
endif
|
129 | 144 |
|
130 | 145 |
# Record the build-time settings for later reference
|
131 | 146 |
echo 'To build this package, configure was called as follows:' \
|
|
137 | 152 |
|
138 | 153 |
override_dh_auto_build:
|
139 | 154 |
dh_auto_build -B$(TMPBUILD_MIT) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
|
140 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
141 | 155 |
dh_auto_build -B$(TMPBUILD_HEIMDAL) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
|
142 | |
endif
|
143 | 156 |
|
144 | 157 |
# Build sample-{client,server}
|
145 | 158 |
$(MAKE) -f $(CURDIR)/debian/sample/Makefile -C $(CURDIR)/sample T=$(TMPBUILD_MIT)
|
|
154 | 167 |
|
155 | 168 |
override_dh_auto_install:
|
156 | 169 |
dh_auto_install -B$(TMPBUILD_MIT) -- DESTDIR=$(TMPPKG_MIT) sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
|
157 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
158 | 170 |
dh_auto_install -B$(TMPBUILD_HEIMDAL) -- DESTDIR=$(TMPPKG_HEIMDAL) sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
|
159 | |
endif
|
160 | 171 |
|
161 | 172 |
|
162 | 173 |
# Note the version of Berkeley DB used to build this package
|
|
183 | 194 |
# Alter the rpath of certain binaries and shared libraries.
|
184 | 195 |
chrpath -d $(TMPPKG_MIT)/usr/sbin/sasldblistusers2 \
|
185 | 196 |
$(TMPPKG_MIT)/usr/sbin/saslpasswd2
|
186 | |
ifeq (,$(SASL_SKIP_SQL))
|
|
197 |
ifeq (,$(findstring no-sql,$(DEB_BUILD_OPTIONS)))
|
187 | 198 |
chrpath -d $(TMPPKG_MIT)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/libsql.so.*.*.*
|
188 | 199 |
endif
|
189 | 200 |
|
|
206 | 217 |
|
207 | 218 |
override_dh_install:
|
208 | 219 |
dh_install -s --autodest --list-missing --sourcedir=$(TMPPKG_MIT) -psasl2-bin -plibsasl2-2 -plibsasl2-modules -plibsasl2-modules-db -plibsasl2-modules-ldap -plibsasl2-modules-otp -plibsasl2-modules-sql -plibsasl2-modules-gssapi-mit -plibsasl2-dev -Nlibsasl2-modules-gssapi-heimdal $(DH_PACKAGE_EXCLUDES)
|
209 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
210 | 220 |
dh_install -s --autodest --list-missing --sourcedir=$(TMPPKG_HEIMDAL) -plibsasl2-modules-gssapi-heimdal -Nsasl2-bin -Nlibsasl2-2 -Nlibsasl2-modules -Nlibsasl2-modules-db -Nlibsasl2-modules-ldap -Nlibsasl2-modules-otp -Nlibsasl2-modules-sql -Nlibsasl2-modules-gssapi-mit -Nlibsasl2-dev $(DH_PACKAGE_EXCLUDES)
|
211 | |
endif
|
212 | 221 |
|
213 | 222 |
override_dh_installinit:
|
214 | 223 |
dh_installinit $(DH_PACKAGE_EXCLUDES) --name=saslauthd start 20 2 3 4 5 . stop 20 0 1 6 .
|
215 | 224 |
|
216 | 225 |
override_dh_strip:
|
217 | 226 |
dh_strip -Xlibgssapiv2.so. -psasl2-bin -plibsasl2-2 -plibsasl2-modules -plibsasl2-modules-db -plibsasl2-modules-ldap -plibsasl2-modules-otp -plibsasl2-modules-sql -plibsasl2-modules-gssapi-mit -plibsasl2-dev -Nlibsasl2-modules-gssapi-heimdal $(DH_PACKAGE_EXCLUDES) --dbg-package=cyrus-sasl2-dbg
|
|
227 |
ifeq (,$(findstring no-gssapi,$(DEB_BUILD_OPTIONS)))
|
218 | 228 |
dh_strip -Xlibgs2.so.3 -Xlibscram.so. -plibsasl2-modules-gssapi-mit --dbg-package=cyrus-sasl2-mit-dbg
|
219 | |
ifeq (,$(SASL_SKIP_HEIMDAL))
|
220 | 229 |
dh_strip -plibsasl2-modules-gssapi-heimdal -Nsasl2-bin -Nlibsasl2-2 -Nlibsasl2-modules -Nlibsasl2-modules-db -Nlibsasl2-modules-ldap -Nlibsasl2-modules-otp -Nlibsasl2-modules-sql -Nlibsasl2-modules-gssapi-mit -Nlibsasl2-dev --dbg-package=cyrus-sasl2-heimdal-dbg
|
221 | 230 |
endif
|
222 | 231 |
|