[med-svn] [spaced] 02/07: Repackage upstream

Fabian Klötzl kloetzl-guest at moszumanska.debian.org
Thu Mar 24 11:09:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

kloetzl-guest pushed a commit to branch master
in repository spaced.

commit c477036ddc76d55b66478f42e8a8db367de6f69b
Author: Fabian Klötzl <fabian at kloetzl.info>
Date:   Thu Mar 24 11:52:58 2016 +0100

    Repackage upstream
---
 debian/changelog       |  2 +-
 debian/copyright       |  1 +
 debian/get-orig-source | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index fc2adb7..c5b21f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-spaced (1.0.2-1) unstable; urgency=medium
+spaced (1.0.2+dfsg-1) unstable; urgency=medium
 
   * Initial release (Closes: #81562)
   * Remove the precompiled binary
diff --git a/debian/copyright b/debian/copyright
index 890a7bf..bd2e0ee 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,7 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: spaced
 Source: http://spaced.gobics.de/content/spaced-protein_dna.tar.gz
+Files-Excluded: spaced
 
 Files: *
 Copyright: © 2015 Lars Hahn <lars.hahn at stud.uni-goettingen.de>
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..cef1b8d
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,59 @@
+#!/bin/sh -f
+
+# Upstream produces srsly broken releases. Until that is fixed, this script
+# will be used. It downloads the original tarball, removes prebuild binary,
+# assings a proper version tag and then repacks.
+
+# FIXME: currently the code is not conform to Debian Policy
+#        http://www.debian.org/doc/debian-policy/ch-source.html
+#        "get-orig-source (optional)"
+#        This target may be invoked in any directory, ...
+# --> currently it is assumed the script is called in the
+#     source directory featuring the debian/ dir
+
+COMPRESS=xz
+
+set -e
+NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+
+if ! echo $@ | grep -q upstream-version ; then
+    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+else
+    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
+    if echo "$VERSION" | grep -q "upstream-version" ; then
+        echo "Unable to parse version number"
+        exit
+    fi
+fi
+
+SOURCE_URL=`awk '/^Source/ {print $2}' cat debian/copyright`
+EXCLUDE=`grep 'Files-Excluded' debian/copyright | cut -d' ' -f2-`
+UPSTREAMTARBALL="spaced-protein_dna.tar.gz"
+
+
+wget SOURCE_URL
+
+mkdir -p ../tarballs
+rm -rf ../tarballs/*
+
+OLDPWD=$PWD
+
+cd ../tarballs
+mkdir "spaced-legacy"
+tar -xaf $OLDPWD/${UPSTREAMTARBALL} -C spaced-legacy
+
+# Fix upstreams non-Gnu naming scheme
+TARDIR=${NAME}-${VERSION}
+UPSTREAMTARDIR=`find . -mindepth 1 -maxdepth 1 -type d`
+if [ "${UPSTREAMTARDIR}" != "${TARDIR}" ] ; then
+    mv "${UPSTREAMTARDIR}" "${TARDIR}"
+fi
+
+# Remove useless binaries
+(cd "${TARDIR}" && rm -f ${EXCLUDE})
+
+# rebuild package
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
+rm -rf ${TARDIR}
+
+mv "$NAME"_"$VERSION".orig.tar.${COMPRESS} ..

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/spaced.git



More information about the debian-med-commit mailing list