summaryrefslogtreecommitdiffstats
path: root/mozilla-nss/build/mozilla-nss.SlackBuild
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2012-03-20 22:57:16 +0000
committer Eric Hameleers <alien@slackware.com>2012-03-20 22:57:16 +0000
commite6a840f95e682b2addca5a6a5cd67b372c00eff5 (patch)
tree6b75cf8d671451aebe64f7839c33e545312bc2d2 /mozilla-nss/build/mozilla-nss.SlackBuild
parent5751f3b27e02d82450eb9ec96093465d8ee70f4e (diff)
downloadasb-e6a840f95e682b2addca5a6a5cd67b372c00eff5.tar.gz
asb-e6a840f95e682b2addca5a6a5cd67b372c00eff5.tar.xz
Back to alien script format
Diffstat (limited to '')
-rwxr-xr-xmozilla-nss/build/mozilla-nss.SlackBuild105
1 files changed, 92 insertions, 13 deletions
diff --git a/mozilla-nss/build/mozilla-nss.SlackBuild b/mozilla-nss/build/mozilla-nss.SlackBuild
index 83a6abef..c9aca769 100755
--- a/mozilla-nss/build/mozilla-nss.SlackBuild
+++ b/mozilla-nss/build/mozilla-nss.SlackBuild
@@ -20,12 +20,57 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# -----------------------------------------------------------------------------
+#
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: mozilla-nss
+# Descr: Network Security Services
+# URL: http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases
+# Needs:
+# Changelog:
+# 3.9.2-1: 25/mar/2005 by Eric Hameleers
+# * Initial build.
+# 3.9.2-2: 07/Nov/2006 by Eric Hameleers <alien@slackware.com>
+# * Rewrote the SlackBuild for Slackware 11.0
+# 3.11.4-1: 12/May/2007 by Eric Hameleers <alien@slackware.com>
+# * Update to NSS 3.11.4 with NSPR 4.6.4
+# 3.11.4-2: 28/dec/2008 by Eric Hameleers <alien@slackware.com>
+# * Make it build on x86_64 (patch by '414N').
+# 3.12.3-1: 17/jul/2009 by Eric Hameleers <alien@slackware.com>
+# * Update
+# 3.12.3-2: 07/apr/2010 by Eric Hameleers <alien@slackware.com>
+# * Fix some file ownerships in the package.
+# 3.13.1-1: 21/mar/2012 by Eric Hameleers <alien@slackware.com>
+# * Update.
+#
+# Run 'sh mozilla-nss.SlackBuild' to build a Slackware package.
+# The package (.txz) plus descriptive .txt file are created in /tmp .
+# Install using 'installpkg'.
+#
+# -----------------------------------------------------------------------------
-PKGNAM=mozilla-nss
+
+PRGNAM=mozilla-nss
SRCNAM=nss
VERSION=${VERSION:-3.13.1}
NSPR=${NSPR:-4.8.9}
BUILD=${BUILD:-1}
+TAG=${TAG:-alien}
+
+# Where do we look for sources?
+SRCDIR=$(cd $(dirname $0); pwd)
+
+# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
+TMP=${TMP:-/tmp/build}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+SOURCE[0]="$SRCDIR/${SRCNAM}-${VERSION}.tar.bz2"
+SRCURL[0]="http://ftp.mozilla.org/pub/mozilla.org/security/${SRCNAM}/releases/${UCDIR}_RTM/src/${SRCNAM}-${VERSION}.tar.bz2"
+
+SOURCE[1]="$SRCDIR/nspr-${NSPR}.tar.gz"
+SRCURL[1]="http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${NSPR}/src/nspr-${NSPR}.tar.bz2"
# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
@@ -54,18 +99,51 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PKGNAM
-
-rm -rf $PKG
-mkdir -p $TMP $PKG
+# Save old umask and set to 0022:
+_UMASK_=$(umask)
+umask 0022
+
+# Create working directories:
+mkdir -p $OUTPUT # place for the package to be saved
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # always erase old package's contents
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
+rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
+ # remove old log files
+
+# Source file availability:
+for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
+ if ! [ -f ${SOURCE[$i]} ]; then
+ echo "Source '$(basename ${SOURCE[$i]})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})"
+ if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi
+ if ! [ "x${SRCURL[$i]}" == "x" ]; then
+ echo "Will download file to $(dirname $SOURCE[$i])"
+ wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
+ echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build."
+ mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
+ exit 1
+ fi
+ else
+ echo "File '$(basename ${SOURCE[$i]})' not available. Aborting the build."
+ exit 1
+ fi
+ fi
+done
+
+if [ "$1" == "--download" ]; then
+ echo "Download complete."
+ exit 0
+fi
cd $TMP
rm -rf nss-${VERSION}
rm -rf nspr-${NSPR}
-tar xvf $CWD/nss-$VERSION.tar.?z* || exit 1
-tar xvf $CWD/nspr-$NSPR.tar.?z* || exit 1
+tar xvf $SRCDIR/nss-$VERSION.tar.?z* || exit 1
+tar xvf $SRCDIR/nspr-$NSPR.tar.?z* || exit 1
cd nss-$VERSION
## Patch out "No rule to make target -lz. Stop." error
@@ -145,12 +223,13 @@ EOT
)
# Add documentation:
-mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
$CWD/MPL-1.1.txt $CWD/gpl-2.0.txt $CWD/lgpl-2.1.txt \
$CWD/faq.html \
- $PKG/usr/doc/$PKGNAM-$VERSION
-chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" \
@@ -162,5 +241,5 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
-/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}.txz
+/sbin/makepkg -l y -c n $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz