summaryrefslogtreecommitdiffstats
path: root/p7zip/build
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2010-12-15 14:32:59 +0000
committer Eric Hameleers <alien@slackware.com>2010-12-15 14:32:59 +0000
commitd63b3767c4f4f9d136f80bb05d3e1faedc16aeb3 (patch)
treeadbc0c71e9ccb290fb75c064cf5b08eabf176842 /p7zip/build
parent7cb9e1d3936d5faa5c559c9cf55a98d72fb2b11a (diff)
downloadasb-d63b3767c4f4f9d136f80bb05d3e1faedc16aeb3.tar.gz
asb-d63b3767c4f4f9d136f80bb05d3e1faedc16aeb3.tar.xz
Updated for 9.13, also contains a GUI now!
Diffstat (limited to 'p7zip/build')
-rwxr-xr-xp7zip/build/p7zip.SlackBuild144
1 files changed, 90 insertions, 54 deletions
diff --git a/p7zip/build/p7zip.SlackBuild b/p7zip/build/p7zip.SlackBuild
index 034560bc..c002dcb2 100755
--- a/p7zip/build/p7zip.SlackBuild
+++ b/p7zip/build/p7zip.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright 2006-2009 Eric Hameleers, Eindhoven, NL
+# Copyright 2006-2010 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -39,6 +39,8 @@
# manually copying files.
# 4.65-1: 27/may/2009 by Eric Hameleers <alien@slackware.com>
# * Update.
+# 9.13-1: 14/dec/2010 by Eric Hameleers <alien@slackware.com>
+# * Update.
#
# Run 'sh p7zip.SlackBuild' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -49,12 +51,11 @@
# Set initial variables:
PRGNAM=p7zip
-VERSION=${VERSION:-4.65}
-ARCH=${ARCH:-i486}
+VERSION=${VERSION:-9.13}
BUILD=${BUILD:-1}
TAG=${TAG:-alien}
-DOCS="ChangeLog README TODO"
+DOCS="ChangeLog README TODO docs/*"
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -71,49 +72,55 @@ SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}_${VERSION}_src_all.
## --- with a little luck, you won't have to edit below this point --- ##
##
-# Exit the script on errors:
-set -e
-trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
-# Catch unitialized variables:
-set -u
-P1=${1:-1}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
case "$ARCH" in
i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHSUFFIX="x86_ppc_alpha_gcc_4.X"
- ;;
- s390) SLKCFLAGS="-O2"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHSUFFIX="x86_ppc_alpha_gcc_4.X"
- ;;
- powerpc) SLKCFLAGS="-O2"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHSUFFIX="x86_ppc_alpha_gcc_4.X"
;;
x86_64) SLKCFLAGS="-O2 -fPIC"
SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
- ARCHSUFFIX="amd64"
;;
- athlon-xp) SLKCFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
+ *) SLKCFLAGS="-O2"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHSUFFIX="x86_ppc_alpha_gcc_4.X"
;;
esac
+# Exit the script on errors:
+set -e
+trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
+# Catch unitialized variables:
+set -u
+P1=${1:-1}
+
+# 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:
if ! [ -f ${SOURCE} ]; then
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi
if ! [ "x${SRCURL}" == "x" ]; then
- # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
- [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
- echo "Source '$(basename ${SOURCE})' not available yet..."
echo "Will download file to $(dirname $SOURCE)"
wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
@@ -141,44 +148,70 @@ echo "++"
cd $TMP/tmp-$PRGNAM
echo "Extracting the source archive(s) for $PRGNAM..."
tar -xvf ${SOURCE}
-mv ${PRGNAM}_${VERSION} ${PRGNAM}-${VERSION}
-cd ${PRGNAM}-${VERSION}
+cd ${PRGNAM}_${VERSION}
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
+chmod -R u+w,go+r-w,a+X-s .
echo Building ...
-cp -f makefile.linux_${ARCHSUFFIX} makefile.machine
-make OPTFLAGS="$SLKCFLAGS" \
- DEST_HOME=/usr \
- DEST_SHARE=/usr/lib${LIBDIRSUFFIX}/p7zip \
- DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
- all3 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
-
-if $(which installwatch > /dev/null 2>&1); then
- installwatch -o $OUTPUT/install-${PRGNAM}.log make install \
- DEST_HOME=/usr \
- DEST_SHARE=/usr/lib${LIBDIRSUFFIX}/p7zip \
- DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
- DEST_DIR=$PKG
-else
- make install \
- DEST_HOME=/usr \
- DEST_SHARE=/usr/lib${LIBDIRSUFFIX}/p7zip \
- DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
- DEST_DIR=$PKG \
- 2>&1 |tee $OUTPUT/install-${PRGNAM}.log
-fi
+# Some moving around for the benefit of my DOCS variable:
+mv DOCS docs
+mv contrib/gzip-like_CLI_wrapper_for_7z/README README.p7zip_wrapper
+
+# First, build the commandline tools:
+make all3 \
+ OPTFLAGS="$SLKCFLAGS" \
+ DEST_HOME=/usr \
+ DEST_SHARE=/usr/lib${LIBDIRSUFFIX}/p7zip \
+ DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
+ 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
+
+# Next, the gui:
+sed -i -e "s#/usr/lib/#/usr/lib${LIBDIRSUFFIX}/#g" \
+ CPP/7zip/UI/GUI/makefile.depend
+make 7zG \
+ OPTFLAGS="$SLKCFLAGS" \
+ DEST_HOME=/usr \
+ DEST_SHARE=/usr/lib$LIBDIRSUFFIX/p7zip \
+ DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
+ 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log
+
+# Install the commandline utils:
+make install \
+ DEST_HOME=/usr \
+ DEST_SHARE=/usr/lib${LIBDIRSUFFIX}/p7zip \
+ DEST_SHARE_DOC=/usr/doc/${PRGNAM}-${VERSION} \
+ DEST_DIR=$PKG \
+ 2>&1 |tee $OUTPUT/install-${PRGNAM}.log
+
+# Add a wrapper that allows p7z to be used as a compressor for tar:
+install -m 0755 contrib/gzip-like_CLI_wrapper_for_7z/p7zip $PKG/usr/bin/
+install -m 0644 contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 $PKG/usr/man/man1/
+
+# Add the gui program plus support files:
+cp -a GUI/p7zipForFilemanager $PKG/usr/bin/p7zipForFilemanager
+sed -e "s#/usr/lib${LIBDIRSUFFIX}/p7zip/7z#/usr/lib${LIBDIRSUFFIX}/p7zip/7zG#" $PKG/usr/bin/7z > $PKG/usr/bin/7zG
+chmod 755 $PKG/usr/bin/7zG
+
+cp -a bin/7zG $PKG/usr/lib${LIBDIRSUFFIX}/p7zip/7zG
+cp -a GUI/Lang $PKG/usr/lib${LIBDIRSUFFIX}/p7zip/Lang
+cp -a GUI/help $PKG/usr/lib${LIBDIRSUFFIX}/p7zip/help
+
+# Icons for the menu entry:
+for i in 16 32 ; do
+ mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps/
+ cp -a GUI/p7zip_${i}.png $PKG/usr/share/icons/hicolor/${i}x${i}/apps/
+done
+
+# Add KDE4 service menus:
+mkdir -p $PKG/usr/share/kde4/services/ServiceMenus
+install -m 644 GUI/kde/*.desktop $PKG/usr/share/kde4/services/ServiceMenus/
# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/doc/$PRGNAM-$VERSION/DOCS/* $PKG/usr/doc/$PRGNAM-$VERSION/ && \
rmdir $PKG/usr/doc/$PRGNAM-$VERSION/DOCS
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
-cat $SRCDIR/$(basename $0) | sed \
- -e "/^VERSION=/s/:-.*}/:-$VERSION}/" \
- -e "/^ARCH=/s/:-.*}/:-$ARCH}/" \
- -e "/^BUILD=/s/:-.*}/:-$BUILD}/" \
- > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc -type f -exec chmod 644 {} \;
# Compress the man page(s):
@@ -203,3 +236,6 @@ md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
+# Restore the original umask:
+umask ${_UMASK_}
+