[Pkg-mysql-commits] r2161 - mysql-5.5/branches/wheezy/debian

Nicholas Bamber periapt at alioth.debian.org
Sat Jun 16 12:57:42 UTC 2012


Author: periapt
Date: 2012-06-16 12:57:41 +0000 (Sat, 16 Jun 2012)
New Revision: 2161

Added:
   mysql-5.5/branches/wheezy/debian/README.source
   mysql-5.5/branches/wheezy/debian/repack.sh
Removed:
   mysql-5.5/branches/wheezy/debian/repack.stub
Modified:
   mysql-5.5/branches/wheezy/debian/changelog
   mysql-5.5/branches/wheezy/debian/copyright
   mysql-5.5/branches/wheezy/debian/watch
Log:
Made DFSG repacking mechanism independent of local installs, improved
the documentation and added debian/README.source

Added: mysql-5.5/branches/wheezy/debian/README.source
===================================================================
--- mysql-5.5/branches/wheezy/debian/README.source	                        (rev 0)
+++ mysql-5.5/branches/wheezy/debian/README.source	2012-06-16 12:57:41 UTC (rev 2161)
@@ -0,0 +1,40 @@
+DFSG and repacking
+==================
+The upstream source tarball from dev.mysql.com contains one file,
+Docs/mysq.info, that is not DFSG-compliant. We are currently using
+the mechanism that appears to be the closest thing to a Debian-wide
+DFSG-repacking mechanism - i.e. the scripts used by the Debian Perl
+Group. See #677270 for a request to make this (or something based
+upon it) a standard within Debian.
+
+To use this to download the current tarball (as indicated by debian/changelog)
+run 'fakeroot debian/rules get-orig-source' from within the top-level
+directory. If you are trying to build directly from the repository you
+will also need to unpack the tarball into the same top-level directory.
+
+Bugs: Beware of having upstream tarballs (with or without the
+non-DFSG material) in .. befrore running get-orig-source. It first downloads
+the unaltered file and then repacks to the new one. The process
+will stop if either file is present.
+
+MySQL source package
+====================
+The question arises why we have the mysql-source-* packages and why
+they are arch:any wasting so much space. This conversation covered the
+issue although it should probably be looked at again.
+
+(26/05/12 16:24:18) SpamapS: periapt: hey, are you 100% sure that mysql-source-5.5 is arch: all ?
+(16:24:37) SpamapS: periapt: It includes generated files.. some of which might be arch specific. I've never taken the time to make sure.
+(16:35:56) periapt: SpamapS: Actually that's a fair point - cmake output. But then I think we ought to drop it. I view it as duplication which I think is against Debian policy.
+(16:44:04) periapt: It seems to be some sort of hangover from when the licensing issues were much worse. It's popcorn rating is almost lower than the arches we support.
+(16:49:27) SpamapS: Nope, its needed for plugins
+(16:49:39) SpamapS: It is only useful as a build-dep
+(16:49:57) SpamapS: Now, I have been made aware of the fact that source format 3.0 allows multiple upstreams..
+(16:50:24) SpamapS: periapt: I created the package, and I use it as a build-dep for handlersocket.
+(16:50:54) SpamapS: periapt: perhaps we should add handlersocket as a second upstream source. That would eliminate the need for it.
+(16:55:21) periapt: SpamapS: I would advise against multiple upstream sources. I actually tried to write some debhelper stuff to maange it. I never got the uscan wrapper working and it's horrible: pkg-components.
+(16:56:23) SpamapS: periapt: then we cannot remove the mysql-source-* packages
+(16:56:57) periapt: I'll put it back to arch:any for now and update the long description. I notice there are already bugs that cover the issue of how to manage plugins. I think it should be revisited. 
+(16:57:30) SpamapS: periapt: perhaps the clarity from this discussion belongs in README.source too :)
+(16:57:40) periapt: okay
+(16:58:15) periapt: Actually I would prefer the FAQ: http://wiki.debian.org/Teams/MySQL/FAQ

Modified: mysql-5.5/branches/wheezy/debian/changelog
===================================================================
--- mysql-5.5/branches/wheezy/debian/changelog	2012-06-16 12:53:08 UTC (rev 2160)
+++ mysql-5.5/branches/wheezy/debian/changelog	2012-06-16 12:57:41 UTC (rev 2161)
@@ -1,3 +1,10 @@
+mysql-5.5 (5.5.24+dfsg-4) UNRELEASED; urgency=low
+
+  * Made DFSG repacking mechanism independent of local installs, improved
+    the documentation and added debian/README.source
+
+ -- Nicholas Bamber <nicholas at periapt.co.uk>  Sat, 16 Jun 2012 13:53:35 +0100
+
 mysql-5.5 (5.5.24+dfsg-3) unstable; urgency=high
 
   * Added versioned dependency on initscripts and revert /var/run

Modified: mysql-5.5/branches/wheezy/debian/copyright
===================================================================
--- mysql-5.5/branches/wheezy/debian/copyright	2012-06-16 12:53:08 UTC (rev 2160)
+++ mysql-5.5/branches/wheezy/debian/copyright	2012-06-16 12:57:41 UTC (rev 2161)
@@ -5,6 +5,7 @@
 Comments:
  The file Docs/mysql.info is removed from the upstream source
  because it is incompatible with the Debian Free Software Guidelines.
+ See debian/README.source for how this repacking was done.
  .
  Originally produced by a modified version of licensecheck2dep5
  from CDBS by Clint Byrum <clint at ubuntu.com>. Hand modified to reduce 

Added: mysql-5.5/branches/wheezy/debian/repack.sh
===================================================================
--- mysql-5.5/branches/wheezy/debian/repack.sh	                        (rev 0)
+++ mysql-5.5/branches/wheezy/debian/repack.sh	2012-06-16 12:57:41 UTC (rev 2161)
@@ -0,0 +1,161 @@
+#!/bin/sh
+
+# see the repack.stub for how to use
+
+# TODO: provide example watch files and repack.locals
+# TODO: test suite. problems fixed that need to be tested:
+# * globbing
+# * whitespace and then comments in the MANIFEST
+# TODO: does / in weird places work? test suite too.
+# TODO: I actually broke stuff with the MANIFEST change not thinking..
+# TODO: allow for a sepearate (and multiple) MANIFEST files, then
+# de-uglify libsyntax-highlight-engine-kate-perl.
+# TODO: have each mv and rm check that something actually changed, and
+# if not, die
+
+set -e
+set -u
+
+usage() {
+    echo "Usage: repack.sh --upstream-version <ver> <downloaded file>"
+    exit 1
+}
+
+if [ "$#" != "3" ]; then
+    usage
+fi
+if [ "$1" != "--upstream-version" ]; then
+    usage
+fi
+if [ ! -f "$3" ]; then
+    if [ -n "$3" ]; then
+        echo "$3 doesn't exist"
+    fi
+    usage
+fi
+VER="$2"
+FILE="$3"
+PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
+
+SUFFIX="+dfsg"
+
+echo
+echo "Repackaging $FILE"
+echo
+
+DIR=`mktemp -d ./tmpRepackXXXXXX`
+DIR=$(readlink -f "$DIR")
+trap "/bin/rm -rf \"$DIR\"" QUIT INT EXIT
+
+# Create an extra directory to cope with rootless tarballs
+UP_BASE="$DIR/unpack"
+mkdir "$UP_BASE"
+tar xf "$FILE" -C "$UP_BASE" || unzip "$FILE" -d "$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
+
+RM_OPTS="-vrf"
+
+real_rm(){
+    /bin/rm "$@"
+}
+
+real_mv(){
+    /bin/mv "$@"
+}
+
+rm(){
+    set +f
+    MYOLDPWD=$(pwd)
+    cd "$UP_BASE"
+    if [ "$MANIFEST" = "1" ]; then
+        PERM=$(stat --format=%a "MANIFEST")
+        chmod u+w "MANIFEST"
+    fi
+    for i in $@; do
+        if [ "$MANIFEST" = "1" ]; then
+            PATTERN="^$i"
+            if [ -d "$i" ]; then
+                if ! { echo "$PATTERN" | grep -q "/$" ; }; then
+                    PATTERN="${PATTERN}/"
+                fi
+            else
+                PATTERN="${PATTERN}\s?"
+            fi
+            grep -Ev "$PATTERN" "MANIFEST" > "$DIR/MANIFEST"
+            real_mv "$DIR/MANIFEST" "MANIFEST"
+        fi
+        real_rm "$RM_OPTS" "$i"
+    done
+    if [ "$MANIFEST" = "1" ]; then
+        chmod $PERM "MANIFEST"
+    fi
+    cd $MYOLDPWD
+    set -f
+}
+
+mv(){
+    set +f
+    OLD=$(pwd)
+    cd $UP_BASE
+    real_mv "$@"
+    cd $OLD
+    if [ "$MANIFEST" = "1" ]; then
+        echo "MANIFEST cannot be manipulated with mv yet, patches welcome"
+        exit 1
+    fi
+    set -f
+}
+
+# bump with incompatible changes
+REPACK_VERSION=3
+
+requires_version(){
+    if [ $REPACK_VERSION -lt $1 ]; then
+        echo "repack.sh is not up to date enough for this package. you need at least version $1, while this script is only version $REPACK_VERSION"
+        exit 1
+    fi
+}
+
+MANIFEST=0
+## Remove stuff
+set -f
+MYORIGPWD=$(pwd)
+cd "$UP_BASE"
+. "$MYORIGPWD/debian/repack.local"
+cd $MYORIGPWD
+set +f
+## End
+
+REPACK_DIR="$PKG-${VER}${SUFFIX}.orig" # DevRef § 6.7.8.2
+DFSG_TAR="$(dirname $FILE)/${PKG}_${VER}${SUFFIX}.orig.tar"
+
+real_mv "$UP_BASE" "$DIR/$REPACK_DIR"
+
+# .gz or .bz2?
+FILETYPE=$(file --brief --mime-type --dereference "$FILE")
+case "$FILETYPE" in
+    application/x-gzip|application/zip)
+        C_PROGRAM="gzip"
+        C_SUFFIX="gz"
+        ;;
+    application/x-bzip2)
+        C_PROGRAM="bzip2"
+        C_SUFFIX="bz2"
+        ;;
+    *)
+        echo "E: Unknown filetye $FILETYPE"
+        exit 1
+        ;;
+esac
+    
+# Using a pipe hides tar errors!
+tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
+$C_PROGRAM -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.$C_SUFFIX"
+
+real_mv "$DIR/repacked.tar.$C_SUFFIX" "$DFSG_TAR.$C_SUFFIX"
+
+echo "*** $DFSG_TAR.$C_SUFFIX ready"

Deleted: mysql-5.5/branches/wheezy/debian/repack.stub
===================================================================
--- mysql-5.5/branches/wheezy/debian/repack.stub	2012-06-16 12:53:08 UTC (rev 2160)
+++ mysql-5.5/branches/wheezy/debian/repack.stub	2012-06-16 12:57:41 UTC (rev 2161)
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-: <<=cut
-=pod
-
-=head1 NAME
-
-repack.stub - script to repack upstream tarballs from uscan
-
-=head1 INSTRUCTIONS
-
-put this in debian/repack.stub and add "debian sh debian/repack.stub" to
-the end of the line in debian/watch. you will also need to add a version
-mangle to debian/watch.
-
-then create a debian/repack.local. this is a shell script that is
-sourced under "set -e", so be careful to check returns codes.
-
-=head1 FUNCTIONS
-
-=over 4
-
-=item rm
-
-rm is replaced by a function that does some magic ("rm -rv" by default), but also changes MANIFEST if $MANIFEST is 1
-
-=item mv
-
-mv is replaced by a function that just does mv (by default), but also changes MANIFEST if $MANIFEST is 1
-
-=item requires_version
-
-requires_version is there for future usage for requiring certain versions of the script
-
-=back
-
-=head1 VARIABLES
-
-=over 4
-
-=item SUFFIX
-
-defaults to +dfsg
-
-what to append to the upstream version
-
-=item RM_OPTS
-
-defaults to -vrf
-
-options to pass to rm
-
-=item MANIFEST
-
-defaults to 0, set to 1 to turn on.
-
-this will manipulate MANIFEST files in CPAN tarballs.
-
-=item UP_BASE
-
-this is the directory where the upstream source is.
-
-=back
-
-=cut
-
-if [ -z "$REPACK_SH" ]; then
-    if [ -f ../../scripts/repack.sh ]; then
-        REPACK_SH=../../scripts/repack.sh
-    fi
-    if [ -z "$REPACK_SH" ] && which repack.sh > /dev/null; then
-        REPACK_SH=$(which repack.sh)
-    fi
-fi
-
-if [ ! -f "$REPACK_SH" ]; then
-    echo "Couldn't find a repack.sh. please put it in your PATH, put it at ../../scripts/repack.sh, or put it somewhere else and set the REPACK_SH variable"
-    echo "You can get it from http://anonscm.debian.org/gitweb/?p=pkg-perl/scripts.git;a=blob_plain;f=repack.sh;hb=HEAD"
-    exit 1
-fi
-
-exec "$REPACK_SH" "$@"

Modified: mysql-5.5/branches/wheezy/debian/watch
===================================================================
--- mysql-5.5/branches/wheezy/debian/watch	2012-06-16 12:53:08 UTC (rev 2160)
+++ mysql-5.5/branches/wheezy/debian/watch	2012-06-16 12:57:41 UTC (rev 2161)
@@ -1,9 +1,8 @@
-# This watch file depends on repack.sh being in your PATH.
-# See http://anonscm.debian.org/gitweb/?p=pkg-perl/scripts.git;a=blob_plain;f=repack.sh;hb=HEAD
+# See debian/README.source for more information about the DFSG repacking here.
 version=3
 opts=dversionmangle=s/\+dfsg\d*$// \
     http://mysql.linux.cz/Downloads/MySQL-5.5/mysql-([\d\.]+).tar.gz \
-    debian sh debian/repack.stub
+    debian sh debian/repack.sh
 opts=dversionmangle=s/\+dfsg\d*$// \
     http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.5/mysql-([\d\.]+).tar.gz \
-    debian sh debian/repack.stub
+    debian sh debian/repack.sh




More information about the Pkg-mysql-commits mailing list