sync the /debian dir with the one in precise (with a couple of changes), because...
[deb_libcec.git] / debian / libcec-get-orig-source
diff --git a/debian/libcec-get-orig-source b/debian/libcec-get-orig-source
new file mode 100755 (executable)
index 0000000..a17a7d3
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Script used to generate the orig source tarball for libcec.
+
+LIBCEC_GIT_URL="git://github.com/Pulse-Eight/libcec.git"
+LIBCEC_GIT_BRANCH="release"
+LIBCEC_VERSION="1.6.1"
+
+rm -rf "libcec-${LIBCEC_VERSION}"
+git clone "$LIBCEC_GIT_URL" "libcec-${LIBCEC_VERSION}"
+cd "libcec-${LIBCEC_VERSION}"
+git checkout -b "$LIBCEC_GIT_BRANCH" origin/"$LIBCEC_GIT_BRANCH"
+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 libcec-${LIBCEC_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 -rf libcec-${LIBCEC_VERSION}/.git
+rm -f libcec-${LIBCEC_VERSION}/.gitignore
+rm -rf libcec-${LIBCEC_VERSION}/debian
+
+# Remove empty directories
+echo "Removing empty directories"
+find libcec-${LIBCEC_VERSION} -type d -empty -delete
+
+tar --exclude-vcs -czf "libcec_${LIBCEC_VERSION}.orig.tar.gz" \
+  "libcec-${LIBCEC_VERSION}/"