aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media/libs/speex/Manifest23
-rwxr-xr-xmedia/libs/speex/speex.SlackBuild99
-rw-r--r--net/im/twinkle/Manifest24
-rw-r--r--net/im/twinkle/slack-required9
-rw-r--r--net/im/twinkle/twinkle.SlackBuild223
5 files changed, 360 insertions, 18 deletions
diff --git a/media/libs/speex/Manifest b/media/libs/speex/Manifest
new file mode 100644
index 00000000..72b82957
--- /dev/null
+++ b/media/libs/speex/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST speex-1.2rc1.tar.gz 1061882 MD5 c4438b22c08e5811ff10e2b06ee9b9ae RMD160 6f4a11ef910b0db9b820826bcac3da1b79cad3a1 SHA1 52daa72572e844e5165315e208da539b2a55c5eb SHA256 342f30dc57bd4a6dad41398365baaa690429660b10d866b7d508e8f1179cb7a6 SHA512 bdf1ddb2d60496ab220b94c1bec7a43f267fc964fdbb5cc9f24b71b9b571f237f5ce98c1d74b02699d71a95281f4694ff464ebec25e3b135244e5b3099cb1813
+MKBUILD speex.mkbuild 2827 MD5 bfe6711a0c48082c7473e65ecbf9ea89 RMD160 50ca8a786732f9046941283553852f911e4f4ba9 SHA1 543b7d6eb33071dfd448331ab1d044fd0c1829fb SHA256 f5f5185e24252a2199d4b333765bc8d5e52bc9dc1270e3872ae8ebeedb1e4c15 SHA512 d0e82d7c86757830f525c0d8a633436c0a838deea86a8e85d2d5b248d35fbef600a9d920c4b1d33d50a474fdeb974806aba3f1a79c72d64ab9e3dcce0d716ec9
+SLACKBUILD speex.SlackBuild 8085 MD5 baf3b3094c6d45e09dd3d334c82c6c68 RMD160 5b79f36898bba0540a72d7825a1f0144d636cb16 SHA1 3765be43acf8c0fad8ce093b0043e5fdbedcca64 SHA256 f8456f58a243b4b630c9de12d2aef2ed18976abac1f32e956d519c1f9b7aa9d2 SHA512 f2e495f1111a0f7cc8134209f3b7e3c7f5a28535b7a782a278d8beb0d547f8ebf1e95e081be715f369cf8ea6c675b018e8201f046c357175a36ab33ae4e63a8c
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ28zdAAoJEEHL93ESzgeiDacP/1rnNxZ9541us/NlcWWUOSMz
+1qFO0/6PvlBSXmBSfe8AJVp0Cp1VJvTpPbA+hiY3hJq/PF5OLU7UiQ74or03/63q
+W8yoB+m+GYxlZd+qUZhBpIx85Fc5Z/dBvTRzOPbDJhdt5ava7uYi19AoOYPOcC6O
+XTxpzhSkIJC5j7TvIbv698HMqwFjNe0aAQTAK6SqIUJVlNyd6AJArKMGBLnI1bk7
+LAmpLTPa5qAAo8dhSS5b+Jtg07Ky8WlK9HZ3sYKI9tQeQZXcYdRSLuYMPvTbyzH8
+FB8DPTKyFtt1cKn5C0UzaCvqf3Xv2Ak0khlCaMRpTj0AUiCm889MeSf9zdW2zUKy
+abNWnZM73V4CnYc51dXxrcqlju1jnWgOWesXrUWt5bh3vZORpcL4B3T/CDEAZBKw
+n6gl68pneHwRdpGAPe5mb2Ez9wLmIH1h3ptI1mG5+yZ3oXOFO6sR1FrDjbcY62sx
+G2MO4hOBlFVLOIDE7dV1caXOXFv7twcIlp9RYYR/Q/oRG2MTMdwn6XfWStyGXKcc
+PrOWVRfK0P7aYpcuOHnt7WGju7vyGU/svOqycy5P8CSXkFqFiQmGGbk99O+JURQi
+LJt44d5T4Z2205qvv0OEnIWmUuq7KgCaJVo9nElrdCxUZ4MiRp4oTp59q7AotaRH
+7khG/LisPotGML3qyPur
+=5d02
+-----END PGP SIGNATURE-----
diff --git a/media/libs/speex/speex.SlackBuild b/media/libs/speex/speex.SlackBuild
index 6fc50b95..556b74e7 100755
--- a/media/libs/speex/speex.SlackBuild
+++ b/media/libs/speex/speex.SlackBuild
@@ -16,7 +16,8 @@
#
# slackbuild for speex, by Silvio Rhatto
# requires:
-# tested: speex-1.2beta3
+# tested: speex-1.2rc1
+# model: generic.mkSlackBuild $Rev: 805 $
#
# Look for slackbuildrc
@@ -31,13 +32,14 @@ CWD="$(pwd)"
SRC_NAME="speex"
PKG_NAME="speex"
ARCH=${ARCH:=i486}
-SRC_VERSION=${VERSION:=1.2beta3}
+SRC_VERSION=${VERSION:=1.2rc1}
PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
BUILD=${BUILD:=1rha}
SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="media/libs/speex"}
PREFIX=${PREFIX:=/usr}
PKG_WORK="$TMP/$SRC_NAME"
CONF_OPTIONS=${CONF_OPTIONS:=""}
@@ -47,9 +49,9 @@ NUMJOBS=${NUMJOBS:=""}
LIBDIR="$PREFIX/lib"
if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686"
elif [ "$ARCH" = "s390" ]; then
@@ -65,6 +67,7 @@ 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
@@ -84,6 +87,72 @@ 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
@@ -91,10 +160,11 @@ PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
cd "$PKG_SRC"
# Patch source
-patches="
+patches=" [[PATCH URLS]]
$PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff
$PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff"
for patch in $patches; do
+ patch="`basename $patch`"
if [ -f "$CWD/$patch" ]; then
patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH
elif [ -f "$CWD/patches/$patch" ]; then
@@ -103,15 +173,7 @@ for patch in $patches; do
gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
elif [ -f "$CWD/patches/$patch.gz" ]; then
gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
- fi
-done
-
-if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then
- for patch_url in [[PATCH URLS]]; do
- patch="`basename $patch_url`"
- if [ ! -s "$SRC_DIR/$patch" ]; then
- wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET
- fi
+ elif [ -f "$SRC_DIR/$patch" ]; then
if [ "`basename $patch .gz`" != "$patch" ]; then
gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
elif [ "`basename $patch .bz2`" != "$patch" ]; then
@@ -119,8 +181,8 @@ if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then
else
patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH
fi
- done
-fi
+ fi
+done
# Configure
CFLAGS="$SLKCFLAGS" \
@@ -177,9 +239,10 @@ EODESC
# Build the package
cd "$PKG"
-makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+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" ]; then
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
rm -rf "$PKG_WORK" "$PKG"
fi
diff --git a/net/im/twinkle/Manifest b/net/im/twinkle/Manifest
new file mode 100644
index 00000000..f3c905ae
--- /dev/null
+++ b/net/im/twinkle/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST twinkle-1.4.2.tar.gz 1601100 MD5 d70c8972f296ffd998c7fb698774705b RMD160 75acf3caa4643108d2b2e8b639f476926a23e4f1 SHA1 3751ef1a69ae16072393f44c2888b0fb488089e9 SHA256 807686c7ac1b54bb0ea27ff4be362db6926d1d3d6f1802f6d359a353157e89a5 SHA512 3a100e5fc7a7fc39944e5c718e4ea7feac1d3561302ccae0079123c1d0b7f70ba65852eb63b8384958e43533e37138213412bdfc1d33297fb21557947d412cb0
+MKBUILD twinkle.mkbuild 5087 MD5 7f306c7924ea8ee91777efa56aa63c5c RMD160 461cb2bbb87bbc55620b6a97962b1750f47a5122 SHA1 f4217c740d7291485120569c7eeb060cd9eebd4f SHA256 1e90fd5c4a61d2545b80b82bd82cbffbcbd1b13f1d17b0103a1b031384fb5775 SHA512 c1475ad275e3384b89dce4d78ee0411c02fd69f1b088cec7ce9de9c85bb4ed0e78cb50a02b1dfd8377d9d708eff44e4914de8ad8793afe1fbd310c2d9064bb33
+SLACK-REQUIRED slack-required 142 MD5 64f3779f2bb04b3a7856728964f8488d RMD160 7392972e5e628fbb2e0990a14c2e500e8f273834 SHA1 ef1c8d082155fb6e152518bfb3cfebc947cd8fb0 SHA256 e1b0fd58a04c4eb3b88bc2dd27b46872ba07979c2ce632c1adff1e140cfb38ef SHA512 eca4c46428f95e6edb0f945186942908c7f387e5bce3f6a5adfd2a9bf0eaefba906845c8aa6adc17308d961fb69078b4f8174aeb787c42c608833a19f921e1c1
+SLACKBUILD twinkle.SlackBuild 7052 MD5 5c69f4f14077024fd96fe5b1c7f655b7 RMD160 f926a7805c34290d33bf50d797803a8156d1c5b7 SHA1 e333d0d0e48016998b0f66e40539070a27249d6c SHA256 ecfcb512039edbb90d68e5667d3eec97f43dc3e104a6a988290398a7a353acd2 SHA512 6ea7fae3b1fac07143738ef061d7b5895dd0f7cfb173801cf3c99c2c388c669f262108c6df7c3a209b6d6e5fd4bf38b761e6e11853b9f28d913017d28e5069b0
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ29ClAAoJEEHL93ESzgeiU1MP/jijcSkML/t/g9bCQ6/0Ljsv
+ye7KQ7Tlshl0u0E+8K7BhR4vG2HtiYecJHibK4Hzb14LE23G8kHvG0eduSI7S8py
+d5Us9zY2RNlF5kJSnhS0dMD5b7pn0vQ+n3bWl9t/7s7TaJoMLxv7yqabguLUzErH
+XU2GGjW1KCGMhaLsxGMJsVVT6UbjwDTemeDQT+OUO6kVOrYchj4jOszeEQIgswXD
+igVGnMGBQr5zs8CPk0AFHsRpeg6lmA28vOcOYCBhmgr4s1r+HDZQGXPYs7nKs4pp
+m24336ykdMopkKnVrB6b/jC6fa/nB7jKUug0G6B3Jj8QYFFlSVphF+1QOtpXteHo
+P2cQRElsXlzPK+VX8KMYdU+78trqLnGKNNlcL1nJ912PkjFMTgaKQ0kAjjcHeGvE
+ylx1wiJ6/yY7C7IdqXkYDEbpW3m76GUmw6e+hAhtrzXY2OBv2mkhX5SwYoQ20b4U
+MWwozu36MthYeGT0xAuuVeah9rHKR3IrvtocgZV06FexX3BfWpdd6DNR9eIYF70X
+yo3c9FOjEcIBgBKL86Hkkqrf1yrVhMjvhAEa6xpSG3BnHpSTLQ5dVRrm4A5YqtUU
+nT/TtUFkfXRgx3X5EJIDHNIpFBtceB74qggoIkEpYY6zUtJfyK5+vhCfydzwDFin
+kQCxcJaMkrlDCMHzG6Sp
+=BopS
+-----END PGP SIGNATURE-----
diff --git a/net/im/twinkle/slack-required b/net/im/twinkle/slack-required
new file mode 100644
index 00000000..054836e1
--- /dev/null
+++ b/net/im/twinkle/slack-required
@@ -0,0 +1,9 @@
+# Dependency list to twinkle
+#
+# dependency [condition] [version]]
+commoncpp2
+ccrtp
+libzrtpcpp
+speex
+libsndfile
+boost
diff --git a/net/im/twinkle/twinkle.SlackBuild b/net/im/twinkle/twinkle.SlackBuild
new file mode 100644
index 00000000..0ef0858b
--- /dev/null
+++ b/net/im/twinkle/twinkle.SlackBuild
@@ -0,0 +1,223 @@
+#!/bin/bash
+#
+# twinkle.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.
+#
+# twinkle.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 twinkle, by Silvio Rhatto
+# requires: commoncpp2 ccrtp libzrtpcpp speex libsndfile boost
+# tested: twinkle-1.4.2
+# 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="twinkle"
+PKG_NAME="twinkle"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.4.2}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="net/im/twinkle"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:=""}
+
+# 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.xs4all.nl/~mfnboer/twinkle/download/$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="AUTHORS COPYING ChangeLog NEWS README THANKS"
+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------------------------------------------------------|
+twinkle: twinkle
+twinkle:
+twinkle: Twinkle is a softphone for your voice over IP and instant
+twinkle: messaging communcations using the SIP protocol. You can
+twinkle: use it for direct IP phone to IP phone communication or
+twinkle: in a network using a SIP proxy to route your calls and
+twinkle: messages.
+twinkle:
+twinkle:
+twinkle:
+twinkle:
+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