[SCM] libva/master: Support a get-orig-source rule/script to generate orig tarball (currently 1.0.4 tarball).

ceros-guest at users.alioth.debian.org ceros-guest at users.alioth.debian.org
Fri Sep 10 17:57:02 UTC 2010


The following commit has been merged in the master branch:
commit 20bdcdf8a08c386c2ccf06687478474a1fa3b8cc
Author: Andres Mejia <mcitadel at gmail.com>
Date:   Fri Sep 10 13:15:48 2010 -0400

    Support a get-orig-source rule/script to generate orig tarball (currently 1.0.4 tarball).

diff --git a/debian/libva-get-orig-source b/debian/libva-get-orig-source
new file mode 100755
index 0000000..251c809
--- /dev/null
+++ b/debian/libva-get-orig-source
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# This script is used to download the upstream source for libva and
+# generate it into an orig source tarball for Debian.
+
+# Common variables used to ease maintenance of this script
+LIBVA_VERSION="1.0.4"
+LIBVA_TARBALL="libva-$LIBVA_VERSION.tar.gz"
+LIBVA_TARBALL_CHECKSUM="29a415ce293a515df8d2ee499b97ba752ee631f6f4403f2d982acbf39b92a225"
+LIBVA_ORIG_TARBALL="libva_$LIBVA_VERSION.orig.tar.gz"
+USAGE="\n\
+This script is used to generate the orig tarball used in building\n\
+Debian packages for libva-$LIBVA_VERSION.\n\
+Usage: libva-get-orig-source [OPTION]\n\
+\n\
+ -h, --help                 Display this help message.\n"
+
+while [ "$#" -gt "0" ]
+do
+    case "$1" in
+        -h|--help|*)
+            echo "${USAGE}"
+            exit 1
+            ;;
+    esac
+done
+
+make_current_tarball() {
+    # Download the tarball if it's not available in the current directory
+    [ -f $LIBVA_TARBALL ] || \
+        wget -c http://cgit.freedesktop.org/libva/snapshot/$LIBVA_TARBALL
+
+    # Verify the checksum
+    COMPUTED_CHECKSUM=`sha256sum $LIBVA_TARBALL | cut -d ' ' -f 1`
+    if [ $LIBVA_TARBALL_CHECKSUM != $COMPUTED_CHECKSUM ] ; then
+        echo "Checksum verification failed. Checksum was $COMPUTED_CHECKSUM
+    Expected checksum $LIBVA_TARBALL_CHECKSUM."
+        exit 1
+    else
+        echo "Checksum verified. Checksum is $COMPUTED_CHECKSUM."
+    fi
+
+    # Extract tarball and run 'autoreconf -vif'
+    echo "Extracting tarball and running 'autoreconf -vif'"
+    tar -zxf $LIBVA_TARBALL
+    cd libva-$LIBVA_VERSION
+    autoreconf -vif
+    cd ..
+
+    # Remove temp files and other cruft from source tarball
+    # The find command snippet here was taken from debhelper's dh_clean command
+    # with some modification to delete more unneeded files.
+    echo "Removing temp files and other cruft from source tarball"
+    find libva-$LIBVA_VERSION \( \( -type f -a \
+        \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
+        -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
+        -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
+        -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
+        -o -name config.status -o -name config.cache -o -name config.log \
+        \) -exec rm -f "{}" \; \) -o \
+        \( -type d -a -name autom4te.cache -prune -exec rm -rf "{}" \; \) \)
+    rm libva-$LIBVA_VERSION/.gitignore
+    rm libva-$LIBVA_VERSION/.cvsignore
+    rm -rf libva-$LIBVA_VERSION/debian
+
+    # Remove empty directories
+    echo "Removing empty directories"
+    find libva-$LIBVA_VERSION -type d -empty -delete
+
+    # Repack tarball to final orig tarball
+    echo "Creating orig tarball"
+    tar --exclude-vcs -zcf "$LIBVA_ORIG_TARBALL" "libva-$LIBVA_VERSION/"
+}
+
+make_current_tarball
diff --git a/debian/rules b/debian/rules
index c94b377..0ca5fd2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,3 +14,6 @@ CONFIGURE_OPTIONS ?= --prefix=/usr $(I965_DRIVER)
 override_dh_auto_configure:
 	dh_testdir
 	./configure $(CONFIGURE_OPTIONS)
+
+get-orig-source:
+	$(dir $_)libva-get-orig-source

-- 
libva packaging



More information about the pkg-multimedia-commits mailing list