summaryrefslogtreecommitdiffstats
path: root/source/ap/cupsddk/cupsddk.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsource/n/obexfs/obexfs.SlackBuild (renamed from source/ap/cupsddk/cupsddk.SlackBuild)63
1 files changed, 41 insertions, 22 deletions
diff --git a/source/ap/cupsddk/cupsddk.SlackBuild b/source/n/obexfs/obexfs.SlackBuild
index 48157ffc9..05c9ceb32 100755
--- a/source/ap/cupsddk/cupsddk.SlackBuild
+++ b/source/n/obexfs/obexfs.SlackBuild
@@ -1,7 +1,9 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2009 Robby Workman, Northport, AL, USA
-# Copyright 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Slackware build script for obexfs
+
+# Copyright 2009 Robby Workman, Northport, Alabama, USA
+# Copyright 2010 Patrick Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,18 +23,25 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Slackware build script for cupsddk
-
-
-VERSION=${VERSION:-1.2.3}
-ARCH=${ARCH:-x86_64}
+PKGNAM=obexfs
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
-NUMJOBS=${NUMJOBS:--j6}
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+# 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
CWD=$(pwd)
TMP=${TMP:-/tmp}
-PKG=$TMP/package-cupsddk
+PKG=$TMP/package-$PKGNAM
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -43,14 +52,17 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
rm -rf $PKG
mkdir -p $TMP $PKG
-cd $TMP || exit 1
-rm -rf cupsddk-$VERSION
-tar xvf $CWD/cupsddk-${VERSION}-source.tar.bz2 || exit 1
-cd cupsddk-$VERSION || exit 1
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -66,22 +78,29 @@ CXXFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
- --with-docdir=/usr/doc/cupsddk-$VERSION \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
-make install BUILDROOT=$PKG || exit 1
+make install DESTDIR=$PKG || exit 1
-find $PKG | xargs file | grep -e "executable" -e "shared object" \
- | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
- *.txt doc/*.html doc/images \
- $PKG/usr/doc/cupsddk-$VERSION
+ AUTHORS COPYING* INSTALL NEWS README* \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $TMP/cupsddk-$VERSION-$ARCH-$BUILD.txz
-
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz