[SCM] adplug/master: Add adplug-get-orig-source to generate orig tarball for new upstream releases.

ceros-guest at users.alioth.debian.org ceros-guest at users.alioth.debian.org
Sun Sep 26 17:58:56 UTC 2010


The following commit has been merged in the master branch:
commit eb59d2d749ff924c9d6647f62db65f1699444f6c
Author: Andres Mejia <mcitadel at gmail.com>
Date:   Sun Sep 26 12:17:49 2010 -0400

    Add adplug-get-orig-source to generate orig tarball for new upstream releases.

diff --git a/debian/adplug-get-orig-source b/debian/adplug-get-orig-source
new file mode 100755
index 0000000..79cffa3
--- /dev/null
+++ b/debian/adplug-get-orig-source
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+# This script is used to download the upstream source for adplug and
+# generate it into an orig source tarball for Debian.
+
+# Common variables used to ease maintenance of this script
+ADPLUG_VERSION="2.2.1"
+ADPLUG_TARBALL="adplug-$ADPLUG_VERSION.tar.gz"
+ADPLUG_TARBALL_CHECKSUM="513f8169facec0d88106a99140eaf7c9b5b64cec51af215df36c14636097d2fe"
+ADPLUG_ORIG_TARBALL="adplug_$ADPLUG_VERSION.dfsg1.orig.tar.gz"
+USAGE="\n\
+This script is used to generate the orig tarball used in building\n\
+Debian packages for adplug-$ADPLUG_VERSION.\n\
+Usage: adplug-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 $ADPLUG_TARBALL ] || \
+        wget -c http://downloads.sourceforge.net/adplug/$ADPLUG_TARBALL
+
+    # Verify the checksum
+    COMPUTED_CHECKSUM=`sha256sum $ADPLUG_TARBALL | cut -d ' ' -f 1`
+    if [ $ADPLUG_TARBALL_CHECKSUM != $COMPUTED_CHECKSUM ] ; then
+        echo "Checksum verification failed. Checksum was $COMPUTED_CHECKSUM
+    Expected checksum $ADPLUG_TARBALL_CHECKSUM."
+        exit 1
+    else
+        echo "Checksum verified. Checksum is $COMPUTED_CHECKSUM."
+    fi
+
+    # Extract tarball
+    echo "Extracting tarball and running 'autoreconf -vif'"
+    tar -zxf $ADPLUG_TARBALL
+
+    # Fixup build system so 'test' directory won't be used.
+    sed -i adplug-$ADPLUG_VERSION/configure.in -e 's| \+test/Makefile \+| |'
+    sed -i adplug-$ADPLUG_VERSION/Makefile.am -e 's| \+test||'
+
+    # Run autoreconf in directory
+    autoreconf -vif adplug-$ADPLUG_VERSION
+
+    # 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 adplug-$ADPLUG_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 "{}" \; \) \)
+
+    # Remove 'test' directory which contains non-free files.
+    rm -rf adplug-$ADPLUG_VERSION/test
+
+    # Remove empty directories
+    echo "Removing empty directories"
+    find adplug-$ADPLUG_VERSION -type d -empty -delete
+
+    # Repack tarball to final orig tarball
+    echo "Creating orig tarball"
+    tar --exclude-vcs -zcf "$ADPLUG_ORIG_TARBALL" "adplug-$ADPLUG_VERSION/"
+}
+
+make_current_tarball

-- 
adplug packaging



More information about the pkg-multimedia-commits mailing list