net-nds/openldap: added sha2 contrib support pre bug 621670 and pr \#4973
authorMatthew Thode <prometheanfire@gentoo.org>
Fri, 23 Jun 2017 16:33:38 +0000 (11:33 -0500)
committerMatthew Thode <prometheanfire@gentoo.org>
Fri, 23 Jun 2017 16:34:27 +0000 (11:34 -0500)
Package-Manager: Portage-2.3.6, Repoman-2.3.2

net-nds/openldap/metadata.xml
net-nds/openldap/openldap-2.4.45.ebuild

index cda62a661593c6b89ee1ab8b13107ab7bbe073c5..4e5e2c49039f261d2891b112fa03116607e36f53 100644 (file)
@@ -4,7 +4,7 @@
     <maintainer type="project">
         <email>ldap-bugs@gentoo.org</email>
     </maintainer>
-       <use> 
+       <use>
                <flag name="experimental">Enable experimental backend options</flag>
                <flag name="kinit">Enable support for kerberos init</flag>
                <flag name="odbc">Enable ODBC and SQL backend options</flag>
@@ -13,6 +13,7 @@
                        lanman passwords</flag>
                <flag name="minimal">Build libraries &amp; userspace tools only. Does not install any server code.</flag>
                <flag name="pbkdf2">Enable support for pbkdf2 passwords</flag>
+               <flag name="sha2">Enable support for pw-sha2 password hashes.</flag>
        </use>
        <upstream>
                <remote-id type="cpe">cpe:/a:openldap:openldap</remote-id>
index b2493271ba45a49ba0c2d15a47500c2cc88472dc..e81d3543054cba97f780fb0488ac111f0208d5f4 100644 (file)
@@ -24,7 +24,7 @@ IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
 IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
@@ -618,6 +618,33 @@ multilib_src_compile() {
                                pbkdf2.lo || die "linking pw-pbkdf2 failed"
                fi
 
+               if use sha2 ; then
+                       cd "${S}/contrib/slapd-modules/passwd/sha2" || die
+                       einfo "Compiling contrib-module: pw-sha2"
+                       "${lt}" --mode=compile --tag=CC \
+                               "${CC}" \
+                               -I"${BUILD_DIR}"/include \
+                               -I../../../../include \
+                               ${CFLAGS} \
+                               -o sha2.lo \
+                               -c sha2.c || die "compiling pw-sha2 failed"
+                       "${lt}" --mode=compile --tag=CC \
+                               "${CC}" \
+                               -I"${BUILD_DIR}"/include \
+                               -I../../../../include \
+                               ${CFLAGS} \
+                               -o slapd-sha2.lo \
+                               -c slapd-sha2.c || die "compiling pw-sha2 failed"
+                       einfo "Linking contrib-module: pw-sha2"
+                       "${lt}" --mode=link --tag=CC \
+                               "${CC}" -module \
+                               ${CFLAGS} \
+                               ${LDFLAGS} \
+                               -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+                               -o pw-sha2.la \
+                               sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+               fi
+
                # We could build pw-radius if GNURadius would install radlib.h
                cd "${S}/contrib/slapd-modules/passwd" || die
                einfo "Compiling contrib-module: pw-netscape"