diff options
Diffstat (limited to 'source/n/openvpn/openvpn.SlackBuild')
-rwxr-xr-x | source/n/openvpn/openvpn.SlackBuild | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/source/n/openvpn/openvpn.SlackBuild b/source/n/openvpn/openvpn.SlackBuild index cb9efc4f0..c8457f9d3 100755 --- a/source/n/openvpn/openvpn.SlackBuild +++ b/source/n/openvpn/openvpn.SlackBuild @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # Copyright 2006, Alan Hicks, Lizella, GA -# Copyright 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010, 2011, 2013, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,10 +21,11 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) PKGNAM=openvpn VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -36,6 +37,14 @@ if [ -z "$ARCH" ]; then esac fi +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + NUMJOBS=${NUMJOBS:-" -j7 "} if [ "$ARCH" = "i586" ]; then @@ -52,7 +61,6 @@ else LIBDIRSUFFIX="" fi -CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM @@ -84,9 +92,8 @@ CXXFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/openvpn-${VERSION} \ --enable-lzo \ --enable-iproute2 \ - --enable-password-save \ --disable-plugin-auth-pam \ - --build=$ARCH-slackware-linux + --build=$ARCH-slackware-linux || exit 1 make $NUMJOBS || make || exit 1 make install-strip DESTDIR=$PKG || exit 1 @@ -97,26 +104,33 @@ mkdir -p $PKG/etc/openvpn/{certs,keys} chown root:nobody $PKG/etc/openvpn/{certs,keys} chmod 750 $PKG/etc/openvpn/{certs,keys} -# Install a reasonably generic sample config file: -cp -a $CWD/openvpn.conf.sample $PKG/etc/openvpn/openvpn.conf.sample -chmod 644 $PKG/etc/openvpn/openvpn.conf.sample +# Install a startup script: +mkdir -p $PKG/etc/rc.d +cp -a $CWD/rc.openvpn $PKG/etc/rc.d/rc.openvpn.new +chmod 644 $PKG/etc/rc.d/rc.openvpn.new +chown root:root $PKG/etc/rc.d/rc.openvpn.new # Let folks know about the other configs, if they haven't found them. # They might even find the documentation there useful. ;-) cat << EOF > $PKG/etc/openvpn/README.TXT -Have a look in /usr/doc/$PKGNAM-$VERSION/sample-config-files -for some more examples of how to configure OpenVPN. You'll -need to add something to your /etc/rc.d/rc.local to start -OpenVPN, as well as to tell it where to find its config file. +One or more OpenVPN config files should be installed in this directory +as files ending in ".conf" (i.e. client.conf, server.conf, etc.). + +Have a look in sample-config-files for some more examples of how to +configure OpenVPN. + +To start OpenVPN, use this command as root: +sh /etc/rc.d/rc.openvpn start +To make OpenVPN start automatically at boot, change the script permissions: +chmod 755 /etc/rc.d/rc.openvpn See "man openvpn" and the other docs for more information. EOF # Add a link, too: -mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files -( cd $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files - ln -sf /etc/openvpn/openvpn.conf.sample . +( cd $PKG/etc/openvpn + ln -sf /usr/doc/$PKGNAM-$VERSION/sample-config-files . ) if [ -d $PKG/usr/man ]; then @@ -127,10 +141,17 @@ if [ -d $PKG/usr/man ]; then fi mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION -cp -a AUTHORS COPYING* COPYRIGHT.GPL INSTALL INSTALL-win32.txt \ - NEWS PORTS README* sample-config-files sample-keys sample-scripts easy-rsa \ +cp -a AUTHORS COPYING* COPYRIGHT* INSTALL* \ + NEWS PORTS README* sample/sample-config-files sample/sample-keys sample/sample-scripts \ $PKG/usr/doc/$PKGNAM-$VERSION +# Install a reasonably generic sample config file: +# (put this in with the other samples) +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files +cp -a $CWD/slackware.conf $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files +chown root:root $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files/slackware.conf +chmod 644 $PKG/usr/doc/$PKGNAM-$VERSION/sample-config-files/slackware.conf + # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: if [ -r ChangeLog ]; then @@ -140,6 +161,7 @@ if [ -r ChangeLog ]; then fi mkdir -p $PKG/install +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG |