aboutsummaryrefslogtreecommitdiff
path: root/media/libs/libx264
diff options
context:
space:
mode:
Diffstat (limited to 'media/libs/libx264')
-rw-r--r--media/libs/libx264/Manifest24
-rwxr-xr-xmedia/libs/libx264/libx264.SlackBuild95
2 files changed, 103 insertions, 16 deletions
diff --git a/media/libs/libx264/Manifest b/media/libs/libx264/Manifest
new file mode 100644
index 00000000..61378108
--- /dev/null
+++ b/media/libs/libx264/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST x264-snapshot-20081210-2245.tar.bz2 2311508 MD5 be6b87d61f9be1dbd4f4700dde63c67f RMD160 1300867575625ccf89ebf0d1331d133f3bfbb23e SHA1 ad04776b76ae10766bbc960150f46113d8a0040c SHA256 ba470b1a000bcfbfd2c35741e5d34ee0707b99880fffd43f9f01b6abf270753f SHA512 146cff7aa837de961b27b5f418e68c4ccf0af469cd913382496bced47c54204dae85ee8db79f065676ceb6f73dcf11dd598b142d51653bcb0d4c29cffb0fbef1
+MKBUILD libx264.mkbuild 3775 MD5 75196f1bd90d1d743859e495554ab081 RMD160 441d093972890e5cc4a457d81c3ebb87c7845163 SHA1 ea1d7d5279a31e0ba889bb8095d2367d8c001227 SHA256 a34b35b12a82de59100fcc6889cdbba530fd66f8520b1aa2e5e372bbd12e46a3 SHA512 9a15dd3aa5311c8d0b110881276f0f191b02cd8f4a234a21f608d9406fb77eab88b487a0f59294799228ea99ad8cf42b91d6d01b3c98d08c0f87ad6f19b9dec9
+SLACK-REQUIRED slack-required 76 MD5 ad8c1451ea436596f42bff4fea1c11c6 RMD160 00db8daf6bda0b325f355885a3123aa53bdd9020 SHA1 828db9eeb230a118861bd0d72b9096fc5ac98724 SHA256 22a138cf8ee3e079b0e5ef132b1c80c7ee97bd74300844cbbf766e8cab8ad767 SHA512 5c432e36803a22b522cf33d525b9e532835cc9caa79da0672732037cbc02c9878624a28464ad0211b1976d0a6a7a1dc01514d7ac5539976dccf1cedec538cf82
+SLACKBUILD libx264.SlackBuild 8360 MD5 29623e84022a969f7e2a15e8f3ab81b5 RMD160 849965da76db2e4771ed471000672436aa298e38 SHA1 5725a762316e6fbd588f35bb7a0514d8f2282f51 SHA256 da470cb7c5d177039ecee66bb8db3c4b0e41c68684d74f0689ae51eceb930c14 SHA512 adfe9390ab7ea46e3a904ad7c6ab3112fc888439dc5b9d1d1f1d42b388e01f6eb1f09ea250f79a0559987cf141e79de9b1bd5cca10d289f75ea6627922fc6f3c
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ80w4AAoJEEHL93ESzgeilVMQALNg+PZ96PnyJrmXn3pZCx/v
+2U9tpZm+OAc8FjcegIoYb12aAaZJr0xlJL5MbCFUTqkogmAsS5GJSqSn+F8DAL5O
+rkwioYIqklBpnkj2RDJdrIvxOIrjsaFKEdsa9O3peT1Ynl42liygWTqcOfy/AeAA
+CMZTAm5Smix6/YvGnYLFvzAI2FDXRQBYiLlIWEyCM+BX2CwWQ9RbnPK/YMSUC1G8
+6sVnGtFbpOwiYX8J+l08VZX5bWLXzVd8xCnrD/rTK0ukxkU4QxihIHSkgGXOys2s
+1RZlbnPJ1P+wWjyD4DLHMNd03NCDSI8P1XUX6rMoaj22OxMPKnXSCvZv8r5SiM4H
+aApfu7oTTWRO3J32C1T1o/uDhwWT+xsVIT0LjdsgI90xZ7EEED8S1XSjYNT1mziK
+o3CMsK08+7J2vN+UuiLz8To7wjhJDIe75XtAPUG0zqCRCCVuuTmxt275+SNr4LG9
+ZLADjj7d2J2+mekFkoninnE1NIZjPScQFZLaUyPuiby6O4UFzGM5ngyOIbuSxdnp
+jNTYVYCvh8cGeD3bqRTRPvb04OUMj/sLLzdKs9oX47nIPoNSOcvE7e+iFicRoZCA
+eN+x1I6ZnksNQnVqyedijv9ocbF0WZoW3QkjmknPaxNGR0e219Z+D40uYFJYrhWJ
+vPMKMxiaIc6G5D1ezfLQ
+=AgFz
+-----END PGP SIGNATURE-----
diff --git a/media/libs/libx264/libx264.SlackBuild b/media/libs/libx264/libx264.SlackBuild
index 6e9c39eb..f3a9690a 100755
--- a/media/libs/libx264/libx264.SlackBuild
+++ b/media/libs/libx264/libx264.SlackBuild
@@ -15,8 +15,9 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
# slackbuild for libx264, by Silvio Rhatto
-# requires: yasm
+# requires:
# tested: libx264-20081210
+# model: generic.mkSlackBuild $Rev: 805 $
#
# Look for slackbuildrc
@@ -38,6 +39,7 @@ 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/libx264"}
PREFIX=${PREFIX:=/usr}
PKG_WORK="$TMP/$SRC_NAME"
CONF_OPTIONS=${CONF_OPTIONS:="--enable-shared --enable-visualize --enable-pic"}
@@ -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" ] || ! bunzip2 -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" \
@@ -183,7 +245,8 @@ fi
# 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" ] || [ "$1" = "--cleanup" ]; then