[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | #DEP:openldap |
---|
| 3 | #ftp://ftp.padl.com/pub/nss_ldap.tgz |
---|
| 4 | #daar staat de source |
---|
| 5 | # Doe wat standaardzooi... |
---|
| 6 | CWD=`pwd` |
---|
| 7 | VERSION=265 |
---|
| 8 | rm -rf pkgtmp |
---|
| 9 | mkdir pkgtmp |
---|
| 10 | cd pkgtmp |
---|
| 11 | PKGROOT=`pwd`; |
---|
| 12 | cd .. |
---|
| 13 | PGMDIR=`find . -type d -maxdepth 1 | grep nss_ldap` |
---|
| 14 | PGM=`ls *.tar.gz | grep nss_ldap | grep -v DatuX | sed -e 's/.tar.gz//'` |
---|
| 15 | rm -rf $PGMDIR |
---|
| 16 | #export CPPFLAGS="-I/usr/include/db4" LDFLAGS="-L/usr/lib" |
---|
| 17 | |
---|
| 18 | # source tarball uitpakken... |
---|
| 19 | echo "Bezig met uitpakken..." |
---|
| 20 | tar -xzf $PGM.tar.gz || exit 1 |
---|
| 21 | PGMDIR=`find . -type d -maxdepth 1 | grep nss_ldap` || exit 1 |
---|
| 22 | cd $PGMDIR || exit 1 |
---|
| 23 | |
---|
| 24 | # Debian patches |
---|
| 25 | for PATCH in `cat $CWD/patches/series`; do |
---|
| 26 | patch -p1 < $CWD/patches/$PATCH || exit 1 |
---|
| 27 | done |
---|
| 28 | |
---|
| 29 | # Configure script runnen... |
---|
| 30 | echo "Uitvoeren van configure..." |
---|
| 31 | ./configure --sysconfdir=/etc \ |
---|
| 32 | --prefix=/ \ |
---|
| 33 | --bindir=/usr/bin \ |
---|
| 34 | --sbindir=/usr/sbin \ |
---|
| 35 | --localstatedir=/var \ |
---|
| 36 | --with-ldap-lib=openldap \ |
---|
| 37 | --with-ldap-conf-file=/etc/ldap.conf \ |
---|
| 38 | --with-ldap-secret-file=/etc/ldap.secret \ |
---|
| 39 | --enable-schema-mapping || exit 1 |
---|
| 40 | # compile de source... |
---|
| 41 | echo "Uitvoeren van make..." |
---|
| 42 | PATH=$PATH:. |
---|
| 43 | make || exit 1 |
---|
| 44 | # installeer alles in een tijdelijke root... |
---|
| 45 | echo "Make install..." |
---|
| 46 | mkdir -p $PKGROOT/lib |
---|
| 47 | make DESTDIR="$PKGROOT" install || exit 1 |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | # En maak er uiteindelijk een package van en ruim alle zooi op... |
---|
| 51 | echo "Package maken..." |
---|
| 52 | cd "$PKGROOT" && |
---|
| 53 | #strippen van onodige data |
---|
| 54 | find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
---|
| 55 | find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
---|
| 56 | |
---|
| 57 | mkdir $PKGROOT/etc |
---|
| 58 | #default config file aanpassen |
---|
| 59 | mv etc/ldap.conf etc/ldap.conf-default-ssl_ldap |
---|
| 60 | cp ../nsswitch.conf etc |
---|
| 61 | chown root:root etc/nsswitch.conf |
---|
| 62 | chmod 644 etc/nsswitch.conf |
---|
| 63 | #makepkg -l n $PGMDIR-1DatuX.tgz 1> /dev/null && |
---|
| 64 | #makepkg -l y -c n $PGMDIR-`arch`-1DatuX.tgz 1> /dev/null && |
---|
| 65 | #mv -f *.tgz .. && |
---|
| 66 | NAME=`echo $0|cut -f2 -d'.'` |
---|
| 67 | makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && |
---|
| 68 | echo $VERSION > $CWD/$NAME.version && |
---|
| 69 | arch > $CWD/$NAME.arch && |
---|
| 70 | |
---|
| 71 | cd .. && |
---|
| 72 | rm -rf $PGMDIR $PKGROOT |
---|