[Debian-islamic-commits] [SCM] Packaging for Zekr branch, master, updated. debian/0.7.5+repack-2-6-g400dfa4

أحمد المحمودي (Ahmed El-Mahmoudy) aelmahmoudy at sabily.org
Tue Jun 22 07:13:12 UTC 2010


The following commit has been merged in the master branch:
commit ab85890968c16d77b25de56800c8e9f616341898
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date:   Tue Jun 22 09:29:33 2010 +0300

    * Added a script debian/zekr_repack to repack the upstream tarball.
    * debian/watch: call debian/zekr_repack after downloading upstream
      tarball.

diff --git a/debian/watch b/debian/watch
index 91c82c7..da7d902 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,4 @@
 version=3
 
 opts="dversionmangle=s/~//;s/\+repack//,uversionmangle=s/([a-z]+)/~\1/," \
-  http://sf.net/zekr/zekr-(.*)-linux\.tar\.gz
+  http://sf.net/zekr/zekr-(.*)-linux\.tar\.gz debian ./debian/zekr_repack
diff --git a/debian/zekr_repack b/debian/zekr_repack
new file mode 100755
index 0000000..74681f9
--- /dev/null
+++ b/debian/zekr_repack
@@ -0,0 +1,103 @@
+#!/bin/bash --
+
+set -e
+
+. /usr/share/javahelper/jh_lib.sh
+
+syntax()
+{
+   echo -e "Usage: jh_repack --upstream-version <version> <orig.tar.gz>"
+   echo -e "Options:"
+   echo -e "\t-h --help: show this text"
+   echo -e "\t-V --version: show the version"
+   echo -e "\t-v --verbose: show more information while running"
+   echo -e "\t-n --no-act: don't actually do anything, just print the results"
+   exit 1
+}
+
+ARGS="upstream-version v verbose n no-act" parseargs "$@"
+
+VERBOSE="`getarg v verbose`"
+
+if [ "$ARGC" != "2" ] ; then
+	syntax
+	exit 1
+fi
+
+VERSION=${ARGV[0]}
+TARBALL="`realpath "${ARGV[1]}"`"
+
+TMPDIR=`mktemp -d`
+
+cd "$TMPDIR"
+
+if [ -n "$VERBOSE" ]; then
+	echo "Repacking tarball $TARBALL"
+fi
+if [ -n "`getarg n no-act`" ]; then
+	echo "Would repack $TARBALL"
+	exit 0
+fi
+
+if grep tar.gz$ <<< $TARBALL &>/dev/null; then
+	TYPE=gzip
+	tar zxf "$TARBALL"
+elif grep tar.bz2$ <<< $TARBALL &>/dev/null; then
+	TYPE=bzip2
+	tar jxf "$TARBALL"
+elif grep zip$ <<< $TARBALL &>/dev/null; then
+	TYPE=zip
+	unzip -qq "$TARBALL"
+else
+	echo "Do not know how to unpack $TARBALL (expecting tar.gz, tar.bz2 or zip)"
+fi
+
+SUBDIR=
+if [ "`ls -1 | wc -l`" = "1" ]; then
+	cd *
+	SUBDIR=true
+fi
+
+find . -type f -print0 | xargs -0 chmod -f 644
+find . -type d -print0 | xargs -0 chmod -f 755
+chmod 755 zekr.sh
+rm res/*.ttf res/text/trans/yusufali.trans.zip -f
+rm -f res/image/sura-header.png
+sed -i 's/trans.default *= *yusufali/trans.default = transliteration-en/i' res/config/config.properties
+mkdir src
+unzip dist/zekr-src.jar -d src/
+find . -name '*.class' -print0 | xargs -0 rm -f
+find . -name '*.jar' -print0 | xargs -0 rm -f
+
+IFS='
+'
+for doctree in `find . -name allclasses-frame.html`; do
+TREE="`dirname $doctree`"
+rm -rf "$TREE"/*
+done
+find * -type d -print0 | xargs -0 rmdir -p --ignore-fail-on-non-empty
+
+if [ -n "$SUBDIR" ]; then
+	cd ..
+fi
+
+rm -f "$TARBALL"
+
+case "$TYPE" in 
+gzip)
+	tar zcf "$TARBALL" *
+	;;
+bzip2)
+	tar jcf "$TARBALL" *
+	;;
+zip)
+	tar zcf "${TARBALL%.zip}.tar.gz" *
+	;;
+esac
+
+cd /
+rm -rf "$TMPDIR"
+
+if [ -n "$VERBOSE" ]; then
+	echo "done"
+fi

-- 
Packaging for Zekr



More information about the Debian-islamic-commits mailing list