LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Openvpn in Slackware -curent: easy-rsa scripts missing (https://www.linuxquestions.org/questions/slackware-14/openvpn-in-slackware-curent-easy-rsa-scripts-missing-4175460130/)

xj25vm 04-30-2013 05:27 AM

Openvpn in Slackware -curent: easy-rsa scripts missing
 
According to:

http://openvpn.net/index.php/open-source/downloads.html

the easy-rsa scripts have been moved out of the main openvpn download into their own package. As a consequence of this (I'm assuming), the easy-rsa scripts have disappeared from -current as well (I think they used to be in /usr/share/doc/openvpn). I always rely on the easy-rsa scripts to create a new CA and to manage the client certificates and keys when rolling a new openvpn installation. It would be nice if they could find their way back into Slackware. Then again - I don't have any statistics to hand - maybe not many other people are using them?

fskmh 04-30-2013 08:48 AM

1 Attachment(s)
Here's a patch for the SlackBuild in -current (also attached as a text file):

Code:

--- openvpn.SlackBuild  2013-04-30 15:38:18.000000000 +0200                                                                                                                                                   
+++ openvpn.SlackBuild  2013-04-30 15:33:42.000000000 +0200                                                                                                                                                   
@@ -23,7 +23,7 @@                                                                                                                                                                                             
                                                                                                                                                                                                             
                                                                                                                                                                                                             
 PKGNAM=openvpn                                                                                                                                                                                               
-VERSION=2.3.1                                                                                                                                                                                               
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}                                                                                                                   
 BUILD=${BUILD:-1}                                                                                                                                                                                           
                                                                                                                                                                                                             
 # Automatically determine the architecture we're building on:                                                                                                                                               
@@ -38,6 +38,19 @@                                                                                                                                                                                           
                                                                                                                                                                                                             
 NUMJOBS=${NUMJOBS:-" -j7 "}                                                                                                                                                                                 
                                                                                                                                                                                                             
+CWD=$(pwd)                                                                                                                                                                                                   
+TMP=${TMP:-/tmp}                                                                                                                                                                                             
+PKG=$TMP/package-$PKGNAM                                                                                                                                                                                     
+                                                                                                                                                                                                             
+# Download the easy-rsa Git head if there's no tarball:                                                                                                                                                     
+if ! /bin/ls $CWD/easy-rsa*tar* 1> /dev/null 2> /dev/null ; then                                                                                                                                             
+  git clone https://github.com/OpenVPN/easy-rsa.git                                                                                                                                                         
+  rm -r easy-rsa/.git*                                                                                                                                                                                       
+  tar cf easy-rsa-$(date +%Y%m%d).tar easy-rsa                                                                                                                                                               
+  xz -9 easy-rsa-$(date +%Y%m%d).tar                                                                                                                                                                         
+  rm -r $CWD/easy-rsa                                                                                                                                                                                       
+fi                                                                                                                                                                                                           
+                                                                                                                                                                                                             
 if [ "$ARCH" = "i486" ]; then                                                                                                                                                                               
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"                                                                                                                                                                   
  LIBDIRSUFFIX=""
@@ -52,13 +65,14 @@
  LIBDIRSUFFIX=""
 fi
 
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PKGNAM
-
 rm -rf $PKG
 mkdir -p $TMP $PKG
 cd $TMP
+
+if [ -z $VERSION ]; then
+    echo "Could not parse version of tarball."
+    exit 1
+fi
 rm -rf $PKGNAM-$VERSION
 tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
 cd $PKGNAM-$VERSION || exit 1
@@ -112,12 +126,6 @@
 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 .
-)
-
 if [ -d $PKG/usr/man ]; then
 ( cd $PKG/usr/man
  find . -type f -exec gzip -9 {} \;
@@ -126,10 +134,15 @@
 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 COPY* INSTALL* PORTS README* sample/sample* \
  $PKG/usr/doc/$PKGNAM-$VERSION
 
+# 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 .
+)
+
 # 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
@@ -138,9 +151,18 @@
  touch -r ChangeLog $DOCSDIR/ChangeLog
 fi
 
+# Package easy-rsa stuff
+cd $TMP
+rm -rf easy-rsa
+tar xvf $CWD/easy-rsa-$(date +%Y%m%d).tar.xz || exit 1
+cd easy-rsa || exit 1
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a easy-rsa $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a COPY* READ* $PKG/usr/doc/$PKGNAM-$VERSION/easy-rsa
+
 mkdir -p $PKG/install
 cat $CWD/slack-desc > $PKG/install/slack-desc
 
 cd $PKG
 /sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
-


xj25vm 04-30-2013 08:56 AM

Brilliant! Thanks. Is this likely to make its way into Slackware - or just to be used as a one off?

fskmh 04-30-2013 09:06 AM

I suspect that Pat might be inclined to have a look because the changes in the last release also affect the sample files that usually go into /usr/doc/openvpn-x.y.z
Let's see what he decides to do. ;-)

xj25vm 06-25-2014 07:24 AM

Bump

I notice that the easy-rsa scripts are still missing in -current. Is anything being done to bring them back?

xj25vm 02-01-2016 01:57 PM

bump

Any chance of the Easy-RSA scripts making it back into Slackware? They are the main way to generate the CA's and server and client certificates for OpenVPN - and the OpenVPN community is still offering and maintaining them here: https://github.com/OpenVPN/easy-rsa

xj25vm 11-03-2016 03:52 AM

Another bump - may Pat or someone else will notice this thread


All times are GMT -5. The time now is 06:21 PM.