#!/bin/bash #DEP:Linux_PAM #DEP:openldap #http://www.pdc.kth.se/heimdal/ #daar staat de source # Doe wat standaardzooi... CWD=`pwd` NAME=pam_ldap VERSION=186 ROOT=`pwd`; rm -rf pkgtmp mkdir pkgtmp cd pkgtmp PKGROOT=`pwd`; cd .. PGMDIR=`find . -type d -maxdepth 1 | grep pam_ldap` PGM=`ls *.tgz | grep pam_ldap | grep -v DatuX | sed -e 's/.tgz//'` rm -rf $PGMDIR export CPPFLAGS="-I/usr/include/db4" LDFLAGS="-L/usr/lib" # source tarball uitpakken... echo "Bezig met uitpakken..." echo "tar -xzf $PGM.tar.gz" tar -xzf $PGM.tgz && PGMDIR=`find . -type d -maxdepth 1 | grep pam_ldap` cd $PGMDIR && # Configure script runnen... echo "Uitvoeren van configure..." ./configure --sysconfdir=/etc \ --prefix=/ \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --localstatedir=/var \ --with-ldap-conf-file=/etc/ldap.conf \ --with-ldap-secret-file=/etc/ldap.secret \ --with-ldap-lib=openldap || exit 1 # compile de source... echo "Uitvoeren van make..." make || exit 1 # installeer alles in een tijdelijke root... echo "Make install..." make DESTDIR="$PKGROOT" install || exit 1 # En maak er uiteindelijk een package van en ruim alle zooi op... echo "Package maken..." cd "$PKGROOT" && #strippen van onodige data find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null #default config file moven mv etc/ldap.conf etc/ldap.conf-default-pam_ldap #onze standaart config file copieeren cp $ROOT/ldap.conf $PKGROOT/etc cp $ROOT/ldap.secret $PKGROOT/etc mkdir -p etc/pam.d cp $ROOT/other $PKGROOT/etc/pam.d #maak alle configfiles eindigend op .new find $PKGROOT/etc -follow -type f -exec mv "{}" "{}.new" \; || exit 1 #doinst mkdir $PKGROOT/install cat < $PKGROOT/install/doinst.sh mv etc/ldap.conf.new etc/ldap.conf EOF #makepkg -l y -c n $PGMDIR-`arch`-1DatuX.tgz 1> /dev/null && makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && echo $VERSION > $CWD/$NAME.version && arch > $CWD/$NAME.arch && #mv -f *.tgz .. && cd .. && rm -rf $PGMDIR $PKGROOT