r73761 - in /trunk/libtext-levenshteinxs-perl/debian: ./ changelog compat control copyright hgpkg libtext-levenshteinxs-perl.docs rules source/ source/format source/options watch

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Thu Apr 28 23:55:33 UTC 2011


Author: gregoa
Date: Thu Apr 28 23:55:25 2011
New Revision: 73761

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73761
Log:
[svn-inject] Applying Debian modifications (0.03-1) to trunk

Added:
    trunk/libtext-levenshteinxs-perl/debian/
    trunk/libtext-levenshteinxs-perl/debian/changelog
    trunk/libtext-levenshteinxs-perl/debian/compat
    trunk/libtext-levenshteinxs-perl/debian/control
    trunk/libtext-levenshteinxs-perl/debian/copyright
    trunk/libtext-levenshteinxs-perl/debian/hgpkg   (with props)
    trunk/libtext-levenshteinxs-perl/debian/libtext-levenshteinxs-perl.docs
    trunk/libtext-levenshteinxs-perl/debian/rules   (with props)
    trunk/libtext-levenshteinxs-perl/debian/source/
    trunk/libtext-levenshteinxs-perl/debian/source/format
    trunk/libtext-levenshteinxs-perl/debian/source/options
    trunk/libtext-levenshteinxs-perl/debian/watch

Added: trunk/libtext-levenshteinxs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/changelog?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/changelog (added)
+++ trunk/libtext-levenshteinxs-perl/debian/changelog Thu Apr 28 23:55:25 2011
@@ -1,0 +1,5 @@
+libtext-levenshteinxs-perl (0.03-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Adrian von Bidder <cmot at debian.org>  Wed, 6 Apr 2011 13:54:19 +0200

Added: trunk/libtext-levenshteinxs-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/compat?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/compat (added)
+++ trunk/libtext-levenshteinxs-perl/debian/compat Thu Apr 28 23:55:25 2011
@@ -1,0 +1,1 @@
+7

Added: trunk/libtext-levenshteinxs-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/control?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/control (added)
+++ trunk/libtext-levenshteinxs-perl/debian/control Thu Apr 28 23:55:25 2011
@@ -1,0 +1,23 @@
+Source: libtext-levenshteinxs-perl
+Section: perl
+Priority: optional
+Build-Depends: debhelper (>= 7),
+ perl
+Maintainer: Adrian von Bidder <cmot at debian.org>
+Standards-Version: 3.9.1
+Homepage: http://search.cpan.org/dist/Text-LevenshteinXS/
+Vcs-Browser: https://fortytwo.ch/hg/avbidder/pkg-libtext-levenshteinxs-perl
+Vcs-Hg: https://fortytwo.ch/hg/avbidder/pkg-libtext-levenshteinxs-perl
+
+Package: libtext-levenshteinxs-perl
+Architecture: any
+Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
+Description: An XS implementation of the Levenshtein edit distance
+ Text::LevenshteinXS implements the Levenshtein edit distance in a XS way; this
+ should be much faster than the pure Perl implementation.
+ .
+ The Levenshtein edit distance is a measure of the degree of proximity between
+ two strings. This distance is the number of substitutions, deletions or
+ insertions ("edits") needed to transform one string into the other one (and
+ vice versa). When two strings have distance 0, they are the same. A good
+ point to start is: <http://www.merriampark.com/ld.htm>

Added: trunk/libtext-levenshteinxs-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/copyright?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/copyright (added)
+++ trunk/libtext-levenshteinxs-perl/debian/copyright Thu Apr 28 23:55:25 2011
@@ -1,0 +1,38 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Copyright 2003 Dree Mistrut <dree at friul.it>
+    Modifications Copyright 2004 Josh Goldberg <josh at 3io.com>
+    .
+    This package is free software and is provided "as is" without express
+    or implied warranty.  You can redistribute it and/or modify it under 
+    the same terms as Perl itself.
+Source: http://search.cpan.org/dist/Text-LevenshteinXS/
+Name: Text-LevenshteinXS
+
+Files: *
+Copyright: Copyright 2003 Dree Mistrut <dree at friul.it>
+    Modifications Copyright 2004 Josh Goldberg <josh at 3io.com>
+    .
+    This package is free software and is provided "as is" without express
+    or implied warranty.  You can redistribute it and/or modify it under 
+    the same terms as Perl itself.
+License: Artistic or GPL-1+
+
+Files: debian/*
+Copyright: 2011, Adrian von Bidder <cmot 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.
+ .
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
+
+License: GPL-1+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.

Added: trunk/libtext-levenshteinxs-perl/debian/hgpkg
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/hgpkg?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/hgpkg (added)
+++ trunk/libtext-levenshteinxs-perl/debian/hgpkg Thu Apr 28 23:55:25 2011
@@ -1,0 +1,202 @@
+#! /bin/bash
+#
+# ©2009 Adrian von Bidder
+#
+# Manage Debian packages stored in Mercurial repositories.
+# Included here since it's not packaged at this time
+# hgpkg version 1.2.1
+#
+
+set -e
+#set -x
+
+###
+# general helpers
+
+function onlinehelp() {
+    echo "Commands:
+    import <path> <version>:    import new upstream source
+    buildfull:                  build the orig.tar.bz2 and the Debian package
+    build:                      build the Debian package
+    markdeb:                    tag a version (after upload)"
+}
+
+# get package name from Debian changelog and
+# check that 'hg st' generates no output
+function preparedir() {
+    lines=`hg st | wc -l`
+    if [ "$lines" != "0" ]; then
+        echo "Error: Mercurial repository is not clean."
+        exit 1
+    fi
+
+    branch=`hg branch`
+    if [ "$branch" == "upstream" ]; then
+        echo "Warning: called in upstream branch, switching to default."
+        hg update -r default >> "$LOG"
+        branch=`hg branch`
+    fi
+    if [ "$branch" != "default" ]; then
+        echo "Error: must be called in default branch of repository."
+        exit 1
+    fi
+
+    # need to be in root dir:
+    root=`hg root`
+    cd "$root"
+
+    PKGNAME=`dpkg-parsechangelog 2>> "$LOG" | grep ^Source: | cut -f  2 -d \ `
+    if [ -z "$PKGNAME" ]; then
+        echo "Error: can't find package name."
+        exit 1
+    fi
+}
+
+###
+# subcommands
+
+# import new upstream version from subversion
+function cmd_import() {
+    srcpath="$1"
+    srcver="$2"
+
+    # need to convert srcpath to an absolute path
+    if [ ! -d "$srcpath" ]; then
+        echo "Error: $srcpath doesn't exist."
+        rm -rf "$WORKDIR"
+        exit 1
+    fi
+    srcpath=`cd "$srcpath"; pwd`
+
+    # check: is source a svn dir?
+    if [ -d "$srcpath/.svn" ]; then
+        svn="yes"
+    fi
+
+    # switching to upstream may leave .hgignore'd files around that will then
+    # be included.  Work on a cloned repo instead:
+    hg clone . "$WORKDIR"/"$PKGNAME" >> "$LOG"
+    pushd . >/dev/null
+    cd "$WORKDIR"/"$PKGNAME"
+
+    # switch to upstream branch
+    hg update -r upstream >> "$LOG"
+    br=`hg branch`
+    if [ "$br" != "upstream" ]; then
+        echo "Unexpected: I'm not in the upstream branch after update!"
+        exit 1
+    fi
+
+    # check: do we already know about this version?
+    tag="UPSTREAM_${PKGNAME}_$srcver"
+    if hg tags | grep -q "$tag"; then
+        echo "Error: Version already imported: tag '$tag' already exists."
+        popd >/dev/null
+        rm -rf "$WORKDIR" # since this is just a user error...
+        exit 1
+    fi
+
+    # ok, now let's be brave:
+    # if we did right, we're at the root of the cloned repo
+    # at the tip of the upstream branch.
+    rm -rf ./*
+
+    # import (--force is needed because .hg dir is still in current dir.)
+    if [ "$svn" == "yes" ]; then
+        svn export --force "$srcpath" . >> "$LOG"
+    else
+        cp -r "$srcpath"/* .
+    fi
+
+    lines=`hg st | wc -l`
+    if [ "$lines" == "0" ]; then
+        echo "Error: no changes imported."
+        popd >/dev/null
+        rm -rf "$WORKDIR" # since this is just a user error...
+        exit 1
+    fi
+
+    # and commit
+    hg addremove
+    hg ci -m "hgpkg import: $PKGNAME $srcver"
+    hg tag "$tag"
+
+    # push upstream changes back into the working repo and merge
+    # usually creates a new head, so --force.
+    hg push -f >> "$LOG"
+    popd > /dev/null
+    # TODO: find a way to auto-fix the expected merge conflict in .hgtags
+    hg merge upstream || \
+        echo "Warning: merge failed."
+    dch -D UNRELEASED -v "$srcver-1" "New upstream version."
+    # TODO dch fails if version is older than last version.
+    #   Proper fix would be to check this right at the start of import...
+    #   Leaving this right now since dch fails loudly and the error message
+    #   seems clear enough.
+    echo "Success: default (Debian) branch left with ucommitted merge."
+}
+
+# build orig tar and build package
+function cmd_buildfull() {
+    # TODO use latest UPSTREAM tag instead? Or at least learn sed properly
+    #   and get rid of the separate grep.
+    upstream=`dpkg-parsechangelog \
+        | grep ^Version: | sed -e's/^Version: \(.*\)-.*/\1/'`
+
+    # use hg archive to build tar
+    archive="../${PKGNAME}_$upstream.orig.tar.gz"
+    rm -f "$archive"
+    hg update -r upstream >> "$LOG"
+    hg archive -t tgz -X .hgtags -p "$PKGNAME-$upstream" "$archive"
+
+    # run debuild
+    hg update -r default >> "$LOG"
+    cmd_build
+}
+
+# just build the Debian package, assume the orig exists and is up to date.
+function cmd_build() {
+    # we're in tip of "default" branch in a clean repository, and mercurial is
+    # in debuild's default ignore patterns
+    set +e
+    debuild -i -I
+}
+
+function cmd_markdeb() {
+    version=`dpkg-parsechangelog \
+        | grep ^Version: | sed -e's/^Version: \(.*\)/\1/'`
+    hg tag "DEBIAN_${PKGNAME}_$version"
+}
+
+###
+# main
+
+function main() {
+    cmd="$1"
+    shift || true
+    if [ "$cmd" == "import" -a -n "$1" -a -n "$2" ]; then
+        runcmd="cmd_import"
+    elif [ "$cmd" == "buildfull" ]; then
+        runcmd="cmd_buildfull"
+    elif [ "$cmd" == "build" ]; then
+        runcmd="cmd_build"
+    elif [ "$cmd" == "markdeb" ]; then
+        runcmd="cmd_markdeb"
+    else
+        onlinehelp
+        exit
+    fi
+
+    # for now: save output of certain commands
+    WORKDIR=`mktemp -t -d hgpkg.XXXX`
+    LOG="$WORKDIR/log"
+
+    preparedir
+
+    $runcmd "$@"
+
+    # on success:
+    rm -rf "$WORKDIR"
+}
+
+main "$@"

Propchange: trunk/libtext-levenshteinxs-perl/debian/hgpkg
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/libtext-levenshteinxs-perl/debian/libtext-levenshteinxs-perl.docs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/libtext-levenshteinxs-perl.docs?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/libtext-levenshteinxs-perl.docs (added)
+++ trunk/libtext-levenshteinxs-perl/debian/libtext-levenshteinxs-perl.docs Thu Apr 28 23:55:25 2011
@@ -1,0 +1,1 @@
+README

Added: trunk/libtext-levenshteinxs-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/rules?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/rules (added)
+++ trunk/libtext-levenshteinxs-perl/debian/rules Thu Apr 28 23:55:25 2011
@@ -1,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@

Propchange: trunk/libtext-levenshteinxs-perl/debian/rules
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/libtext-levenshteinxs-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/source/format?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/source/format (added)
+++ trunk/libtext-levenshteinxs-perl/debian/source/format Thu Apr 28 23:55:25 2011
@@ -1,0 +1,1 @@
+3.0 (quilt)

Added: trunk/libtext-levenshteinxs-perl/debian/source/options
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/source/options?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/source/options (added)
+++ trunk/libtext-levenshteinxs-perl/debian/source/options Thu Apr 28 23:55:25 2011
@@ -1,0 +1,1 @@
+single-debian-patch

Added: trunk/libtext-levenshteinxs-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-levenshteinxs-perl/debian/watch?rev=73761&op=file
==============================================================================
--- trunk/libtext-levenshteinxs-perl/debian/watch (added)
+++ trunk/libtext-levenshteinxs-perl/debian/watch Thu Apr 28 23:55:25 2011
@@ -1,0 +1,2 @@
+version=3
+http://search.cpan.org/dist/Text-LevenshteinXS/   .*/Text-LevenshteinXS-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$




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