Skip to content
This repository
Browse code

synced net-nds/openldap via auto-sync

  • Loading branch information...
commit 81237ba8ff954b9fb08166a1b5f42f08b42dab68 1 parent 7240722
ahuemer ahuemer authored
2  net-nds/openldap/Manifest
@@ -20,7 +20,9 @@ DIST openldap-2.3.43.tgz 3803011 RMD160 3ecb789e5f4d4c939357e2e7220d793eb05402e7
20 20 DIST openldap-2.4.19.tgz 5474200 RMD160 89b6eb1bbf0290178a28a1447fb6240c5e8f79dc SHA1 4a78acae0dd6d51d22ff50eef77912e59b31779a SHA256 b7a2642f620f98bebf6b52a227ba66b93c5028c68088bf107b7403d2ce6e1533
21 21 DIST openldap-2.4.21.tgz 5477877 RMD160 94f662e8fe1b009f5836cb9c19b095f1b159b1bd SHA1 cfcfff3df7804bab8eb0d9464d3712a3e32d677b SHA256 22eca357137c135b5561e2fa0e3336b280702acf2e5c4f40bc7aed1d1e8e9324
22 22 DIST openldap-2.4.23.tgz 5182440 RMD160 d2268e8fb894680d1d9926fedca736f195e0a0be SHA1 26027e7020256c5f47e17787f17ee8b31af42378 SHA256 5a5ede91d5e8ab3c7f637620aa29a3b96eb34318a8b26c8eef2d2c789fc055e3
  23 +DIST openldap-2.4.24.tgz 5240643 RMD160 b9df6a5a562b83fe4ad92f8779909b36fab65c52 SHA1 a4baad3d45ae5810ba5fee48603210697c70d52f SHA256 fdcecb64082a0d8e124f13b31fccf4765901e29decaf4224b28d4cff90a14614
23 24 EBUILD openldap-2.3.43-r1.ebuild 18261 RMD160 9bae90d4056766bc9c6e575b92e3b0264dd984fd SHA1 64aad92e2b45ce3e2b4ab32bf72319678247e9a7 SHA256 7c916fbd8fed070de7ebaee79e0b6c7aa4987136e00b57f55a1e9e2ed9f16046
24 25 EBUILD openldap-2.4.19-r1.ebuild 20015 RMD160 90a4fda77c3d32778f6553dd86cf14aa56e412f1 SHA1 855ba25bb47bf4c2cd7119429f97ef3879bac05c SHA256 99f8ee38897db0068d57d7152d396b3169bd0fe59b938b6ff3da7c9d26c818ef
25 26 EBUILD openldap-2.4.21.ebuild 20216 RMD160 fabe092d22c4bf8938a863c6ce9ec6b5e93fc1a1 SHA1 449beacbd56f85033330465c8763bf4a57340b2c SHA256 179846597dbb98b5b7597d01f543a84adbb3d74ade51530b0a36d4cadeb77a6a
26 27 EBUILD openldap-2.4.23.ebuild 20206 RMD160 79e77a4b573333e48ed80cd0925db96bab18b756 SHA1 4fb42cd77cb4d5fa690f3397aba744fbae4ec3d6 SHA256 0cf4aa47d97d990276fc3c387650b544749887224391e56f3f753fa3d8425e13
  28 +EBUILD openldap-2.4.24.ebuild 20207 RMD160 a6cf37ec8f0b657cae6dc84a061976641680fabf SHA1 308ad9088648de827183d3cc8e2c77e8a939521a SHA256 5828beed4f1784318901e0f14fec85da190379ed0f64e8d13ddb301c118454d6
605 net-nds/openldap/openldap-2.4.24.ebuild
... ... @@ -0,0 +1,605 @@
  1 +# Copyright 1999-2011 Gentoo Foundation
  2 +# Distributed under the terms of the GNU General Public License v2
  3 +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/openldap-2.4.24.ebuild,v 1.6 2011/02/26 16:44:43 armin76 Exp $
  4 +
  5 +EAPI="2"
  6 +inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs multilib-native
  7 +
  8 +DESCRIPTION="LDAP suite of application and development tools"
  9 +HOMEPAGE="http://www.OpenLDAP.org/"
  10 +SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
  11 +
  12 +LICENSE="OPENLDAP"
  13 +SLOT="0"
  14 +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
  15 +
  16 +IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
  17 +IUSE_BACKEND="+berkdb"
  18 +IUSE_OVERLAY="overlays perl"
  19 +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 syslog selinux"
  20 +IUSE_CONTRIB="smbkrb5passwd kerberos"
  21 +IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
  22 +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
  23 +
  24 +# openssl is needed to generate lanman-passwords required by samba
  25 +RDEPEND="sys-libs/ncurses[lib32?]
  26 + icu? ( dev-libs/icu[lib32?] )
  27 + tcpd? ( sys-apps/tcp-wrappers[lib32?] )
  28 + ssl? ( !gnutls? ( dev-libs/openssl[lib32?] )
  29 + gnutls? ( net-libs/gnutls[lib32?] ) )
  30 + sasl? ( dev-libs/cyrus-sasl[lib32?] )
  31 + !minimal? (
  32 + odbc? ( !iodbc? ( dev-db/unixODBC[lib32?] )
  33 + iodbc? ( dev-db/libiodbc ) )
  34 + slp? ( net-libs/openslp[lib32?] )
  35 + perl? ( dev-lang/perl[-build,lib32?] )
  36 + samba? ( dev-libs/openssl[lib32?] )
  37 + berkdb? ( sys-libs/db[lib32?] )
  38 + smbkrb5passwd? (
  39 + dev-libs/openssl[lib32?]
  40 + app-crypt/heimdal[lib32?] )
  41 + kerberos? ( virtual/krb5[lib32?] )
  42 + cxx? ( dev-libs/cyrus-sasl[lib32?] )
  43 + )
  44 + selinux? ( sec-policy/selinux-openldap )"
  45 +DEPEND="${RDEPEND}"
  46 +
  47 +# for tracking versions
  48 +OPENLDAP_VERSIONTAG=".version-tag"
  49 +OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
  50 +
  51 +openldap_filecount() {
  52 + local dir="$1"
  53 + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG.example' | wc -l
  54 +}
  55 +
  56 +openldap_find_versiontags() {
  57 + # scan for all datadirs
  58 + openldap_datadirs=""
  59 + if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
  60 + openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
  61 + fi
  62 + openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
  63 +
  64 + einfo
  65 + einfo "Scanning datadir(s) from slapd.conf and"
  66 + einfo "the default installdir for Versiontags"
  67 + einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
  68 + einfo
  69 +
  70 + # scan datadirs if we have a version tag
  71 + openldap_found_tag=0
  72 + have_files=0
  73 + for each in ${openldap_datadirs}; do
  74 + CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
  75 + CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
  76 + if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then
  77 + einfo "- Checking ${each}..."
  78 + if [ -r ${CURRENT_TAG} ] ; then
  79 + # yey, we have one :)
  80 + einfo " Found Versiontag in ${each}"
  81 + source ${CURRENT_TAG}
  82 + if [ "${OLDPF}" == "" ] ; then
  83 + eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
  84 + eerror "Please delete it"
  85 + eerror
  86 + die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
  87 + fi
  88 +
  89 + OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
  90 +
  91 + [ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
  92 +
  93 + # are we on the same branch?
  94 + if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
  95 + ewarn " Versiontag doesn't match current major release!"
  96 + if [[ "${have_files}" == "1" ]] ; then
  97 + eerror " Versiontag says other major and you (probably) have datafiles!"
  98 + echo
  99 + openldap_upgrade_howto
  100 + else
  101 + einfo " No real problem, seems there's no database."
  102 + fi
  103 + else
  104 + einfo " Versiontag is fine here :)"
  105 + fi
  106 + else
  107 + einfo " Non-tagged dir ${each}"
  108 + [ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
  109 + if [[ "${have_files}" == "1" ]] ; then
  110 + einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
  111 + echo
  112 +
  113 + eerror
  114 + eerror "Your OpenLDAP Installation has a non tagged datadir that"
  115 + eerror "possibly contains a database at ${CURRENT_TAGDIR}"
  116 + eerror
  117 + eerror "Please export data if any entered and empty or remove"
  118 + eerror "the directory, installation has been stopped so you"
  119 + eerror "can take required action"
  120 + eerror
  121 + eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
  122 + eerror
  123 + die "Please move the datadir ${CURRENT_TAGDIR} away"
  124 + fi
  125 + fi
  126 + einfo
  127 + fi
  128 + done
  129 + [ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
  130 +
  131 + # Now we must check for the major version of sys-libs/db linked against.
  132 + SLAPD_PATH=${ROOT}/usr/$(get_libdir)/openldap/slapd
  133 + if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
  134 + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
  135 + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
  136 + NEWVER="$(use berkdb && db_findver sys-libs/db)"
  137 + local fail=0
  138 + if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
  139 + :
  140 + # Nothing wrong here.
  141 + elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
  142 + eerror " Your existing version of OpenLDAP was not built against"
  143 + eerror " any version of sys-libs/db, but the new one will build"
  144 + eerror " against ${NEWVER} and your database may be inaccessible."
  145 + echo
  146 + fail=1
  147 + elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
  148 + eerror " Your existing version of OpenLDAP was built against"
  149 + eerror " sys-libs/db:${OLDVER}, but the new one will not be"
  150 + eerror " built against any version and your database may be"
  151 + eerror " inaccessible."
  152 + echo
  153 + fail=1
  154 + elif [ "${OLDVER}" != "${NEWVER}" ]; then
  155 + eerror " Your existing version of OpenLDAP was built against"
  156 + eerror " sys-libs/db:${OLDVER}, but the new one will build against"
  157 + eerror " ${NEWVER} and your database would be inaccessible."
  158 + echo
  159 + fail=1
  160 + fi
  161 + [ "${fail}" == "1" ] && openldap_upgrade_howto
  162 + fi
  163 +
  164 + echo
  165 + einfo
  166 + einfo "All datadirs are fine, proceeding with merge now..."
  167 + einfo
  168 +}
  169 +
  170 +openldap_upgrade_howto() {
  171 + eerror
  172 + eerror "A (possible old) installation of OpenLDAP was detected,"
  173 + eerror "installation will not proceed for now."
  174 + eerror
  175 + eerror "As major version upgrades can corrupt your database,"
  176 + eerror "you need to dump your database and re-create it afterwards."
  177 + eerror
  178 + eerror "Additionally, rebuilding against different major versions of the"
  179 + eerror "sys-libs/db libraries will cause your database to be inaccessible."
  180 + eerror ""
  181 + d="$(date -u +%s)"
  182 + l="/root/ldapdump.${d}"
  183 + i="${l}.raw"
  184 + eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
  185 + eerror " 2. slapcat -l ${i}"
  186 + eerror " 3. egrep -v '^entryCSN:' <${i} >${l}"
  187 + eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
  188 + eerror " 5. emerge --update \=net-nds/${PF}"
  189 + eerror " 6. etc-update, and ensure that you apply the changes"
  190 + eerror " 7. slapadd -l ${l}"
  191 + eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
  192 + eerror " 9. /etc/init.d/slapd start"
  193 + eerror "10. check that your data is intact."
  194 + eerror "11. set up the new replication system."
  195 + eerror
  196 + if [ "${FORCE_UPGRADE}" != "1" ]; then
  197 + die "You need to upgrade your database first"
  198 + else
  199 + eerror "You have the magical FORCE_UPGRADE=1 in place."
  200 + eerror "Don't say you weren't warned about data loss."
  201 + fi
  202 +}
  203 +
  204 +multilib-native_pkg_setup_internal() {
  205 + if ! use sasl && use cxx ; then
  206 + die "To build the ldapc++ library you must emerge openldap with sasl support"
  207 + fi
  208 + if use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
  209 + einfo
  210 + einfo "Skipping scan for previous datadirs as requested by minimal useflag"
  211 + einfo
  212 + else
  213 + openldap_find_versiontags
  214 + fi
  215 +
  216 + enewgroup ldap 439
  217 + enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
  218 +}
  219 +
  220 +multilib-native_src_prepare_internal() {
  221 + # ensure correct SLAPI path by default
  222 + sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
  223 + "${S}"/include/ldap_defaults.h
  224 +
  225 + epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
  226 +
  227 + epatch \
  228 + "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
  229 + "${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
  230 +
  231 + # bug #116045 - still present in 2.4.19
  232 + epatch "${FILESDIR}"/${PN}-2.4.19-contrib-smbk5pwd.patch
  233 +
  234 + # bug #189817
  235 + epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
  236 +
  237 + # bug #233633
  238 + epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
  239 +
  240 + cd "${S}"/build
  241 + einfo "Making sure upstream build strip does not do stripping too early"
  242 + sed -i.orig \
  243 + -e '/^STRIP/s,-s,,g' \
  244 + top.mk || die "Failed to block stripping"
  245 +
  246 + # wrong assumption that /bin/sh is /bin/bash
  247 + sed -i \
  248 + -e 's|/bin/sh|/bin/bash|g' \
  249 + "${S}"/tests/scripts/* || die "sed failed"
  250 +}
  251 +
  252 +build_contrib_module() {
  253 + lt="${S}/libtool"
  254 + # <dir> <sources> <outputname>
  255 + cd "${S}/contrib/slapd-modules/$1"
  256 + einfo "Compiling contrib-module: $3"
  257 + # Make sure it's uppercase
  258 + local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
  259 + "${lt}" --mode=compile --tag=CC \
  260 + "${CC}" \
  261 + -D${define_name}=SLAPD_MOD_DYNAMIC \
  262 + -I../../../include -I../../../servers/slapd ${CFLAGS} \
  263 + -o ${2%.c}.lo -c $2 || die "compiling $3 failed"
  264 + einfo "Linking contrib-module: $3"
  265 + "${lt}" --mode=link --tag=CC \
  266 + "${CC}" -module \
  267 + ${CFLAGS} \
  268 + ${LDFLAGS} \
  269 + -rpath /usr/$(get_libdir)/openldap/openldap \
  270 + -o $3.la ${2%.c}.lo || die "linking $3 failed"
  271 +}
  272 +
  273 +multilib-native_src_configure_internal() {
  274 + local myconf
  275 +
  276 + #Fix for glibc-2.8 and ucred. Bug 228457.
  277 + append-flags -D_GNU_SOURCE
  278 +
  279 + use debug && myconf="${myconf} $(use_enable debug)"
  280 +
  281 + # ICU usage is not configurable
  282 + export ac_cv_header_unicode_utypes_h="$(use icu && echo yes || echo no)"
  283 +
  284 + if ! use minimal ; then
  285 + # re-enable serverside overlay chains per bug #296567
  286 + # see ldap docs chaper 12.3.1 for details
  287 + myconf="${myconf} --enable-ldap"
  288 +
  289 + # backends
  290 + myconf="${myconf} --enable-slapd"
  291 + if use berkdb ; then
  292 + einfo "Using Berkeley DB for local backend"
  293 + myconf="${myconf} --enable-bdb --enable-hdb"
  294 + # We need to include the slotted db.h dir for FreeBSD
  295 + append-cppflags -I$(db_includedir)
  296 + else
  297 + ewarn
  298 + ewarn "Note: if you disable berkdb, you can only use remote-backends!"
  299 + ewarn
  300 + ebeep 5
  301 + myconf="${myconf} --disable-bdb --disable-hdb"
  302 + fi
  303 + for backend in dnssrv ldap meta monitor null passwd relay shell sock; do
  304 + myconf="${myconf} --enable-${backend}=mod"
  305 + done
  306 +
  307 + myconf="${myconf} $(use_enable perl perl mod)"
  308 +
  309 + myconf="${myconf} $(use_enable odbc sql mod)"
  310 + if use odbc ; then
  311 + local odbc_lib="unixodbc"
  312 + if use iodbc ; then
  313 + odbc_lib="iodbc"
  314 + append-cppflags -I/usr/include/iodbc
  315 + fi
  316 + myconf="${myconf} --with-odbc=${odbc_lib}"
  317 + fi
  318 +
  319 + # slapd options
  320 + myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
  321 + myconf="${myconf} $(use_enable samba lmpasswd) $(use_enable syslog)"
  322 + if use experimental ; then
  323 + myconf="${myconf} --enable-dynacl"
  324 + myconf="${myconf} --enable-aci=mod"
  325 + fi
  326 + for option in aci cleartext modules rewrite rlookups slapi; do
  327 + myconf="${myconf} --enable-${option}"
  328 + done
  329 +
  330 + # slapd overlay options
  331 + # Compile-in the syncprov, the others as module
  332 + myconf="${myconf} --enable-syncprov=yes"
  333 + use overlays && myconf="${myconf} --enable-overlays=mod"
  334 +
  335 + else
  336 + myconf="${myconf} --disable-slapd --disable-bdb --disable-hdb"
  337 + myconf="${myconf} --disable-overlays --disable-syslog"
  338 + fi
  339 +
  340 + # basic functionality stuff
  341 + myconf="${myconf} $(use_enable ipv6)"
  342 + myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)"
  343 + myconf="${myconf} $(use_enable tcpd wrappers)"
  344 +
  345 + local ssl_lib="no"
  346 + if use ssl || ( use ! minimal && use samba ) ; then
  347 + ssl_lib="openssl"
  348 + use gnutls && ssl_lib="gnutls"
  349 + fi
  350 +
  351 + myconf="${myconf} --with-tls=${ssl_lib}"
  352 +
  353 + for basicflag in dynamic local proctitle shared static; do
  354 + myconf="${myconf} --enable-${basicflag}"
  355 + done
  356 +
  357 + tc-export CC AR CXX
  358 + STRIP=/bin/true \
  359 + econf \
  360 + --libexecdir=/usr/$(get_libdir)/openldap \
  361 + ${myconf} || die "econf failed"
  362 +}
  363 +
  364 +src_configure_cxx() {
  365 + # This needs the libraries built by the first build run.
  366 + # So we have to run it AFTER the main build, not just after the main
  367 + # configure.
  368 + if ! use minimal ; then
  369 + if use cxx ; then
  370 + local myconf_ldapcpp
  371 + myconf_ldapcpp="${myconf_ldapcpp} --with-ldap-includes=../../include"
  372 + cd "${S}/contrib/ldapc++"
  373 + OLD_LDFLAGS="$LDFLAGS"
  374 + OLD_CPPFLAGS="$CPPFLAGS"
  375 + append-ldflags -L../../libraries/liblber/.libs -L../../libraries/libldap/.libs
  376 + append-ldflags -L../../../libraries/liblber/.libs -L../../../libraries/libldap/.libs
  377 + append-cppflags -I../../../include
  378 + econf ${myconf_ldapcpp} \
  379 + CC="${CC}" \
  380 + CXX="${CXX}" \
  381 + || die "econf ldapc++ failed"
  382 + CPPFLAGS="$OLD_CPPFLAGS"
  383 + LDFLAGS="${OLD_LDFLAGS}"
  384 + fi
  385 + fi
  386 +}
  387 +
  388 +multilib-native_src_compile_internal() {
  389 + emake depend || die "emake depend failed"
  390 + emake CC="${CC}" AR="${AR}" || die "emake failed"
  391 + lt="${S}/libtool"
  392 + export echo="echo"
  393 +
  394 + if ! use minimal ; then
  395 + if use cxx ; then
  396 + einfo "Building contrib library: ldapc++"
  397 + src_configure_cxx
  398 + cd "${S}/contrib/ldapc++"
  399 + emake \
  400 + CC="${CC}" CXX="${CXX}" \
  401 + || die "emake ldapc++ failed"
  402 + fi
  403 +
  404 + if use smbkrb5passwd ; then
  405 + einfo "Building contrib-module: smbk5pwd"
  406 + cd "${S}/contrib/slapd-modules/smbk5pwd"
  407 +
  408 + emake \
  409 + DEFS="-DDO_SAMBA -DDO_KRB5" \
  410 + KRB5_INC="$(krb5-config --cflags)" \
  411 + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" \
  412 + || die "emake smbk5pwd failed"
  413 + fi
  414 +
  415 + if use kerberos ; then
  416 + cd "${S}/contrib/slapd-modules/passwd"
  417 + einfo "Compiling contrib-module: pw-kerberos"
  418 + "${lt}" --mode=compile --tag=CC \
  419 + "${CC}" \
  420 + -I../../../include \
  421 + ${CFLAGS} \
  422 + $(krb5-config --cflags) \
  423 + -DHAVE_KRB5 \
  424 + -o kerberos.lo \
  425 + -c kerberos.c || die "compiling pw-kerberos failed"
  426 + einfo "Linking contrib-module: pw-kerberos"
  427 + "${lt}" --mode=link --tag=CC \
  428 + "${CC}" -module \
  429 + ${CFLAGS} \
  430 + ${LDFLAGS} \
  431 + -rpath /usr/$(get_libdir)/openldap/openldap \
  432 + -o pw-kerberos.la \
  433 + kerberos.lo || die "linking pw-kerberos failed"
  434 + fi
  435 + # We could build pw-radius if GNURadius would install radlib.h
  436 + cd "${S}/contrib/slapd-modules/passwd"
  437 + einfo "Compiling contrib-module: pw-netscape"
  438 + "${lt}" --mode=compile --tag=CC \
  439 + "${CC}" \
  440 + -I../../../include \
  441 + ${CFLAGS} \
  442 + -o netscape.lo \
  443 + -c netscape.c || die "compiling pw-netscape failed"
  444 + einfo "Linking contrib-module: pw-netscape"
  445 + "${lt}" --mode=link --tag=CC \
  446 + "${CC}" -module \
  447 + ${CFLAGS} \
  448 + ${LDFLAGS} \
  449 + -rpath /usr/$(get_libdir)/openldap/openldap \
  450 + -o pw-netscape.la \
  451 + netscape.lo || die "linking pw-netscape failed"
  452 +
  453 + build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
  454 + build_contrib_module "allop" "allop.c" "overlay-allop"
  455 + build_contrib_module "allowed" "allowed.c" "allowed"
  456 + build_contrib_module "autogroup" "autogroup.c" "autogroup"
  457 + build_contrib_module "denyop" "denyop.c" "denyop-overlay"
  458 + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
  459 + # lastmod may not play well with other overlays
  460 + build_contrib_module "lastmod" "lastmod.c" "lastmod"
  461 + build_contrib_module "nops" "nops.c" "nops-overlay"
  462 + build_contrib_module "trace" "trace.c" "trace"
  463 + # build slapi-plugins
  464 + cd "${S}/contrib/slapi-plugins/addrdnvalues"
  465 + einfo "Building contrib-module: addrdnvalues plugin"
  466 + "${CC}" -shared \
  467 + -I../../../include \
  468 + ${CFLAGS} \
  469 + -fPIC \
  470 + ${LDFLAGS} \
  471 + -o libaddrdnvalues-plugin.so \
  472 + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
  473 +
  474 + fi
  475 +}
  476 +
  477 +src_test() {
  478 + cd tests ; make tests || die "make tests failed"
  479 +}
  480 +
  481 +multilib-native_src_install_internal() {
  482 + lt="${S}/libtool"
  483 + emake DESTDIR="${D}" install || die "make install failed"
  484 +
  485 + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
  486 + docinto rfc ; dodoc doc/rfc/*.txt
  487 +
  488 + # openldap modules go here
  489 + # TODO: write some code to populate slapd.conf with moduleload statements
  490 + keepdir /usr/$(get_libdir)/openldap/openldap/
  491 +
  492 + # initial data storage dir
  493 + keepdir /var/lib/openldap-data
  494 + fowners ldap:ldap /var/lib/openldap-data
  495 + fperms 0700 /var/lib/openldap-data
  496 +
  497 + echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
  498 + echo "# do NOT delete this. it is used" >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
  499 + echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
  500 +
  501 + # change slapd.pid location in configuration file
  502 + keepdir /var/run/openldap
  503 + fowners ldap:ldap /var/run/openldap
  504 + fperms 0755 /var/run/openldap
  505 +
  506 + if ! use minimal; then
  507 + # use our config
  508 + rm "${D}"etc/openldap/slapd.conf
  509 + insinto /etc/openldap
  510 + newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
  511 + configfile="${D}"etc/openldap/slapd.conf
  512 +
  513 + # populate with built backends
  514 + ebegin "populate config with built backends"
  515 + for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
  516 + elog "Adding $(basename ${x})"
  517 + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
  518 + done
  519 + sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
  520 + fowners root:ldap /etc/openldap/slapd.conf
  521 + fperms 0640 /etc/openldap/slapd.conf
  522 + cp "${configfile}" "${configfile}".default
  523 + eend
  524 +
  525 + # install our own init scripts
  526 + newinitd "${FILESDIR}"/slapd-initd2 slapd
  527 + newconfd "${FILESDIR}"/slapd-confd slapd
  528 + if [ $(get_libdir) != lib ]; then
  529 + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/slapd
  530 + fi
  531 +
  532 + if use cxx ; then
  533 + einfo "Install the ldapc++ library"
  534 + cd "${S}/contrib/ldapc++"
  535 + emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install || die "emake install ldapc++ failed"
  536 + newdoc README ldapc++-README
  537 + fi
  538 +
  539 + if use smbkrb5passwd ; then
  540 + einfo "Install the smbk5pwd module"
  541 + cd "${S}/contrib/slapd-modules/smbk5pwd"
  542 + emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install || die "emake install smbk5pwd failed"
  543 + newdoc README smbk5pwd-README
  544 + fi
  545 +
  546 + einfo "Installing contrib modules"
  547 + cd "${S}/contrib/slapd-modules"
  548 + for l in */*.la; do
  549 + "${lt}" --mode=install cp ${l} \
  550 + "${D}"usr/$(get_libdir)/openldap/openldap || \
  551 + die "installing ${l} failed"
  552 + done
  553 + docinto contrib
  554 + newdoc addpartial/README addpartial-README
  555 + newdoc allop/README allop-README
  556 + doman allop/slapo-allop.5
  557 + newdoc autogroup/README autogroup-README
  558 + newdoc denyop/denyop.c denyop-denyop.c
  559 + newdoc dsaschema/README dsaschema-README
  560 + doman lastmod/slapo-lastmod.5
  561 + doman nops/slapo-nops.5
  562 + newdoc passwd/README passwd-README
  563 + cd "${S}/contrib/slapi-plugins"
  564 + insinto /usr/$(get_libdir)/openldap/openldap
  565 + doins */*.so
  566 + docinto contrib
  567 + newdoc addrdnvalues/README addrdnvalues-README
  568 + fi
  569 +}
  570 +
  571 +multilib-native_pkg_preinst_internal() {
  572 + # keep old libs if any
  573 + preserve_old_lib usr/$(get_libdir)/{libldap,libldap_r,liblber}-2.3.so.0
  574 +}
  575 +
  576 +multilib-native_pkg_postinst_internal() {
  577 + if ! use minimal ; then
  578 + # You cannot build SSL certificates during src_install that will make
  579 + # binary packages containing your SSL key, which is both a security risk
  580 + # and a misconfiguration if multiple machines use the same key and cert.
  581 + if use ssl; then
  582 + install_cert /etc/openldap/ssl/ldap
  583 + chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
  584 + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
  585 + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
  586 + ewarn "add 'TLS_REQCERT never' if you want to use them."
  587 + fi
  588 +
  589 + # These lines force the permissions of various content to be correct
  590 + chown ldap:ldap "${ROOT}"var/run/openldap
  591 + chmod 0755 "${ROOT}"var/run/openldap
  592 + chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
  593 + chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
  594 + chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm}
  595 + fi
  596 +
  597 + elog "Getting started using OpenLDAP? There is some documentation available:"
  598 + elog "Gentoo Guide to OpenLDAP Authentication"
  599 + elog "(http://www.gentoo.org/doc/en/ldap-howto.xml)"
  600 + elog "---"
  601 + elog "An example file for tuning BDB backends with openldap is"
  602 + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
  603 +
  604 + preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0
  605 +}

0 comments on commit 81237ba

Please sign in to comment.
Something went wrong with that request. Please try again.