[SCM] Debian packaging of libimager-perl branch, master, updated. debian/0.93+dfsg-1-4-g703469c

gregor herrmann gregoa at debian.org
Sat Dec 8 17:39:19 UTC 2012


The following commit has been merged in the master branch:
commit fa326532f05ded31b864dc4345ee16c6cb7481c5
Author: gregor herrmann <gregoa at debian.org>
Date:   Sat Dec 8 18:27:42 2012 +0100

    Add an interface for packages compiled against libimager-perl
    
    - provide a perl-imagerapi-* virtual package
    - add a dh_perl_imager helper, a perl_imager debhelper sequence, and a
      perl-imagerapi.make makefile snippet
    
    Add a Breaks on old libimager-qrcode-perl.
    
    Closes: #693003

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..823704e
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,34 @@
+Dependencies for Imager
+============================
+
+This information is only relevant for maintainers of Debian packages
+compiled against Imager.
+
+These packages need to depend on the perl-imagerapi-* virtual package
+provided by libimager-perl.
+To generate this dependency please do one of the following:
+
+- debhelper using dh:
+
+Use the "perl_imager" addon and ensure ${perl:Depends} is used in debian/control.
+This requires a build-dependency on libimager-perl (>= 0.93+dfsg-2).
+
+The debian/rules file might look as follows:
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_imager
+
+- old-style debhelper:
+
+Run dh_perl_imager after dh_perl and ensure ${perl:Depends} is used in
+debian/control.  This requires a build dependency on libdbi-perl (>= 0.93+dfsg-2).
+
+- packages not using debhelper:
+
+Include /usr/share/libdbi-perl/perl-imagerapi.make in debian rules and use
+PERL_IMAGERAPI_DEPENDS.  This requires a build-dependency on
+libdbi-perl (>= 0.93+dfsg-2).
+
+See http://bugs.debian.org/693003 for a discussion why this dependency is
+required.
diff --git a/debian/clean b/debian/clean
index 1242a1f..2acdfc8 100644
--- a/debian/clean
+++ b/debian/clean
@@ -7,3 +7,6 @@ combine.c
 convert.c
 W32/Makefile
 T1/Makefile
+debian/perl-imagerapi.make
+debian/dh_perl_imager
+debian/dh_perl_imager.1
diff --git a/debian/control b/debian/control
index cf85005..64f564f 100644
--- a/debian/control
+++ b/debian/control
@@ -27,6 +27,8 @@ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libimager-per
 Package: libimager-perl
 Architecture: any
 Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
+Provides: perl-imagerapi-${perl-imagerapi-version}
+Breaks: libimager-qrcode-perl (<< 0.033-1.~)
 Description: Perl extension for generating 24-bit images
  Imager is a module for creating and altering images. It can read and write
  various image formats, draw primitive shapes like lines and polygons, blend
diff --git a/debian/dh_perl_imager.in b/debian/dh_perl_imager.in
new file mode 100755
index 0000000..3da44ff
--- /dev/null
+++ b/debian/dh_perl_imager.in
@@ -0,0 +1,52 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib;
+
+init();
+
+for my $package (@{ $dh{DOPACKAGES} }) {
+  addsubstvar($package, 'perl:Depends', 'perl-imagerapi- at IMAGERAPI_VERSION@', undef);
+}
+
+__END__
+
+=head1 NAME
+
+dh_perl_imager - add dependencies required for Imager modules
+
+=head1 SYNOPSIS
+
+B<dh_perl_imager> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_perl_imager is a debhelper program that is responsible for adding a dependency
+on perl-imagerapi-* to the ${perl:Depends} substitution variable.
+Such a dependency is required for packages that are B<compiled> against Imager;
+do I<not> use this for packages that only B<use> the Imager module.
+
+A debhelper addon is also provided.  This makes it possible to just use
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_imager
+
+for F<debian/rules>.
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+L<http://bugs.debian.org/693003>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+
+Copyright 2012, gregor herrmann <gregoa at debian.org>
+
+This program is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
diff --git a/debian/get-imagerapi-version.cpp b/debian/get-imagerapi-version.cpp
new file mode 100644
index 0000000..3e6c658
--- /dev/null
+++ b/debian/get-imagerapi-version.cpp
@@ -0,0 +1,7 @@
+// this script gets piped through cpp to sh
+// cpp reads imexttypes.h and substitutes IMAGER_API_VERSION, sh echoes it out
+cat >/dev/null <<END-OF-IMAGER
+#include "../imexttypes.h"
+END-OF-IMAGER
+
+echo IMAGER_API_VERSION
diff --git a/debian/libimager-perl.install b/debian/libimager-perl.install
new file mode 100644
index 0000000..89949ad
--- /dev/null
+++ b/debian/libimager-perl.install
@@ -0,0 +1,3 @@
+debian/perl-imagerapi.make /usr/share/libimager-perl
+debian/dh_perl_imager /usr/bin
+debian/perl_imager.pm /usr/share/perl5/Debian/Debhelper/Sequence
diff --git a/debian/libimager-perl.manpages b/debian/libimager-perl.manpages
new file mode 100644
index 0000000..6effef4
--- /dev/null
+++ b/debian/libimager-perl.manpages
@@ -0,0 +1 @@
+debian/dh_perl_imager.1
diff --git a/debian/perl_imager.pm b/debian/perl_imager.pm
new file mode 100644
index 0000000..40ab410
--- /dev/null
+++ b/debian/perl_imager.pm
@@ -0,0 +1,16 @@
+# perl_imager.pm - debhelper addon for running dh_perl_imager
+#
+# Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+# Copyright 2012, gregor herrmann <gregoa at debian.org>
+#
+# This program is free software, you can redistribute it and/or modify it
+# under the same terms as Perl itself.
+
+use warnings;
+use strict;
+
+use Debian::Debhelper::Dh_Lib;
+
+insert_after("dh_perl", "dh_perl_imager");
+
+1;
diff --git a/debian/rules b/debian/rules
index e166b45..018df6b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,7 +2,13 @@
 
 PACKAGE = $(shell dh_listpackages)
 TMP     = $(CURDIR)/debian/$(PACKAGE)
-PERL   ?= /usr/bin/perl
+
+# this number comes from IMAGER_API_VERSION in imexttypes.h
+# it is used for the Provides: perl-imagerapi-XX relationship
+# it needs to be updated manually because of the implications on the archive
+
+IMAGERAPI_VERSION = 5
+IMAGERAPI_DETECTED_VERSION = $(shell [ ! -e imconfig.h ] || cpp `perl -MExtUtils::Embed -e ccopts` debian/get-imagerapi-version.cpp | sh)
 
 %:
 	dh $@
@@ -10,6 +16,22 @@ PERL   ?= /usr/bin/perl
 override_dh_auto_configure:
 	dh_auto_configure -- --disable=TT-fonts
 
+override_dh_auto_build:
+ifneq ($(IMAGERAPI_VERSION),$(IMAGERAPI_DETECTED_VERSION))
+	echo Aborting due to Imager API version mismatch - configured $(IMAGERAPI_VERSION), detected $(IMAGERAPI_DETECTED_VERSION)
+	exit 1
+else
+	dh_auto_build
+	printf "%s\n%s\n%s\n" \
+	  "# this variable is the preferred interface for generating a perl-imagerapi-* dependency." \
+	  "# See #693003." \
+	  "PERL_IMAGERAPI_DEPENDS=perl-imagerapi-$(IMAGERAPI_VERSION)" \
+	 > debian/perl-imagerapi.make
+	sed "s, at IMAGERAPI_VERSION@,$(IMAGERAPI_VERSION)," debian/dh_perl_imager.in >debian/dh_perl_imager
+	chmod +x debian/dh_perl_imager
+	pod2man debian/dh_perl_imager debian/dh_perl_imager.1
+endif
+
 override_dh_auto_install:
 	dh_auto_install
 	# Imager::Font::Type1 is a wrapper around Imager::Font::T1
@@ -32,4 +54,5 @@ override_dh_clean:
 	dh_clean
 	rm -rf $(CURDIR)/_Inline
 
-
+override_dh_gencontrol:
+	dh_gencontrol -- -Vperl-imagerapi-version=$(IMAGERAPI_VERSION)

-- 
Debian packaging of libimager-perl



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