#!/bin/bash #DEP:openldap #ftp://ftp.padl.com/pub/nss_ldap.tgz #daar staat de source # Doe wat standaardzooi... CWD=`pwd` VERSION=265 rm -rf pkgtmp mkdir pkgtmp cd pkgtmp PKGROOT=`pwd`; cd .. PGMDIR=`find . -type d -maxdepth 1 | grep nss_ldap` PGM=`ls *.tar.gz | grep nss_ldap | grep -v DatuX | sed -e 's/.tar.gz//'` rm -rf $PGMDIR #export CPPFLAGS="-I/usr/include/db4" LDFLAGS="-L/usr/lib" # source tarball uitpakken... echo "Bezig met uitpakken..." tar -xzf $PGM.tar.gz || exit 1 PGMDIR=`find . -type d -maxdepth 1 | grep nss_ldap` || exit 1 cd $PGMDIR || exit 1 # Debian patches for PATCH in `cat $CWD/patches/series`; do patch -p1 < $CWD/patches/$PATCH || exit 1 done # Configure script runnen... echo "Uitvoeren van configure..." ./configure --sysconfdir=/etc \ --prefix=/ \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --localstatedir=/var \ --with-ldap-lib=openldap \ --with-ldap-conf-file=/etc/ldap.conf \ --with-ldap-secret-file=/etc/ldap.secret \ --enable-schema-mapping || exit 1 # compile de source... echo "Uitvoeren van make..." PATH=$PATH:. make || exit 1 # installeer alles in een tijdelijke root... echo "Make install..." mkdir -p $PKGROOT/lib 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 mkdir $PKGROOT/etc #default config file aanpassen mv etc/ldap.conf etc/ldap.conf-default-ssl_ldap cp ../nsswitch.conf etc chown root:root etc/nsswitch.conf chmod 644 etc/nsswitch.conf #makepkg -l n $PGMDIR-1DatuX.tgz 1> /dev/null && #makepkg -l y -c n $PGMDIR-`arch`-1DatuX.tgz 1> /dev/null && #mv -f *.tgz .. && NAME=`echo $0|cut -f2 -d'.'` makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && echo $VERSION > $CWD/$NAME.version && arch > $CWD/$NAME.arch && cd .. && rm -rf $PGMDIR $PKGROOT