diff options
Diffstat (limited to 'media/libs/libdv')
-rw-r--r-- | media/libs/libdv/Manifest | 24 | ||||
-rwxr-xr-x | media/libs/libdv/libdv.SlackBuild | 95 |
2 files changed, 103 insertions, 16 deletions
diff --git a/media/libs/libdv/Manifest b/media/libs/libdv/Manifest new file mode 100644 index 00000000..95034451 --- /dev/null +++ b/media/libs/libdv/Manifest @@ -0,0 +1,24 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST libdv-1.0.0.tar.gz 574565 MD5 f895162161cfa4bb4a94c070a7caa6c7 RMD160 a8d3ae083340cec411d5294db7197ea72c8b3c4f SHA1 2e5ba0e95f665d60e72cbebcf1c4989e0d6c92c8 SHA256 a305734033a9c25541a59e8dd1c254409953269ea7c710c39e540bd8853389ba SHA512 19887a6f452fa7da8924901ad841f5c4a434a3bde56c932ddb43717592aa744281e3a8ad220231e11d7e6bc3b0e704952a8324e5f85d4e088675edceeeca7dc8 +MKBUILD libdv.mkbuild 2853 MD5 c39369750c55d3043fcbf9baf27b1d0b RMD160 b1136489d5ab72b936536e9fff792e1f570a06ca SHA1 98d6dfec3010905c8e573815d912cc24388a2e85 SHA256 cd53627bbcd8346f7cf83ab5cdf53eb5f5ce896ed20d0fcd0204713312d54ca7 SHA512 1d85e7d8bfa44c53c24b494808eda2d5c618be53380e0ae1affa9d56faa6e0059ed05b8d906db92bbdd28260547117912cc7e8224d89245ea8d2b87c398e386a +PATCH libdv-0.104.diff 46434 MD5 02d0baa2e679c151c2789e6ed65f0f1e RMD160 4810fc9bea0444c94e779fd4a2b37dbd9bb62153 SHA1 65f8e50f44196579df2976e5b1731e90e4357001 SHA256 1e0658656985c8ffb131ecdf25dad11723d5dd5951181cccd0f0f5388e5ac8b0 SHA512 f5189a11c29b2b97706a1dc94f0116bf4934741c2a874b54f3e8d278449131a3a23644fe090231df23216642500fe940baf0dcca134f9790c6cb0cdaf9ea0312 +SLACKBUILD libdv.SlackBuild 8110 MD5 122f990ea9c3cd1b910f56b16826b9fd RMD160 591f9ce46b389cf63989ad01079692bd1d7536da SHA1 435c6ef6f7f5c9cdbf8f8e18067a758b3607a34f SHA256 bb7e277a62b46ee86f2d13ffb15808c3abae832a256b72e1a8da72dbc43a3a0d SHA512 cc4759a027c60fc6c7a96711263ace52ee63a5af1c60e452527a94d1f348d1bedb7221f3afc1b921ae6872f80e35331886ed5557f5e2e5ae6cc1c10e414ae186 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJ/gH5AAoJEEHL93ESzgei1YUP+QHSxFw6jiEtHESQ4piESlQp +1SC8k89r6im5IKhGcAFOXgPFAOjvOSH83gi7s3+GqZQ5Uygj6A7dskBLZJRmvxMc +VZY6NMYaxub/2MjXA0udZfQ0tEIGQsqD9RXrbCCmntLoBcuo7rXPcde/yc0D3+2A +FCv8toK6coeUeS++AWdo/IKgcuFFh1R7TRsdFLLhIQFjhotak9L3/gpEMJoeP8sq +WSxGDcVtlQ81BHmlDdS9JbEv7JyWnHTcX5Nf8ZyPRqNUJM21ER36OsxUmUUpD8h6 +/n8IP7rv0Rf/ZRqTXwP/hOBjcIQ+8s2e3EOHk6QTI6xrmdJ+dQQ5ArOytGhRtXPU +hd7Ck64pNwnlXU0sLZ1ngThVAUga1SCZalC6ulXvYpZBt0oBgISEJJxuDE5vr4BA +62wkNc8zMhR4dFY2QtoDWcMQ9t+vC62isRkhMarNFuomkwz1Vf5isVuRnF1dOXm1 +oJ/X0/MxRHev8o4qwIbX4q6ssYxLkvv+wSMTEO9PZyz+d2RXuZn4mYAn83ZAFOKa +yVkJN2RZKKkWbUzH7IgSdc4uCgi03PFTqIH9SmC+mFWJCswUuNLh+WwweGbA7jwe +BiKC4LNnVstcBOpEBzJIh2DF6DK3WFl0jPZ/Qeh5l0dlU8SLlq1yR6GTMsoi406o +px+LiLSkW0AfpRRYwfWn +=1Z0l +-----END PGP SIGNATURE----- diff --git a/media/libs/libdv/libdv.SlackBuild b/media/libs/libdv/libdv.SlackBuild index 75b76578..8230df67 100755 --- a/media/libs/libdv/libdv.SlackBuild +++ b/media/libs/libdv/libdv.SlackBuild @@ -17,6 +17,7 @@ # slackbuild for libdv, by Silvio Rhatto # requires: # tested: libdv-1.0.0 +# 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/libdv"} 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 |