[SCM] Debian packaging of Text-BibTeX CPAN distribution branch, master, updated. upstream/0.62-29-ge8540b0

David Bremner bremner at debian.org
Sun Mar 4 01:10:34 UTC 2012


The following commit has been merged in the master branch:
commit 3ca5f3e7003bedcf232984727de909f68c678c1f
Author: David Bremner <bremner at debian.org>
Date:   Sat Mar 3 16:29:11 2012 -0400

    re-export patches, add two new patches
    
    two new patches, both related to dynamic linking:
    
        add a proper SONAME to the shared library
        remove rpath from installed binaries.
    
    These should both be forwarded upstream once we are happy with them
    
    I know this format isn't strictly DEP3, but it's pretty close and I
    find it much more efficient to be able to import and export patches
    from git.

diff --git a/debian/patches/0001-Fix-spelling-errors.patch b/debian/patches/0001-Fix-spelling-errors.patch
new file mode 100644
index 0000000..97a2493
--- /dev/null
+++ b/debian/patches/0001-Fix-spelling-errors.patch
@@ -0,0 +1,30 @@
+From: David Bremner <bremner at debian.org>
+Date: Sat, 3 Mar 2012 16:07:36 -0400
+Subject: Fix spelling errors.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Origin: vendor
+Forwarded: no
+Author: Julián Moreno Patiño <darkjunix at gmail.com>
+Last-Update: 2011-11-05
+
+(DEP3 header pushed into git comment by db)
+---
+ lib/Text/BibTeX/Structure.pm |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/Text/BibTeX/Structure.pm b/lib/Text/BibTeX/Structure.pm
+index e7abdb2..84d20ae 100644
+--- a/lib/Text/BibTeX/Structure.pm
++++ b/lib/Text/BibTeX/Structure.pm
+@@ -80,7 +80,7 @@ basis of the B<btOOL> "structure module" system.  This system is how
+ database structures are defined and imposed on BibTeX files, and
+ provides an elegant synthesis of object-oriented techniques with
+ BibTeX-style database structures.  Nothing described here is
+-particularly deep or subtle; anyone familar with object-oriented
++particularly deep or subtle; anyone familiar with object-oriented
+ programming should be able to follow it.  However, a fair bit of jargon
+ in invented and tossed around, so pay attention.
+ 
diff --git a/debian/patches/0002-Use-the-right-path-of-perl.patch b/debian/patches/0002-Use-the-right-path-of-perl.patch
new file mode 100644
index 0000000..864ee9f
--- /dev/null
+++ b/debian/patches/0002-Use-the-right-path-of-perl.patch
@@ -0,0 +1,27 @@
+From: David Bremner <bremner at debian.org>
+Date: Sat, 3 Mar 2012 16:09:25 -0400
+Subject: Use the right path of perl.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Origin: vendor
+Forwarded: no
+Author: Julián Moreno Patiño <darkjunix at gmail.com>
+Last-Update: 2011-11-05
+
+(DEP3 header imported into git by db)
+---
+ examples/append_entries |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/examples/append_entries b/examples/append_entries
+index 50b771c..cdeabe9 100755
+--- a/examples/append_entries
++++ b/examples/append_entries
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl5 -w
++#!/usr/bin/perl -w
+ 
+ #
+ # append_entries
diff --git a/debian/patches/0003-Introduce-a-btparse_api_version-note-and-use-it-in-d.patch b/debian/patches/0003-Introduce-a-btparse_api_version-note-and-use-it-in-d.patch
new file mode 100644
index 0000000..f48ee7b
--- /dev/null
+++ b/debian/patches/0003-Introduce-a-btparse_api_version-note-and-use-it-in-d.patch
@@ -0,0 +1,97 @@
+From: David Bremner <bremner at debian.org>
+Date: Sat, 3 Mar 2012 15:23:40 -0400
+Subject: Introduce a btparse_api_version note and use it in definine the
+ SONAME.
+
+Most linux distributions require a versioned SONAME for all libraries
+in /usr/lib. This provides such an SONAME by defining the version in
+Build.PL.
+
+We also provide a symlink with unversioned name to make the linking of
+binaries to the shared library transparent.
+
+Arguably this should be defined in the C source of btparse, but since
+the version is taken from the perl module, this alternative is maybe
+more acceptable; it is certainly simpler than parsing another file in
+Build.PL.
+---
+ Build.PL         |    4 ++++
+ inc/MyBuilder.pm |   22 ++++++++++++++++++----
+ 2 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/Build.PL b/Build.PL
+index 3abd5d9..2d5cd5a 100644
+--- a/Build.PL
++++ b/Build.PL
+@@ -86,6 +86,10 @@ if ($^O =~ /mswin32/i) {
+     }
+ }
+ $builder->notes('btparse_version' => $version);
++#
++# this should be increased everytime there is a non-upward compatible
++# change the library ABI.
++$builder->notes('btparse_api_version' => 1);
+ $builder->notes('lib_path' => $libdir);
+ $builder->add_build_element('usrlib');
+ $builder->install_path( 'usrlib' => $libdir );
+diff --git a/inc/MyBuilder.pm b/inc/MyBuilder.pm
+index 845dc43..0cfc587 100644
+--- a/inc/MyBuilder.pm
++++ b/inc/MyBuilder.pm
+@@ -15,6 +15,7 @@ use ExtUtils::Mkbootstrap;
+ 
+ use File::Spec::Functions qw.catdir catfile.;
+ use File::Path qw.mkpath.;
++use Cwd;
+ 
+ sub ACTION_install {
+     my $self = shift;
+@@ -296,9 +297,14 @@ sub ACTION_create_library {
+ 
+ 
+     my $libbuilder = $self->notes('libbuilder');
++    my $APIVERSION = $self->notes('btparse_api_version');
+     my $LIBEXT = $libbuilder->{libext};
+ 
+-    print STDERR "\n** Creating libbtparse$LIBEXT\n";
++    my $symlink_exists = eval { symlink("",""); 1 };
++
++    my $SONAME= $symlink_exists ? "libbtparse$LIBEXT.$APIVERSION" : "libbtparse$LIBEXT";
++
++    print STDERR "\n** Creating $SONAME\n";
+ 
+     my @modules = qw:init input bibtex err scan error
+                      lex_auxiliary parse_auxiliary bibtex_ast sym
+@@ -308,14 +314,14 @@ sub ACTION_create_library {
+     my @objects = map { "btparse/src/$_.o" } @modules;
+ 
+     my $libpath = $self->notes('lib_path');
+-    $libpath = catfile($libpath, "libbtparse$LIBEXT");
+-    my $libfile = "btparse/src/libbtparse$LIBEXT";
++    $libpath = catfile($libpath, $SONAME);
++    my $libfile = "btparse/src/$SONAME";
+ 
+     my $extra_linker_flags = "";
+     if ($^O =~ /darwin/) {
+         $extra_linker_flags = "-install_name $libpath";
+     } elsif ($LIBEXT eq ".so") {
+-        $extra_linker_flags = "-Wl,-soname,libbtparse$LIBEXT";
++        $extra_linker_flags = "-Wl,-soname,$SONAME";
+     }
+ 
+     if (!$self->up_to_date(\@objects, $libfile)) {
+@@ -325,6 +331,14 @@ sub ACTION_create_library {
+                           extra_linker_flags => $extra_linker_flags);
+     }
+ 
++    if ($symlink_exists) {
++      my $olddir = getcwd;
++      chdir ("btparse/src");
++      unlink("libbtparse$LIBEXT");
++      symlink ($SONAME, "libbtparse$LIBEXT") or die("$!");
++      chdir ($olddir);
++    }
++
+     my $libdir = catdir($self->blib, 'usrlib');
+     mkpath( $libdir, 0, 0777 ) unless -d $libdir;
+ 
diff --git a/debian/patches/0004-disable-rpath-if-installing-into-usr-lib.patch b/debian/patches/0004-disable-rpath-if-installing-into-usr-lib.patch
new file mode 100644
index 0000000..edab189
--- /dev/null
+++ b/debian/patches/0004-disable-rpath-if-installing-into-usr-lib.patch
@@ -0,0 +1,31 @@
+From: David Bremner <bremner at debian.org>
+Date: Sat, 3 Mar 2012 20:33:47 -0400
+Subject: disable rpath if installing into /usr/lib
+
+rpath isn't needed then, and setting has some undesirable
+side-effects, the more obvious being that it prevents relocating the
+libraries in the files system.
+---
+ inc/MyBuilder.pm |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/inc/MyBuilder.pm b/inc/MyBuilder.pm
+index 0cfc587..4881005 100644
+--- a/inc/MyBuilder.pm
++++ b/inc/MyBuilder.pm
+@@ -184,8 +184,14 @@ sub ACTION_create_binaries {
+ 
+     print STDERR "\n** Creating binaries (dumpnames$EXEEXT, biblex$EXEEXT, bibparse$EXEEXT)\n";
+ 
++    my $rpath_arg = '';
++
++    if ( ($^O !~ /darwin/) && $btparselibdir ne "/usr/lib") {
++      $rpath_arg = "-Wl,-R${btparselibdir}";
++    }
++
+     my $extra_linker_flags = sprintf("-Lbtparse/src %s -lbtparse ",
+-                                     ($^O !~ /darwin/)?"-Wl,-R${btparselibdir}":"");
++				     $rpath_arg);
+ 
+     my @toinstall;
+     my $exe_file = catfile("btparse","progs","dumpnames$EXEEXT");
diff --git a/debian/patches/fix_spelling_errors.diff b/debian/patches/fix_spelling_errors.diff
deleted file mode 100644
index 4ec7540..0000000
--- a/debian/patches/fix_spelling_errors.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Fix spelling errors.
-Origin: vendor
-Forwarded: no
-Author: Julián Moreno Patiño <darkjunix at gmail.com>
-Last-Update: 2011-11-05
---- a/lib/Text/BibTeX/Structure.pm
-+++ b/lib/Text/BibTeX/Structure.pm
-@@ -80,7 +80,7 @@
- database structures are defined and imposed on BibTeX files, and
- provides an elegant synthesis of object-oriented techniques with
- BibTeX-style database structures.  Nothing described here is
--particularly deep or subtle; anyone familar with object-oriented
-+particularly deep or subtle; anyone familiar with object-oriented
- programming should be able to follow it.  However, a fair bit of jargon
- in invented and tossed around, so pay attention.
- 
diff --git a/debian/patches/right_path_perl.diff b/debian/patches/right_path_perl.diff
deleted file mode 100644
index cb1f90c..0000000
--- a/debian/patches/right_path_perl.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-Description: Use the right path of perl.
-Origin: vendor
-Forwarded: no
-Author: Julián Moreno Patiño <darkjunix at gmail.com>
-Last-Update: 2011-11-05
---- a/examples/append_entries
-+++ b/examples/append_entries
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl5 -w
-+#!/usr/bin/perl -w
- 
- #
- # append_entries
diff --git a/debian/patches/series b/debian/patches/series
index ebfe789..716c677 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
-fix_spelling_errors.diff
-right_path_perl.diff
+0001-Fix-spelling-errors.patch
+0002-Use-the-right-path-of-perl.patch
+0003-Introduce-a-btparse_api_version-note-and-use-it-in-d.patch
+0004-disable-rpath-if-installing-into-usr-lib.patch
diff --git a/debian/patches/use_libbtparse-dev.diff b/debian/patches/use_libbtparse-dev.diff
deleted file mode 100644
index 1078469..0000000
--- a/debian/patches/use_libbtparse-dev.diff
+++ /dev/null
@@ -1,296 +0,0 @@
-Description: Use libbtparse-dev instead embedded upstream copy.
-Origin: vendor
-Forwarded: no
-Author: Julián Moreno Patiño <darkjunix at gmail.com>
-Last-Update: 2011-11-05
---- a/inc/MyBuilder.pm
-+++ b/inc/MyBuilder.pm
-@@ -56,23 +56,15 @@
-     my $version = $self->notes('btparse_version');
-     my $alloca_h = 'undef HAVE_ALLOCA_H';
-     $alloca_h = 'define HAVE_ALLOCA_H 1' if Config::AutoConf->check_header("alloca.h");
--    _interpolate("btparse/src/bt_config.h.in",
--                 "btparse/src/bt_config.h",
-+    _interpolate("/usr/include/btparse.h",
-                  PACKAGE  => "\"libbtparse\"",
-                  FPACKAGE => "\"libbtparse $version\"",
-                  VERSION  => "\"$version\"",
-                  ALLOCA_H => $alloca_h
-                 );
- 
--
--    $self->dispatch("create_manpages");
-     $self->dispatch("create_objects");
--    $self->dispatch("create_library");
--    $self->dispatch("create_binaries");
--    $self->dispatch("create_tests");
--
-     $self->dispatch("compile_xscode");
--
-     $self->SUPER::ACTION_code;
- }
- 
-@@ -98,7 +90,7 @@
-     $self->add_to_cleanup($ofile); ## FIXME
-     if (!$self->up_to_date($cfile, $ofile)) {
-         $cbuilder->compile( source               => $cfile,
--                            include_dirs         => [ catdir("btparse","src") ],
-+                            include_dirs         => [ catdir("/usr","include") ],
-                             object_file          => $ofile);
-     }
- 
-@@ -120,49 +112,21 @@
-         my $btparselibdir = $self->install_path('usrlib');
-         $cbuilder->link(
-                         module_name => 'Text::BibTeX',
--                        extra_linker_flags => "-Lbtparse/src -lbtparse ",
-+                        extra_linker_flags => "-L/usr/include -lbtparse ",
-                         objects     => $objects,
-                         lib_file    => $lib_file,
-                        );
-     }
- }
- 
--sub ACTION_create_manpages {
--    my $self = shift;
--
--    print STDERR "\n** Creating Manpages\n";
--
--    my $pods = $self->rscan_dir(catdir("btparse","doc"), qr/\.pod$/);
--
--    my $version = $self->notes('btparse_version');
--    for my $pod (@$pods) {
--        my $man = $pod;
--        $man =~ s!.pod!.1!;
--        $man =~ s!btparse/doc!blib/bindoc!;   ## FIXME - path
--        next if $self->up_to_date($pod, $man);
--        ## FIXME
--        `pod2man --section=1 --center="btparse" --release="btparse, version $version" $pod $man`;
--    }
--
--    my $pod = 'btool_faq.pod';
--    my $man = catfile('blib','bindoc','btool_faq.1');
--    unless ($self->up_to_date($pod, $man)) {
--        ## FIXME
--        `pod2man --section=1 --center="btparse" --release="btparse, version $version" $pod $man`;
--    }
--}
--
- sub ACTION_create_objects {
-     my $self = shift;
-     my $cbuilder = $self->cbuilder;
- 
-     print STDERR "\n** Compiling C files\n";
--    my $c_progs = $self->rscan_dir('btparse/progs', qr/\.c$/);
--    my $c_src   = $self->rscan_dir('btparse/src',   qr/\.c$/);
--    my $c_tests = $self->rscan_dir('btparse/tests', qr/\.c$/);
-     my $c_xs    = $self->rscan_dir('xscode/',       qr/\.c$/);
- 
--    my @c_files = (@$c_progs, @$c_src, @$c_tests, @$c_xs);
-+    my @c_files = (@$c_xs);
-     for my $file (@c_files) {
-         my $object = $file;
-         $object =~ s/\.c/.o/;
-@@ -173,166 +137,6 @@
-     }
- }
- 
--
--sub ACTION_create_binaries {
--    my $self          = shift;
--    my $cbuilder      = $self->cbuilder;
--    my $libbuilder    = $self->notes('libbuilder');
--    my $EXEEXT        = $libbuilder->{exeext};
--    my $btparselibdir = $self->install_path('usrlib');
--
--    print STDERR "\n** Creating binaries (dumpnames$EXEEXT, biblex$EXEEXT, bibparse$EXEEXT)\n";
--
--    my $extra_linker_flags = sprintf("-Lbtparse/src %s -lbtparse ",
--                                     ($^O !~ /darwin/)?"-Wl,-R${btparselibdir}":"");
--
--    my @toinstall;
--    my $exe_file = catfile("btparse","progs","dumpnames$EXEEXT");
--    push @toinstall, $exe_file;
--    my $object   = catfile("btparse","progs","dumpnames.o");
--
--    if (!$self->up_to_date($object, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     objects  => [ $object ],
--                                     extra_linker_flags => $extra_linker_flags);
--    }
--
--    $exe_file = catfile("btparse","progs","biblex$EXEEXT");
--    push @toinstall, $exe_file;
--    $object   = catfile("btparse","progs","biblex.o");
--    if (!$self->up_to_date($object, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     objects  => [ $object ],
--                                     extra_linker_flags => $extra_linker_flags);
--    }
--
--    $exe_file = catfile("btparse","progs","bibparse$EXEEXT");
--    push @toinstall, $exe_file;
--    $object   = [map {catfile("btparse","progs","$_.o")} (qw.bibparse args getopt getopt1.)];
--    if (!$self->up_to_date($object, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     objects => $object,
--                                     extra_linker_flags => $extra_linker_flags);
--    }
--
--    for my $file (@toinstall) {
--        $self->copy_if_modified( from    => $file,
--                                 to_dir  => "blib/bin",
--                                 flatten => 1);
--    }
--
--}
--
--sub ACTION_create_tests {
--    my $self = shift;
--    my $cbuilder = $self->cbuilder;
--
--    my $libbuilder = $self->notes('libbuilder');
--    my $EXEEXT = $libbuilder->{exeext};
--
--    print STDERR "\n** Creating test binaries\n";
--
--    my $exe_file = catfile("btparse","tests","simple_test$EXEEXT");
--    my $objects  = [ map{catfile("btparse","tests","$_.o")} (qw.simple_test testlib.) ];
--
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","read_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.read_test testlib.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","postprocess_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.postprocess_test.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","tex_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.tex_test.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","macro_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.macro_test.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","name_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.name_test.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--
--    $exe_file = catfile("btparse","tests","purify_test$EXEEXT");
--    $objects  = [ map{catfile("btparse","tests","$_.o")}(qw.purify_test.) ];
--    if (!$self->up_to_date($objects, $exe_file)) {
--        $libbuilder->link_executable(exe_file => $exe_file,
--                                     extra_linker_flags => '-Lbtparse/src -lbtparse ',
--                                     objects => $objects);
--    }
--}
--
--sub ACTION_create_library {
--    my $self = shift;
--    my $cbuilder = $self->cbuilder;
--
--
--    my $libbuilder = $self->notes('libbuilder');
--    my $LIBEXT = $libbuilder->{libext};
--
--    print STDERR "\n** Creating libbtparse$LIBEXT\n";
--
--    my @modules = qw:init input bibtex err scan error
--                     lex_auxiliary parse_auxiliary bibtex_ast sym
--                     util postprocess macros traversal modify
--                     names tex_tree string_util format_name:;
--
--    my @objects = map { "btparse/src/$_.o" } @modules;
--
--    my $libpath = $self->notes('lib_path');
--    $libpath = catfile($libpath, "libbtparse$LIBEXT");
--    my $libfile = "btparse/src/libbtparse$LIBEXT";
--
--    my $extra_linker_flags = "";
--    if ($^O =~ /darwin/) {
--        $extra_linker_flags = "-install_name $libpath";
--    } elsif ($LIBEXT eq ".so") {
--        $extra_linker_flags = "-Wl,-soname,libbtparse$LIBEXT";
--    }
--
--    if (!$self->up_to_date(\@objects, $libfile)) {
--        $libbuilder->link(module_name        => 'btparse',
--                          objects            => \@objects,
--                          lib_file           => $libfile,
--                          extra_linker_flags => $extra_linker_flags);
--    }
--
--    my $libdir = catdir($self->blib, 'usrlib');
--    mkpath( $libdir, 0, 0777 ) unless -d $libdir;
--
--    $self->copy_if_modified( from   => $libfile,
--                             to_dir => $libdir,
--                             flatten => 1 );
--}
--
- sub ACTION_test {
-     my $self = shift;
- 
-@@ -358,7 +162,6 @@
-     $self->SUPER::ACTION_test
- }
- 
--
- sub _interpolate {
-     my ($from, $to, %config) = @_;
- 	
---- a/xscode/btxs_support.c
-+++ b/xscode/btxs_support.c
-@@ -13,9 +13,10 @@
- 
- #define BT_DEBUG 0
- 
--#include "btparse.h"
-+#include <btparse.h>
- #include "btxs_support.h"
- 
-+typedef unsigned short btshort;
- 
- static char *nodetype_names[] = 
- {
---- a/xscode/BibTeX.xs
-+++ b/xscode/BibTeX.xs
-@@ -31,9 +31,10 @@
- 
- #define BT_DEBUG 0
- 
--#include "btparse.h"
-+#include <btparse.h>
- #include "btxs_support.h"
- 
-+typedef unsigned short btshort;
- 
- MODULE = Text::BibTeX           PACKAGE = Text::BibTeX
- 

-- 
Debian packaging of Text-BibTeX CPAN distribution



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