# SliTaz package receipt.

PACKAGE="cyrus-sasl-pam"
VERSION="2.1.23"
CATEGORY="network"
SHORT_DESC="SASL authentication server using PAM."
MAINTAINER="pascal.bellard@slitaz.org"
SOURCE="cyrus-sasl"
TARBALL="$SOURCE-$VERSION.tar.gz"
WEB_SITE="http://cyrusimap.web.cmu.edu/"
WGET_URL="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/$TARBALL"
DEPENDS="libldap openssl libdb pam libkrb5 libcomerr3"
BUILD_DEPENDS="openldap-dev pam pam-dev openssl-dev"
PROVIDE="cyrus-sasl:pam"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	./configure --prefix=/usr --infodir=/usr/share/info \
	--with-ldap=/usr --with-pam=/usr --with-devrandom=/dev/urandom \
	--mandir=/usr/share/man $CONFIGURE_ARGS
	sed -i 's/WITH_DES/WITH_DES 1/' config.h
	make &&
	make -j1 DESTDIR=$PWD/_pkg install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib/sasl2 $fs/var/state/saslauthd
	cp -a $_pkg/usr/sbin $fs/usr
	cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
	cp -a $_pkg/usr/lib/sasl2/*.so* $fs/usr/lib/sasl2
	cp -a ../$SOURCE/stuff/etc $fs
	sed -i 's/shadow/pam/' $fs/etc/init.d/cyrus-sasl
}