[SCM] Debian packaging of Dancer CPAN distribution branch, master, updated. debian/0.03-1-9-g9c1ec90

gregor herrmann gregoa at debian.org
Sun Jun 16 13:58:25 UTC 2013


The following commit has been merged in the master branch:
commit e9b62c1fe2174a4aa530cafdeb91534604724a93
Author: gregor herrmann <gregoa at debian.org>
Date:   Sun Jun 16 15:34:59 2013 +0200

    This release contains script/dancer2.
    
    Add repacking framework from libdancer-perl to get rid of uuencoded images
    and use the local jquery library.
    
    Recommend libjs-jquery
    Add copyright/license for script/dancer2.

diff --git a/debian/control b/debian/control
index 53ad4f3..5eea36f 100644
--- a/debian/control
+++ b/debian/control
@@ -51,7 +51,8 @@ Depends: ${misc:Depends},
          liburi-perl,
          libyaml-perl,
          perl (>= 5.13.8)
-Recommends: libjson-xs-perl,
+Recommends: libjs-jquery,
+            libjson-xs-perl,
             libmath-random-isaac-xs-perl
 Description: lightweight yet powerful web application framework
  Dancer2 is the new generation lightweight web-framework for Perl. It's a
diff --git a/debian/copyright b/debian/copyright
index 7d4b713..cf8f704 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,6 +2,14 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: Dancer
 Source: https://metacpan.org/release/Dancer2/
 Upstream-Contact: Alexis Sukrieh <sukria at sukria.net>
+Comment: The upstream sources were repackaged in order to:
+ (1) not ship uuencoded images embedded in the dancer script
+     this would violate the requirement to ship the preferred form for
+     modifications
+ (2) make use of packaged jquery.js by default
+ .
+ The +dfsg tarball can be created using the repack.sh script (via
+ repack.stub) and is automatically run on upgrade by uscan.
 
 Files: *
 Copyright: 2013, Alexis Sukrieh <sukria at sukria.net>
@@ -18,10 +26,26 @@ Copyright: 2010, Mark R. Allen
 License: Artistic-2.0 or GPL-2
 Comment: the css file mentioned there doesn't exist
 
+Files: script/dancer2
+Copyright: 2013, Alexis Sukrieh <sukria at sukria.net>
+License: Artistic or GPL-1+
+Comment: includes jQuery minified:
+ Copyright: 2010, John Resig
+ License: MIT or GPL-2
+ Comment: in the jQuery part:
+  * Includes Sizzle.js
+  * http://sizzlejs.com/
+  * Copyright 2010, The Dojo Foundation
+  * Released under the MIT, BSD, and GPL Licenses.
+
 Files: debian/*
 Copyright: 2013, gregor herrmann <gregoa at debian.org>
 License: Artistic or GPL-1+
 
+Files: debian/repack.stub
+Copyright: 2009, Ryan Niebur <ryan at debian.org>
+License: Artistic or GPL-1+
+
 License: Artistic
  This program is free software; you can redistribute it and/or modify
  it under the terms of the Artistic License, which comes with Perl.
diff --git a/debian/prune.pl b/debian/prune.pl
new file mode 100644
index 0000000..92d3373
--- /dev/null
+++ b/debian/prune.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+s/(?<="jquery.js" => )FILE/\\\&link_jquery/;
+
+print <<'EOT' if /^sub jquery_minified/;
+sub link_jquery {
+    my $path = shift;
+
+    my $target = '/usr/share/javascript/jquery/jquery.js';
+
+    if ( -e $target ) {
+        symlink( $target, $path ) or die "symlink($target, $path): $!\n";
+    }
+    else {
+        # fallback to the embedded copy
+        jquery_minified($path);
+    }
+}
+
+EOT
+
+print $_
+    if not /^sub write_bg/ .. /^\}/
+        and not /^sub write_logo/ .. /\}/
+        and not /^sub write_favicon/ .. /\}/
+        and not /write_bg/
+        and not /write_logo/
+        and not /write_favicon/
+        and not /ajax.googleapis.com/
+        and not /Grab Google/;
diff --git a/debian/repack.local b/debian/repack.local
new file mode 100644
index 0000000..1865c42
--- /dev/null
+++ b/debian/repack.local
@@ -0,0 +1,3 @@
+perl -wn $MYORIGPWD/debian/prune.pl < script/dancer2 > script/dancer2.pruned
+
+mv script/dancer2.pruned script/dancer2
diff --git a/debian/repack.stub b/debian/repack.stub
new file mode 100755
index 0000000..4d68667
--- /dev/null
+++ b/debian/repack.stub
@@ -0,0 +1,88 @@
+#!/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
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2009, Ryan Niebur <ryan at debian.org>
+
+License: Artistic or GPL-1+
+
+=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" "$@"
diff --git a/debian/watch b/debian/watch
index 10cbdbe..e5dc030 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,4 @@
 version=3
-https://metacpan.org/release/Dancer2/   .*/Dancer2-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
+opts="dversionmangle=s/\+dfsg//" \
+https://metacpan.org/release/Dancer2/   .*/Dancer2-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ \
+debian sh debian/repack.stub

-- 
Debian packaging of Dancer CPAN distribution



More information about the Pkg-perl-cvs-commits mailing list