Index: npl/system/openssl/openssl.SlackBuild.orig
===================================================================
--- npl/system/openssl/openssl.SlackBuild.orig	(revision a1525ed2937faf8ebc49e82a9fa9b6d190c553e4)
+++ npl/system/openssl/openssl.SlackBuild.orig	(revision f9ce31e1b61d541888a879b85c07b06ea069b5ee)
@@ -70,6 +70,7 @@
 find . -name "*.pod" -exec sed -i "s/^\=item \([0-9]\)\(\ \|$\)/\=item C<\1>/g" {} \;
 
-# Use .so.1, not .so.1.0.0:
-sed -i "s/soname=\$\$SHLIB\$\$SHLIB_SOVER\$\$SHLIB_SUFFIX/soname=\$\$SHLIB.1/g" Makefile.shared
+## For openssl-1.1.x, don't try to change the soname.
+## Use .so.1, not .so.1.0.0:
+#sed -i "s/soname=\$\$SHLIB\$\$SHLIB_SOVER\$\$SHLIB_SUFFIX/soname=\$\$SHLIB.1/g" Makefile.shared
 
 if [ "$ARCH" = "i586" ]; then
@@ -90,12 +91,13 @@
 # what they were compiled against, whether or not the ABI has changed.
 #
-# So, we will use the OPENSSL_VERSION_NUMBER from openssl-1.0.2e unless ABI
+# So, we will use the OPENSSL_VERSION_NUMBER from openssl-1.1.0h unless ABI
 # breakage forces it to change.  Yes, we're finally using this old trick.  :)
-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
+sed -i "s/#define OPENSSL_VERSION_NUMBER.*/\/* Use 0x1010008fL (1.1.0h) below to avoid pointlessly breaking the ABI *\/\n#define OPENSSL_VERSION_NUMBER 0x1000205fL/g" include/openssl/opensslv.h || exit 1
 
 chown -R root:root .
 mkdir -p $PKG1/usr/doc/openssl-$VERSION
-cp -a CHANGES CHANGES.SSLeay FAQ INSTALL INSTALL.MacOS INSTALL.VMS INSTALL.W32 \
-  LICENSE NEWS README README.ENGINE doc $PKG1/usr/doc/openssl-$VERSION
+cp -a ACKNOWLEDGEMENTS AUTHORS CHANGES* CONTRIBUTING FAQ INSTALL* \
+  LICENSE* NEWS NOTES* README* doc \
+  $PKG1/usr/doc/openssl-$VERSION
 find $PKG1/usr/doc/openssl-$VERSION -type d -exec chmod 755 {} \;
 find $PKG1/usr/doc/openssl-$VERSION -type f -exec chmod 644 {} \;
@@ -113,5 +115,4 @@
 # 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
@@ -122,10 +123,18 @@
  --prefix=/usr \
  --openssldir=/etc/ssl \
+ zlib \
+ enable-camellia \
+ enable-seed \
+ enable-rfc3779 \
+ enable-cms \
+ enable-md2 \
+ enable-rc5 \
+ enable-ssl3 \
+ enable-ssl3-method \
+ no-weak-ssl-ciphers \
  no-mdc2 \
+ no-ec2m \
  no-idea \
- no-rc5 \
  no-sse2 \
- no-ssl2 \
- no-weak-ssl-ciphers \
  shared
 
@@ -134,7 +143,11 @@
 make $NUMJOBS || make || exit 1
 
-make test -j1 || exit 1
-
-make install INSTALL_PREFIX=$PKG1 || exit 1
+make install DESTDIR=$PKG1 || exit 1
+
+# No thanks on the static libraries:
+rm -f $PKG1/usr/lib${LIBDIRSUFFIX}/*.a
+
+# No thanks on manpages duplicated as html:
+rm -rf $PKG1/usr/share/doc
 
 # Make the .so.? library symlinks:
@@ -149,6 +162,6 @@
     mv $file ../../lib${LIBDIRSUFFIX}
     ln -sf ../../lib${LIBDIRSUFFIX}/$file .
-  done 
-  cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
+  done
+  # cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
 )
 
@@ -158,5 +171,9 @@
 chmod 755 $PKG1/etc/cron.daily/certwatch.new
 
+# Make config file non-clobber:
 mv $PKG1/etc/ssl/openssl.cnf $PKG1/etc/ssl/openssl.cnf.new
+
+# Remove duplicate config file:
+rm -f $PKG1/etc/ssl/openssl.cnf.dist
 
 ( cd $PKG1
@@ -165,5 +182,8 @@
 )
 
-mv $PKG1/etc/ssl/man $PKG1/usr
+# Relocate the manpages:
+mv $PKG1/usr/share/man $PKG1/usr
+rmdir $PKG1/usr/share
+
 # Fix manpage name collisions, and relink anything that linked to the old name:
 ( cd $PKG1/usr/man/man1
@@ -174,24 +194,4 @@
         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
@@ -213,16 +213,16 @@
 fi
 
-# If there's an openssl0 directory, then build openssl-0 shared libraries for
+# If there's an openssl1 directory, then build openssl-1.0 shared libraries for
 # compatibility with programs linked to those:
-if [ -d $CWD/openssl0 ]; then
-  ( cd $CWD/openssl0
-    ./openssl0.build || exit 1
+if [ -d $CWD/openssl1 ]; then
+  ( cd $CWD/openssl1
+    ./openssl1.build || exit 1
   ) || exit 1
   # Don't put these in the openssl package...  openssl-solibs is enough.
   #mkdir -p $PKG1/lib${LIBDIRSUFFIX}
-  #cp -a $TMP/package-openssl0/usr/lib/lib*.so.?.?.? $PKG1/lib${LIBDIRSUFFIX}
+  #cp -a $TMP/package-openssl1/usr/lib/lib*.so.?.?.? $PKG1/lib${LIBDIRSUFFIX}
   #( cd $PKG1/lib${LIBDIRSUFFIX} ; ldconfig -l lib*.so.?.?.? )
   mkdir -p $PKG2/lib${LIBDIRSUFFIX}
-  cp -a $TMP/package-openssl0/usr/lib/lib*.so.?.?.? $PKG2/lib${LIBDIRSUFFIX}
+  cp -a $TMP/package-openssl1/usr/lib${LIBDIRSUFFIX}/lib*.so.?.?.? $PKG2/lib${LIBDIRSUFFIX}
   ( cd $PKG2/lib${LIBDIRSUFFIX} ; ldconfig -l lib*.so.?.?.? )
 fi
@@ -244,6 +244,6 @@
 mkdir -p $PKG2/usr/doc/openssl-$VERSION
 ( cd $TMP/openssl-$VERSION
-  cp -a CHANGES CHANGES.SSLeay FAQ INSTALL INSTALL.MacOS INSTALL.VMS INSTALL.W32 \
-  LICENSE NEWS README README.ENGINE $PKG2/usr/doc/openssl-$VERSION
+  cp -a ACKNOWLEDGEMENTS AUTHORS CHANGES* CONTRIBUTING FAQ INSTALL* \
+  LICENSE* NEWS NOTES* README* $PKG2/usr/doc/openssl-$VERSION
   # If there's a CHANGES file, installing at least part of the recent history
   # is useful, but don't let it get totally out of control:
