#!/bin/sh # Copyright 2000 BSDi, Inc. Concord, CA, USA # Copyright 2001, 2002 Slackware Linux, Inc. Concord, CA, USA # Copyright 2005 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # openssl.SlackBuild # Heavily based on the original Slackware build scripts, # with patches and parts taken from Debian's 'rules' script; # Modified by Stuart Winter # 22-Dec-2004 # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PACKAGE export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PACKAGE export PKG=$TMP/package-$PACKAGE mkpkgdirs # Delete and re-create temporary directories PKG1=$TMP/package-openssl PKG2=$TMP/package-ossllibs NAME1=$PACKAGE-$VERSION-$ARCH-$BUILD NAME2=$PACKAGE-solibs-$VERSION-$ARCH-$BUILD cd $TMP rm -rf $PKG1 $PKG2 mkdir -p $PKG1/install $PKG2/{install,usr} # Extract source: cd $TMPBUILD tar jxvvf $CWD/openssl-$VERSION.tar.bz2 cd $PACKAGE-$VERSION slackhousekeeping # Change to -march=armv3 -mtune=xscale # This Configure file was taken from Debian's diff. if [ $PORTARCH = "arm" ]; then patch -p0 --verbose < $PORTCWD/arm/Configure.opts.diff || failpatch fi # Fix a bug where an uninitialized pointer could be freed: zcat $CWD/openssl-0.9.8.fix.uninitialized.pointer.diff.gz | patch -p1 --backup --verbose --suffix=.orig || exit 1 # Use .so.0, not .so.0.9.8 (a Slackware patch): zcat $CWD/openssl.soname.diff.gz | patch -p1 --verbose || failpatch # Make apps/openssl work after compilation so that it can generate # certificates. This is required since we removepkg openssl before building. ln -fs libcrypto.so libcrypto.so.0 ln -fs libssl.so libssl.so.0 # Configure: perl util/perlpath.pl /usr/bin perl \ Configure \ --prefix=/usr \ --openssldir=/etc/ssl \ shared \ no-mdc2 \ no-idea \ no-rc5 \ debian-arm || failconfig # Build: make depend || failmake ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ make || failmake # Start fakeroot server: start_fakeroot # Install into pseudo root: make install INSTALL_PREFIX=$PKG1 mv $PKG1/etc/ssl/openssl.cnf $PKG1/etc/ssl/openssl.cnf.new # Create symlinks: ( cd $PKG1/usr/lib ; ldconfig -l * ) ( cd $PKG1/usr/lib ; ln -sf libcrypto.so.0 libcrypto.so ) ( cd $PKG1/usr/lib ; ln -sf libssl.so.0 libssl.so ) # Fix up the man pages: 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 ) # Install docs: mkdir -p $PKG1/usr/doc/openssl-$VERSION cp -a CHANGES CHANGES.SSLeay FAQ INSTALL \ LICENSE NEWS README README.ENGINE doc $PKG1/usr/doc/openssl-$VERSION # Install docs into runtime package: cp -a $PKG1/usr/doc $PKG2/usr/ # Change into package1's ('openssl') directory cd $PKG1 chmod 755 usr/lib/pkgconfig # Set some generic Slackware packaging policies: slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # set all files to root.root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh # Install package description: install -m644 $CWD/slack-desc.openssl install/slack-desc # Build 'openssl' full package: makepkg -l y -c n $PKGSTORE/$PKGSERIES/${NAME1}.tgz # Make runtime package: mkdir -p $PKG2/usr/lib ( cd usr/lib ; cp -a lib*.so.*.*.* $PKG2/usr/lib ) ( cd $PKG2/usr/lib ; ldconfig -l * ) mkdir -p $PKG2/etc ( cd $PKG2/etc ; cp -a $PKG1/etc/ssl . ) # Build runtime package: cd $PKG2 install -m644 $CWD/slack-desc.openssl-solibs install/slack-desc zcat $CWD/doinst.sh.gz > install/doinst.sh makepkg -l y -c n $PKGSTORE/a/${NAME2}.tgz echo "Check for .tgz package dupes since this script does not" echo "delete old packages."