aboutsummaryrefslogtreecommitdiff
path: root/patches/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'patches/sqlite')
-rw-r--r--patches/sqlite/Manifest23
-rw-r--r--patches/sqlite/sqlite.SlackBuild223
2 files changed, 246 insertions, 0 deletions
diff --git a/patches/sqlite/Manifest b/patches/sqlite/Manifest
new file mode 100644
index 00000000..96dd0188
--- /dev/null
+++ b/patches/sqlite/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST sqlite-3.6.13.tar.gz 2780584 MD5 652a01797e7538811e4997a5847bc026 RMD160 2a9b3be1f087f63560ba63784b090b4fcf847d57 SHA1 632b5661ba7f59e92ce805ebcdf2cc3e9b28a051 SHA256 2ca2591847df72224dd6f99c8fffe35bb63bf41a8519d8e15ad48141aa841bfa SHA512 48bbf4285d5d21dff5416e1fff877f733b9172e918980d0d07adc516fd27b4dcdd9841456b2e0ba1b10784b286990f377a0ec0262ddac13ae07e62ee6df6a994
+MKBUILD sqlite.mkbuild 3878 MD5 345c87b6c5b52d346c972f24d5bd61bb RMD160 977b020de9742a2a90065d42bfd50fea08371635 SHA1 762ba63a9884dccc031628bbfe0ed407ae104a84 SHA256 b801f57203e60044488a826940ffda7fee8a6aa22ea8504e92116827981a52a7 SHA512 2c2eed0083ebf3af22573605b99ea97084a6020429dbc69e53f66743d7eeec72661ec01b2bff9baf942c77748b8fd4550701c7a88001dd802bc8cfd67f969305
+SLACKBUILD sqlite.SlackBuild 7187 MD5 a0a6c7a74fb6ea128dc8e1f5fe05dbee RMD160 843d962bb3733f18eca70aa40a61406848deb3ad SHA1 397f2a9620e065ed317911753bcf2cf6497a51e9 SHA256 516394a5bfdd49518686ee503e49171cf4f1dabc872cfcb1449c4662d414ac59 SHA512 51dea814fef994d3527dde65405276abb553c6a38ebf946a9a23ef77b5f9c6464bfef8aa839290e3ec1af5c0e4cc450789d5c175c2e058494ea421aa7ce35763
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ82tPAAoJEEHL93ESzgeiggQP/A5Wp0aCJTQ1TCCrBGDNwMlO
+OItQZmifdsVtqajy92+xXssfN29qGX5Kmo83jmp45BGy4No/+PqM+XYbAktw9eEB
+KLw9Gl2bA7yYN0gRG12xGl6F0637a5N0JA3f300oRra9CLoWvHqSP60Ea53RffNA
+UdsKT4naZb1Wdg92dtkggM02cr4Ecwp49NEE1jTQKVgCDDaZXe+s8e3DLb8K5cKJ
+fMg1xZExyhyVEUhwDioovVbA2EsKwmPZWwogvJHpD51UB2VSeuLsKALRlDtxVzB6
+BPNoAELxU3VL8QBV64zfbp2A2R6lnW6MZrzFLt7PI9iIywktJCuk14tlx0hbLuDt
+ywK4nU8xTR9qOy2IWw2XTy1wwz+2BATtqIOaMKfKEh8USYs8aLECCVpXDefCoDL1
+rswWXDK+NKKHD8K8qpLvBOm4+0dVcGXM6UcumyEg/ivAacUhLi89xS+csPrSmhlv
+ihszZ5TWO3CDt/r1wfHsym+ek2JKCWi0JlLtbc5n7grqV/UJtamcBGcq84u0Djwq
+4ynNikfgyuamgIOiSXz4rF7rJFpL/qLzwdd5mA8Kh16hticNxFQx2La4T5HUJWFh
+nFmoNGnbGaG5diXq7kzm+RLkum3KWe8cS8+FmOtExOsuXGd/Gqx9sPG/Nm4ZmX38
+SPBfVrI8LZp21COG/p2K
+=Livp
+-----END PGP SIGNATURE-----
diff --git a/patches/sqlite/sqlite.SlackBuild b/patches/sqlite/sqlite.SlackBuild
new file mode 100644
index 00000000..00306b6b
--- /dev/null
+++ b/patches/sqlite/sqlite.SlackBuild
@@ -0,0 +1,223 @@
+#!/bin/bash
+#
+# sqlite.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
+#
+# sqlite.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# slackbuild for sqlite, by Rudson R. Alves
+# requires:
+# tested: sqlite-3.6.13
+# model: generic.mkSlackBuild $Rev: 805 $
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+ source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+ source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="sqlite"
+PKG_NAME="sqlite"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=3.6.13}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="patches/sqlite"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc"}
+NUMJOBS=${NUMJOBS:="-j7"}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
+ERROR_MANIFEST=43;
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tar.gz"
+URL="http://www.sqlite.org/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+ # Manifest signature checking
+ if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+ echo "Checking Manifest signature..."
+ gpg --verify $CWD/Manifest
+ if [ "$?" != "0" ]; then
+ exit $ERROR_MANIFEST
+ fi
+ fi
+
+ MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+ for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+ MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+ MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+ MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+ if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+ MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+ else
+ MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+ fi
+
+ if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+ continue
+ fi
+
+ echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+ SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+ SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+ # Check source code size
+ if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+ echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "Size match."
+ fi
+
+ # Check source code integrity
+ for ALGO in md5 rmd160 sha1 sha256 sha512; do
+ if [ $ALGO = "rmd160" ]; then
+ ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+ else
+ ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+ fi
+ ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+ ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+ if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+ echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "$ALGO match."
+ fi
+ done
+
+ done
+
+else
+ exit $ERROR_MANIFEST
+fi
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="README VERSION"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler-------------------------------------------------------|
+sqlite: sqlite by Slack.Sarava
+sqlite:
+sqlite: SQLite is a small C library that implements a self-contained,
+sqlite: embeddable, zero-configuration SQL database engine. Features include:
+sqlite: * Transactions are atomic, consistent, isolated, and durable (ACID)
+sqlite: even after system crashes and power failures.
+sqlite: * Zero-configuration - no setup or administration needed.
+sqlite: * A complete database is stored in a single disk file.
+sqlite: * Database files can be freely shared between machines with different
+sqlite: byte orders.
+sqlite: * ...
+EODESC
+
+# Build the package
+cd "$PKG"
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+ rm -rf "$PKG_WORK" "$PKG"
+fi