SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "nss_ldap"

# SliTaz package receipt.

PACKAGE="nss_ldap"
VERSION="265"
CATEGORY="system-tools"
SHORT_DESC="Get users, hosts, and groups from LDAP."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://web.archive.org/web/20181221041632/https://www.padl.com/OSS/nss_ldap.html"
WGET_URL="https://fossies.org/linux/privat/old/$TARBALL"

DEPENDS="cyrus-sasl libkrb5 libldap openssl libcomerr libcomerr3"
BUILD_DEPENDS="openldap-dev perl"

# What is the latest version available today?
current_version()
{
    wget -O - https://raw.githubusercontent.com/PADL/nss_ldap/master/ChangeLog 2>/dev/null | \
    sed '/^[0-9]/!d;s|[\t ].*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    ./vers_string -v
    ./configure --prefix=/usr --infodir=/usr/share/info \
    --enable-rfc2307bis --enable-schema-mapping --enable-paged-results \
    --sysconfdir=/etc --mandir=/usr/share/man $CONFIGURE_ARGS &&
    make $MAKEFLAGS &&
    make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr $fs/etc
    cp -a $install/usr/lib $fs/usr
    cp -a $install/etc $fs
}

post_install()
{
    if [ -s "$1/etc/openldap/slapd.conf" ]; then
        suffix=$(awk '/^suffix/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
        rootdn=$(awk '/^rootdn/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
        rootpw=$(awk '/^rootpw/ { print $2 }' < "$1/etc/openldap/slapd.conf")
        sed -i -e "s|binddn .*|binddn $rootdn|" \
               -e "s|bindpw .*|bindpw $rootpw|" \
               -e "s|dc=padl,dc=com|$suffix|g" "$1/etc/ldap.conf"
        cat <<EOT
------
Suffix login DN and password are found in /etc/openldap/slapd.conf with suffix, rootdn and rootpw keywords:
$(grep ^suffix /etc/openldap/slapd.conf)
$(grep ^rootdn /etc/openldap/slapd.conf)
$(grep ^rootpw /etc/openldap/slapd.conf)
------
EOT
    fi
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)