summaryrefslogtreecommitdiffstats
path: root/source/ap/sqlite/sqlite.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/sqlite/sqlite.SlackBuild')
-rwxr-xr-xsource/ap/sqlite/sqlite.SlackBuild47
1 files changed, 30 insertions, 17 deletions
diff --git a/source/ap/sqlite/sqlite.SlackBuild b/source/ap/sqlite/sqlite.SlackBuild
index ffc75b330..c2754bc26 100755
--- a/source/ap/sqlite/sqlite.SlackBuild
+++ b/source/ap/sqlite/sqlite.SlackBuild
@@ -3,7 +3,7 @@
# Slackware build script for sqlite
# Copyright 2006 Martin Lefebvre <dadexter@gmail.com>
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,12 +23,26 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRGNAM=sqlite
-VERSION=3.6.14.2
-ARCH=${ARCH:-x86_64}
-NUMJOBS=${NUMJOBS:-" -j7 "}
+PKGNAM=sqlite
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
+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-$PKGNAM
+
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
@@ -38,18 +52,17 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PRGNAM
-
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* || exit 1
-cd $PRGNAM-$VERSION || exit 1
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root.root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -94,18 +107,18 @@ gzip -9 $PKG/usr/man/man1/sqlite3.1
sed -i 's|Libs: -L${libdir} -lsqlite3|Libs: -L${libdir} -lsqlite3 -ldl|g' \
$PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/sqlite3.pc
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
README* VERSION \
- $PKG/usr/doc/$PRGNAM-$VERSION
+ $PKG/usr/doc/$PKGNAM-$VERSION
# Add a COPYRIGHT file -- http://www.sqlite.org/copyright.html
-zcat $CWD/COPYRIGHT.gz > $PKG/usr/doc/$PRGNAM-$VERSION/COPYRIGHT
-rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/CVS
+zcat $CWD/COPYRIGHT.gz > $PKG/usr/doc/$PKGNAM-$VERSION/COPYRIGHT
+rm -rf $PKG/usr/doc/$PKGNAM-$VERSION/CVS
find $PKG/usr/doc -type f -exec chmod 0644 {} \;
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz