| 1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| ... | ... | |
| 6 |
6 |
inherit autotools edos2unix flag-o-matic multilib multilib-minimal pam db-use systemd toolchain-funcs tmpfiles
|
| 7 |
7 |
|
| 8 |
8 |
SASLAUTHD_CONF_VER="2.1.26"
|
| 9 |
|
MY_PATCH_VER="${PN}-2.1.28-r4-patches"
|
|
9 |
MY_PATCH_VER="${PN}-2.1.28-r6-patches"
|
| 10 |
10 |
DESCRIPTION="The Cyrus SASL (Simple Authentication and Security Layer)"
|
| 11 |
11 |
HOMEPAGE="https://www.cyrusimap.org/sasl/"
|
| 12 |
12 |
SRC_URI="https://github.com/cyrusimap/${PN}/releases/download/${P}/${P}.tar.gz"
|
| 13 |
|
SRC_URI+=" https://dev.gentoo.org/~grobian/distfiles/${MY_PATCH_VER}.tar.xz"
|
|
13 |
SRC_URI+=" https://www.applied-asynchrony.com/distfiles/${MY_PATCH_VER}.tar.xz"
|
| 14 |
14 |
|
| 15 |
15 |
LICENSE="BSD-with-attribution"
|
| 16 |
16 |
SLOT="2"
|
| 17 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
|
| 18 |
|
IUSE="authdaemond berkdb gdbm kerberos ldapdb openldap mysql pam postgres sample selinux sqlite srp ssl static-libs urandom"
|
|
17 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
|
|
18 |
IUSE="authdaemond berkdb gdbm kerberos ldapdb openldap mysql ntlm pam postgres selinux sqlite srp ssl static-libs urandom"
|
| 19 |
19 |
REQUIRED_USE="ldapdb? ( openldap )"
|
| 20 |
20 |
|
| 21 |
21 |
# See bug #855890 for sys-libs/db slot
|
| ... | ... | |
| 33 |
33 |
ssl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )"
|
| 34 |
34 |
RDEPEND="${DEPEND}
|
| 35 |
35 |
selinux? ( sec-policy/selinux-sasl )"
|
|
36 |
BDEPEND="virtual/libcrypt
|
|
37 |
berkdb? ( >=sys-libs/db-4.8.30-r1:4.8 )
|
|
38 |
gdbm? ( >=sys-libs/gdbm-1.10-r1 )"
|
| 36 |
39 |
|
| 37 |
40 |
MULTILIB_WRAPPED_HEADERS=(
|
| 38 |
41 |
/usr/include/sasl/md5global.h
|
| ... | ... | |
| 45 |
48 |
src_prepare() {
|
| 46 |
49 |
default
|
| 47 |
50 |
|
| 48 |
|
# Use plugindir for sasldir
|
| 49 |
|
# https://github.com/cyrusimap/cyrus-sasl/issues/339 (I think)
|
| 50 |
|
sed -i '/^sasldir =/s:=.*:= $(plugindir):' \
|
| 51 |
|
"${S}"/plugins/Makefile.{am,in} || die "sed failed"
|
| 52 |
|
|
| 53 |
51 |
# bug #486740 and bug #468556 (dropped AM_CONFIG_HEADER sed in 2.1.28)
|
| 54 |
52 |
sed -i -e 's:AC_CONFIG_MACRO_DIR:AC_CONFIG_MACRO_DIRS:g' configure.ac || die
|
| 55 |
53 |
|
| ... | ... | |
| 80 |
78 |
fi
|
| 81 |
79 |
|
| 82 |
80 |
multilib-minimal_src_configure
|
|
81 |
|
|
82 |
if ( use berkdb || use gdbm ) && tc-is-cross-compiler ; then
|
|
83 |
mkdir -p "${WORKDIR}"/${P}-build || die
|
|
84 |
cd "${WORKDIR}"/${P}-build || die
|
|
85 |
# We don't care which berkdb version is used as this build is only
|
|
86 |
# temporary for generating an empty sasldb2 later.
|
|
87 |
ECONF_SOURCE="${S}" econf_build \
|
|
88 |
--with-dblib=$(usex berkdb berkeley gdbm)
|
|
89 |
fi
|
| 83 |
90 |
}
|
| 84 |
91 |
|
| 85 |
92 |
multilib_src_configure() {
|
| 86 |
93 |
local myeconfargs=(
|
| 87 |
94 |
--enable-login
|
| 88 |
|
--enable-ntlm
|
| 89 |
95 |
--enable-auth-sasldb
|
| 90 |
96 |
--disable-cmulocal
|
| 91 |
97 |
--disable-krb4
|
| ... | ... | |
| 102 |
108 |
$(use_with pam)
|
| 103 |
109 |
$(use_with openldap ldap)
|
| 104 |
110 |
$(use_enable ldapdb)
|
| 105 |
|
$(multilib_native_use_enable sample)
|
|
111 |
$(use_enable ntlm)
|
| 106 |
112 |
$(use_enable kerberos gssapi)
|
| 107 |
|
$(multilib_native_use_with mysql mysql "${EPREFIX}"/usr)
|
|
113 |
$(multilib_native_use_with mysql mysql "${EPREFIX}/usr/$(get_libdir)")
|
| 108 |
114 |
$(multilib_native_use_with postgres pgsql "${EPREFIX}/usr/$(get_libdir)/postgresql")
|
| 109 |
115 |
$(use_with sqlite sqlite3 "${EPREFIX}/usr/$(get_libdir)")
|
| 110 |
116 |
$(use_enable srp)
|
| ... | ... | |
| 144 |
150 |
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
| 145 |
151 |
}
|
| 146 |
152 |
|
|
153 |
src_compile() {
|
|
154 |
multilib-minimal_src_compile
|
|
155 |
|
|
156 |
if ( use berkdb || use gdbm ) && tc-is-cross-compiler ; then
|
|
157 |
emake -C "${WORKDIR}"/${P}-build
|
|
158 |
fi
|
|
159 |
}
|
|
160 |
|
| 147 |
161 |
multilib_src_install() {
|
| 148 |
162 |
default
|
| 149 |
163 |
|
| 150 |
164 |
if multilib_is_native_abi; then
|
| 151 |
|
if use sample ; then
|
| 152 |
|
docinto sample
|
| 153 |
|
dodoc "${S}"/sample/*.c
|
| 154 |
|
exeinto /usr/share/doc/${P}/sample
|
| 155 |
|
doexe sample/client sample/server
|
| 156 |
|
fi
|
| 157 |
|
|
| 158 |
165 |
dosbin saslauthd/testsaslauthd
|
|
166 |
keepdir /etc/sasl2
|
|
167 |
|
|
168 |
if use berkdb || use gdbm ; then
|
|
169 |
einfo "Generating an empty sasldb2 ..."
|
|
170 |
tc-is-cross-compiler && { cd "${WORKDIR}"/${P}-build || die; }
|
|
171 |
export SASL_PATH=./plugins/.libs
|
|
172 |
|
|
173 |
./utils/saslpasswd2 -f "${ED}"/etc/sasl2/sasldb2-empty -p login <<< p \
|
|
174 |
|| die "Failed to generate sasldb2"
|
|
175 |
|
|
176 |
./utils/saslpasswd2 -f "${ED}"/etc/sasl2/sasldb2-empty -d login \
|
|
177 |
|| die "Failed to delete temp user"
|
|
178 |
|
|
179 |
fowners root:mail /etc/sasl2/sasldb2-empty
|
|
180 |
fperms 0640 /etc/sasl2/sasldb2-empty
|
|
181 |
fi
|
| 159 |
182 |
fi
|
| 160 |
183 |
}
|
| 161 |
184 |
|
| 162 |
185 |
multilib_src_install_all() {
|
| 163 |
186 |
doman man/*
|
| 164 |
187 |
|
| 165 |
|
keepdir /etc/sasl2
|
| 166 |
|
|
| 167 |
188 |
# Reset docinto to default value (bug #674296)
|
| 168 |
189 |
docinto
|
| 169 |
|
dodoc AUTHORS ChangeLog doc/legacy/TODO
|
|
190 |
dodoc AUTHORS ChangeLog doc/legacy/TODO "${FILESDIR}"/README.sample
|
| 170 |
191 |
newdoc pwcheck/README README.pwcheck
|
| 171 |
192 |
|
| 172 |
193 |
newdoc docsrc/sasl/release-notes/$(ver_cut 1-2)/index.rst release-notes
|
| ... | ... | |
| 198 |
219 |
pkg_postinst() {
|
| 199 |
220 |
tmpfiles_process ${PN}.conf
|
| 200 |
221 |
|
| 201 |
|
# Generate an empty sasldb2 with correct permissions.
|
| 202 |
|
if ( use berkdb || use gdbm ) && [[ ! -f "${EROOT}/etc/sasl2/sasldb2" ]] ; then
|
| 203 |
|
einfo "Generating an empty sasldb2 with correct permissions ..."
|
| 204 |
|
|
| 205 |
|
echo "p" | "${EROOT}/usr/sbin/saslpasswd2" -f "${EROOT}/etc/sasl2/sasldb2" -p login \
|
| 206 |
|
|| die "Failed to generate sasldb2"
|
| 207 |
|
|
| 208 |
|
"${EROOT}/usr/sbin/saslpasswd2" -f "${EROOT}/etc/sasl2/sasldb2" -d login \
|
| 209 |
|
|| die "Failed to delete temp user"
|
| 210 |
|
|
| 211 |
|
chown root:mail "${EROOT}/etc/sasl2/sasldb2" \
|
| 212 |
|
|| die "Failed to chown ${EROOT}/etc/sasl2/sasldb2"
|
| 213 |
|
chmod 0640 "${EROOT}/etc/sasl2/sasldb2" \
|
| 214 |
|
|| die "Failed to chmod ${EROOT}/etc/sasl2/sasldb2"
|
|
222 |
if ( use berkdb || use gdbm ) && [[ ! -f ${EROOT}/etc/sasl2/sasldb2 ]] ; then
|
|
223 |
cp -av "${EROOT}"/etc/sasl2/sasldb2{-empty,} || die
|
| 215 |
224 |
fi
|
| 216 |
225 |
|
| 217 |
226 |
if use authdaemond ; then
|