#!/bin/sh ############################# ## Build script for: openvpn ## Creator: jmedina@tuxjm.net ## Date: 27 Dic 04 ## Builds package: Yes ## Source location: openvpn.sourceforge.net ## Build script version: 1 ## Requirements: None ## ## Notes: Any special notes the person may need to edit this file. ## ## Changelog: ## 04/19/2005 Updated to 2.0 ## 08/26/2005 Updated to 2.0.2 ## 28/04/2006 Updated to 2.0.6 # Set initial variables CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-openvpn NAME=openvpn VERSION=2.0.6 ARCH=${ARCH:-i486} BUILD=1jm if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf ${NAME}-${VERSION} tar xvzf ${CWD}/${NAME}-${VERSION}.tar.gz cd ${TMP}/${NAME}-${VERSION} chown -R root.root . find . -perm 777 -exec chmod 755 {} \; CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-iproute2 \ --enable-dependency-tracking make make install DESTDIR=$PKG gzip -9 $PKG/usr/man/man?/*.? chown -R root.bin ${PKG}/usr/sbin mkdir -p $PKG/usr/doc/${NAME}-${VERSION} cp -a AUTHORS ChangeLog COPYING COPYRIGHT.GPL INSTALL INSTALL-win32.txt \ NEWS openvpn.spec PORTS README \ $PKG/usr/doc/${NAME}-${VERSION} cp -a contrib/ easy-rsa/ management/ sample-* \ $PKG/usr/doc/${NAME}-${VERSION} install -c -d -m 755 ${PKG}/etc/${NAME} install -c -d -m 755 ${PKG}/etc/rc.d install -c -m 755 ${CWD}/${NAME}.init ${PKG}/etc/rc.d/rc.openvpn ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n ${TMP}/${NAME}-${VERSION}-${ARCH}-${BUILD}.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf ${TMP}/${NAME}-$VERSION rm -rf $PKG fi