Index: npl/system/openssl/openssl.SlackBuild.orig
===================================================================
--- npl/system/openssl/openssl.SlackBuild.orig	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl.SlackBuild.orig	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/bash
 
 # Copyright 2000 BSDi, Inc. Concord, CA, USA
 # Copyright 2001, 2002 Slackware Linux, Inc.  Concord, CA, USA
-# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014  Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2018  Patrick J. Volkerding, Sebeka, MN, USA
 # All rights reserved.
 #
@@ -23,11 +23,11 @@
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
 # Set initial variables:
-CWD=$(pwd)
+cd $(dirname $0) ; CWD=$(pwd)
 TMP=${TMP:-/tmp}
 
+PKGNAM=openssl
 VERSION=${VERSION:-$(echo openssl-*.tar.gz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
 
 # Automatically determine the architecture we're building on:
@@ -46,7 +46,15 @@
 NAME2=openssl-solibs-$VERSION-$ARCH-$BUILD
 
+# 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 "${NAME1}.txz"
+  echo "${NAME2}.txz"
+  exit 0
+fi
+
 # Parallel build doesn't link properly.
 #NUMJOBS=${NUMJOBS:--j6}
-NUMJOBS=-j1
 
 # So that ls has the right field counts for parsing...
@@ -63,8 +71,13 @@
 
 # Use .so.1, not .so.1.0.0:
-zcat $CWD/openssl.soname.diff.gz | patch -p1 --backup --verbose --suffix=.orig || exit 1
+sed -i "s/soname=\$\$SHLIB\$\$SHLIB_SOVER\$\$SHLIB_SUFFIX/soname=\$\$SHLIB.1/g" Makefile.shared
+
 if [ "$ARCH" = "i586" ]; then
   # Build with -march=i586 -mtune=i686:
-  zcat $CWD/openssl.optsx86.diff.gz | patch -p1 --backup --verbose --suffix=.orig || exit 1
+  sed -i "/linux-elf/s/fomit-frame-pointer/fomit-frame-pointer -march=i586 -mtune=i686/g" Configure
+  LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+  # Build with -march=i686 -mtune=i686:
+  sed -i "/linux-elf/s/fomit-frame-pointer/fomit-frame-pointer -march=i686 -mtune=i686/g" Configure
   LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
@@ -77,7 +90,7 @@
 # what they were compiled against, whether or not the ABI has changed.
 #
-# So, we will use the OPENSSL_VERSION_NUMBER from openssl-1.0.1c unless ABI
+# So, we will use the OPENSSL_VERSION_NUMBER from openssl-1.0.2e unless ABI
 # breakage forces it to change.  Yes, we're finally using this old trick.  :)
-sed -i "s/#define OPENSSL_VERSION_NUMBER.*/\/* Use 0x1000103fL (1.0.1c) below to avoid pointlessly breaking the ABI *\/\n#define OPENSSL_VERSION_NUMBER 0x1000103fL/g" crypto/opensslv.h || exit 1
+sed -i "s/#define OPENSSL_VERSION_NUMBER.*/\/* Use 0x1000205fL (1.0.2e) below to avoid pointlessly breaking the ABI *\/\n#define OPENSSL_VERSION_NUMBER 0x1000205fL/g" crypto/opensslv.h || exit 1
 
 chown -R root:root .
@@ -98,19 +111,28 @@
 # These are the known patent issues with OpenSSL:
 # name   #         expires
-# MDC-2: 4,908,861  2007-03-13, included.  :-)
+# MDC-2: 4,908,861  2007-03-13, not included.
 # IDEA:  5,214,703  2010-05-25, not included.
 # RC5:   5,724,428  2015-03-03, not included.
+#
+# Although all of the above are expired, it's still probably
+# not a good idea to include them as there are better
+# algorithms to use.
 
 ./config \
  --prefix=/usr \
  --openssldir=/etc/ssl \
+ no-mdc2 \
  no-idea \
  no-rc5 \
  no-sse2 \
+ no-ssl2 \
+ no-weak-ssl-ciphers \
  shared
 
-make $NUMJOBS depend || make -j1  depend || exit 1
-
-make $NUMJOBS || make -j 1 || exit 1
+make $NUMJOBS depend || make depend || exit 1
+
+make $NUMJOBS || make || exit 1
+
+make test -j1 || exit 1
 
 make install INSTALL_PREFIX=$PKG1 || exit 1
@@ -144,7 +166,36 @@
 
 mv $PKG1/etc/ssl/man $PKG1/usr
-( cd $PKG1/usr/man/man1 ; mv passwd.1 ssl_passwd.1 )
-( cd $PKG1/usr/man/man3 ; mv rand.3 ssl_rand.3 )
-( cd $PKG1/usr/man/man3 ; mv err.3 ssl_err.3 )
+# Fix manpage name collisions, and relink anything that linked to the old name:
+( cd $PKG1/usr/man/man1
+  mv passwd.1 ssl_passwd.1
+  for file in *.1 ; do
+    if [ -L $file ]; then
+      if [ "$(readlink $file)" = "passwd.1" ]; then
+        rm -f $file
+        ln -sf ssl_passwd.1 $file
+      fi
+    fi
+  done )
+( cd $PKG1/usr/man/man3
+  mv rand.3 ssl_rand.3
+  for file in *.3 ; do
+    if [ -L $file ]; then
+      if [ "$(readlink $file)" = "rand.3" ]; then
+        rm -f $file
+        ln -sf ssl_rand.3 $file
+      fi
+    fi
+  done )
+( cd $PKG1/usr/man/man3
+  mv err.3 ssl_err.3
+  for file in *.3 ; do
+    if [ -L $file ]; then
+      if [ "$(readlink $file)" = "err.3" ]; then
+        rm -f $file
+        ln -sf ssl_err.3 $file
+      fi
+    fi
+  done )
+
 # Compress and symlink the man pages:
 if [ -d $PKG1/usr/man ]; then
Index: npl/system/openssl/openssl.build
===================================================================
--- npl/system/openssl/openssl.build	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl.build	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-6526
+6528
Index: npl/system/openssl/openssl.md5
===================================================================
--- npl/system/openssl/openssl.md5	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl.md5	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -2,14 +2,12 @@
 1e6908ae51dcc3d1d9d5be0bad6bf803  ./doinst.sh-openssl.gz
 24389791b9e637dff90b350d9ba0e028  ./doinst.sh-openssl-solibs.gz
-130bb19745db2a5a09f22ccbbf7e69d0  ./openssl-1.0.1u.tar.gz
-696ff921e8d4ea2a2ab0105f95eb14a1  ./openssl_dev.pkg
-70d9c041f5c7de50bf5427b7366936f3  ./openssl.optsx86.diff.gz
-103544fe5a3d9606bccdcec53137e449  ./openssl.pkg
+44279b8557c3247cbe324e2322ecd114  ./openssl-1.0.2o.tar.gz
+1e1428b10e4bda1288610a541c0a31fb  ./openssl_dev.pkg
+4ad33ab343bd5cad7c14cd06a21ac109  ./openssl.pkg
 66f195b9f817484bd708cb1c71ea7b51  ./openssl.SlackBuild
-32df63a8e8907c3d0ff387833bc07b17  ./openssl.SlackBuild.log.gz
-5e1eaffc28a65b9108e30e8aed1ed981  ./openssl.SlackBuild.orig
-b3303a5b0c4d92f810ad5676d9d59563  ./openssl.soname.diff.gz
-eee205b1466225d1f33a483e83e6e62b  ./ossllibs_dev.pkg
-003f995b9c404708a03d69118b1ebf01  ./ossllibs.pkg
+504f35e0d315d81bcd2b5595fdfaeda2  ./openssl.SlackBuild.log.gz
+cae6039d35f7acfbbe81c84f24da06d1  ./openssl.SlackBuild.orig
+bda755739fe6595647aae17dc11a1505  ./ossllibs_dev.pkg
+f685f01dfa1d81ff2e055975a08327a9  ./ossllibs.pkg
 c179fc570282afc12c3a6eee101ced0d  ./slack-desc.openssl
 4b7562095ddf28453d54af0ad455a9a5  ./slack-desc.openssl-solibs
Index: npl/system/openssl/openssl.version
===================================================================
--- npl/system/openssl/openssl.version	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl.version	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-1.0.1u
+1.0.2o
Index: npl/system/openssl/openssl_dev.build
===================================================================
--- npl/system/openssl/openssl_dev.build	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl_dev.build	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-6526
+6528
Index: npl/system/openssl/openssl_dev.version
===================================================================
--- npl/system/openssl/openssl_dev.version	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/openssl_dev.version	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-1.0.1u
+1.0.2o
Index: npl/system/openssl/ossllibs.build
===================================================================
--- npl/system/openssl/ossllibs.build	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/ossllibs.build	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-6526
+6528
Index: npl/system/openssl/ossllibs.version
===================================================================
--- npl/system/openssl/ossllibs.version	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/ossllibs.version	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-1.0.1u
+1.0.2o
Index: npl/system/openssl/ossllibs_dev.build
===================================================================
--- npl/system/openssl/ossllibs_dev.build	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/ossllibs_dev.build	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-6526
+6528
Index: npl/system/openssl/ossllibs_dev.version
===================================================================
--- npl/system/openssl/ossllibs_dev.version	(revision 5fedc401896bb521287db633d5b77c78a4134180)
+++ npl/system/openssl/ossllibs_dev.version	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
@@ -1,1 +1,1 @@
-1.0.1u
+1.0.2o
