[DRE-commits] r4185 - trunk/merb/debian

Joshua Timberman jtimberman-guest at alioth.debian.org
Sat Sep 19 21:17:15 UTC 2009


Author: jtimberman-guest
Date: 2009-09-19 21:17:15 +0000 (Sat, 19 Sep 2009)
New Revision: 4185

Added:
   trunk/merb/debian/repack.sh
Modified:
   trunk/merb/debian/changelog
   trunk/merb/debian/watch
Log:
add repack.sh to repack merb source tarball

Modified: trunk/merb/debian/changelog
===================================================================
--- trunk/merb/debian/changelog	2009-09-19 20:04:14 UTC (rev 4184)
+++ trunk/merb/debian/changelog	2009-09-19 21:17:15 UTC (rev 4185)
@@ -1,9 +1,5 @@
 merb (1.0.12+dfsg-2) UNRELEASED; urgency=low
 
-Problems:
-watch file needs rewrite to grab the source, unpack, and delete things that 
-don't have a clear licence statement, and repack
-
    * Packaging approved for Ubuntu, updating for Debian.
    * Rename merb-slices binary from slice to merb-slice.
    * Repack upstream tarball, should not affect Debian packaging but noted:

Added: trunk/merb/debian/repack.sh
===================================================================
--- trunk/merb/debian/repack.sh	                        (rev 0)
+++ trunk/merb/debian/repack.sh	2009-09-19 21:17:15 UTC (rev 4185)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Repackage upstream source to exclude non-distributable files
+# should be called as "repack.sh --upstream-source <ver> <downloaded file>
+# (for example, via uscan)
+
+set -e
+set -u
+
+VER="$2debian"
+FILE="$3"
+PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
+
+REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2
+
+echo -e "\nRepackaging $FILE\n"
+
+DIR=`mktemp -d ./tmpRepackXXXXXX`
+trap "rm -rf \"$DIR\"" QUIT INT EXIT
+
+# Create an extra directory to cope with rootless tarballs
+UP_BASE="$DIR/unpack"
+mkdir "$UP_BASE"
+tar xzf "$FILE" -C "$UP_BASE"
+
+if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
+        # Tarball does contain a root directory
+        UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`"
+fi
+
+## Remove stuff
+rm -vfr $UP_BASE/merb-core/docs/merb-core-call-stack-diagram.pdf
+rm -vfr $UP_BASE/merb-core/spec/public/core_ext/fixtures/gems
+rm -vfr $UP_BASE/merb-core/spec10/public/webrat/test_app/gems
+## End
+
+mv "$UP_BASE" "$DIR/$REPACK_DIR"
+
+# Using a pipe hides tar errors!
+tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
+gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz"
+FILE="../${PKG}_${VER}.orig.tar.gz"
+mv "$DIR/repacked.tar.gz" "$FILE"
+
+echo "*** $FILE repackaged"

Modified: trunk/merb/debian/watch
===================================================================
--- trunk/merb/debian/watch	2009-09-19 20:04:14 UTC (rev 4184)
+++ trunk/merb/debian/watch	2009-09-19 21:17:15 UTC (rev 4185)
@@ -1,2 +1,3 @@
 version=3
-http://githubredir.debian.net/github/wycats/merb /(.*).tar.gz
+options="dversionmangle=s/debian//" \
+http://githubredir.debian.net/github/wycats/merb /(.*).tar.gz debian debian/repack.sh




More information about the Pkg-ruby-extras-commits mailing list