[perl-openssl-defaults] 01/01: Initial version of perl-openssl-defaults

ntyni at debian.org ntyni at debian.org
Sun Dec 18 21:58:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

ntyni pushed a commit to branch master
in repository perl-openssl-defaults.

commit 499e8b7f58b8a2ce26b919e66f4508e2838b45a1
Author: Niko Tyni <ntyni at debian.org>
Date:   Sun Dec 18 23:24:11 2016 +0200

    Initial version of perl-openssl-defaults
    
    See #848113 for the rationale.
---
 debian/README.Debian                               |  40 +++++
 debian/changelog                                   |   5 +
 debian/clean                                       |   2 +
 debian/compat                                      |   1 +
 debian/control                                     |  27 ++++
 debian/copyright                                   |  39 +++++
 debian/debhelper-build-stamp                       |   1 +
 debian/dh_perl_openssl                             |  73 +++++++++
 debian/dh_perl_openssl.1                           | 171 +++++++++++++++++++++
 debian/files                                       |   2 +
 debian/install                                     |   7 +
 debian/manpages                                    |   1 +
 debian/perl-openssl-defaults.debhelper.log         |   1 +
 debian/perl-openssl-defaults.substvars             |   3 +
 debian/perl-openssl-defaults/DEBIAN/control        |  21 +++
 debian/perl-openssl-defaults/DEBIAN/md5sums        |   7 +
 .../perl-openssl-defaults/usr/bin/dh_perl_openssl  |  72 +++++++++
 .../perl-openssl-defaults/perl-openssl.make        |   3 +
 .../share/doc/perl-openssl-defaults/README.Debian  |  40 +++++
 .../share/doc/perl-openssl-defaults/changelog.gz   | Bin 0 -> 164 bytes
 .../usr/share/doc/perl-openssl-defaults/copyright  |  39 +++++
 .../usr/share/man/man1/dh_perl_openssl.1.gz        | Bin 0 -> 2335 bytes
 .../Debian/Debhelper/Sequence/perl_openssl.pm      |  16 ++
 debian/perl-openssl.make                           |   3 +
 debian/perl_openssl.pm                             |  16 ++
 debian/rules                                       |  31 ++++
 debian/source/format                               |   1 +
 27 files changed, 622 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..ced3554
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,40 @@
+Dependencies for packages exposing OpenSSL binary interface to Perl code
+========================================================================
+
+This information is only relevant for maintainers of Debian packages
+of Perl XS modules dealing with OpenSSL.
+
+Packages exposing libssl binary objects like SSL_CTX struct pointers
+to Perl code need to be compiled against the same version of OpenSSL to
+avoid binary incompatibility issues. See <https://bugs.debian.org/848113>.
+
+Compatibility can be ensured by depending on the "perl-openssl-abi-x"
+virtual package, where the name is dynamically generated from the SONAME
+of the libssl.so symlink included in the libssl-dev package. There can
+be only one such package on the system at a time, so this guarantees
+that all the installed packages share the same compatibility level.
+
+To generate this dependency, please build-depend on perl-openssl-defaults
+and do one of the following:
+
+debhelper using dh:
+
+Use the "perl_openssl" addon and ensure ${perl:Depends} is used in
+debian/control.
+
+The debian/rules file might look as follows:
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_openssl
+
+old-style debhelper:
+
+Run dh_perl_openssl after dh_perl and ensure ${perl:Depends} is used in
+debian/control.
+
+packages not using debhelper:
+
+Include /usr/lib/<triplet>/perl-opensl-defaults/perl-openssl.make in debian rules and use
+PERL_OPENSSL_ABI_VERSION.
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..aa909b5
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+perl-openssl-defaults (1) UNRELEASED; urgency=medium
+
+  * Initial release. (Closes: #XXXXXX)
+
+ -- Niko Tyni <ntyni at debian.org>  Sun, 18 Dec 2016 10:27:19 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..1f113a0
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@
+debian/dh_perl_openssl.1
+debian/perl-openssl.make
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..e62c2e1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,27 @@
+Source: perl-openssl-defaults
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Uploaders: Niko Tyni <ntyni at debian.org>
+Section: perl
+Priority: optional
+Build-Depends: debhelper (>= 10), libssl-dev
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/perl-openssl-defaults.git
+Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/perl-openssl-defaults.git
+
+Package: perl-openssl-defaults
+Architecture: any
+Depends: ${misc:Depends}
+Provides: perl-openssl-abi-${perl-openssl-abi-version}
+Multi-Arch: same
+Description: Version compatibility baseline for Perl OpenSSL packages
+ A subset of Perl XS module packages expose the OpenSSL binary interface
+ to Perl code. This can lead to incompatibilities if these packages are
+ linked against different versions of OpenSSL.
+ .
+ This package provides a virtual package "perl-openssl-abi-x" that
+ corresponds to the libssl-dev package SONAME it was built against.
+ The packages that need to stay compatible with each other can depend
+ on this.
+ .
+ Tools are also provided for generating this dependency with minimum
+ hassle. See the instructions in README.Debian.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ef11e83
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,39 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: *
+Copyright: 2016 Niko Tyni
+License: Artistic or GPL-1+
+Comment:
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of either:
+ .
+    a) the GNU General Public License as published by the Free Software
+       Foundation; either version 1, or (at your option) any later
+       version, or
+ .
+    b) the "Artistic License" which comes with Perl.
+
+Files: debian/dh_perl_openssl debian/perl_openssl.pm
+Copyright: Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+           Copyright 2016, Niko Tyni
+License: Artistic or GPL-1+
+Comment:
+    This program is free software, you can redistribute it and/or modify it under
+    the same terms as Perl itself.
+
+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'.
+
diff --git a/debian/debhelper-build-stamp b/debian/debhelper-build-stamp
new file mode 100644
index 0000000..ad8d259
--- /dev/null
+++ b/debian/debhelper-build-stamp
@@ -0,0 +1 @@
+perl-openssl-defaults
diff --git a/debian/dh_perl_openssl b/debian/dh_perl_openssl
new file mode 100755
index 0000000..69ec303
--- /dev/null
+++ b/debian/dh_perl_openssl
@@ -0,0 +1,73 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib;
+
+my $openssl_abi_level;
+
+init();
+
+my $host_multiarch = dpkg_architecture_value("DEB_HOST_MULTIARCH");
+my $abifile = "/usr/lib/${host_multiarch}/perl-openssl-defaults/perl-openssl.make";
+
+open(ABI, '<', $abifile)
+    or die("Cannot open $abifile for reading: $!");
+while (<ABI>) {
+    chomp;
+    next if /^\s*#/;
+    /PERL_OPENSSL_ABI_VERSION=(.+)/ and do {
+        $openssl_abi_level = $1;
+        last;
+    }
+}
+close ABI;
+
+die("no PERL_OPENSSL_ABI_VERSION found in $abifile") if !defined $openssl_abi_level;
+
+for my $package (@{ $dh{DOPACKAGES} }) {
+  addsubstvar($package, 'perl:Depends', "perl-openssl-abi-${openssl_abi_level}", undef);
+}
+
+__END__
+
+=head1 NAME
+
+dh_perl_openssl - add dependencies required for OpenSSL modules
+
+=head1 SYNOPSIS
+
+B<dh_perl_openssl> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_perl_openssl is a debhelper program that is responsible for adding a dependency
+on perl-openssl-abi-* to the ${perl:Depends} substitution variable.
+Such a dependency is needed for packages that expose the OpenSSL binary
+interface to Perl code, such as pointers to C<SSL_CTX> structs.
+
+A debhelper addon is also provided.  This makes it possible to just use
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_openssl
+
+for F<debian/rules>.
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+L<http://bugs.debian.org/848113>
+
+=head1 COPYRIGHT AND LICENSE
+
+Based on I<dh_perl_dbi> in the I<libdbi-perl> package by Angar Buchardt.
+
+Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+
+Copyright 2016, Niko Tyni <ntyni 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/dh_perl_openssl.1 b/debian/dh_perl_openssl.1
new file mode 100644
index 0000000..e8f6cc7
--- /dev/null
+++ b/debian/dh_perl_openssl.1
@@ -0,0 +1,171 @@
+.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+.    ds C`
+.    ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\"
+.\" If the F register is >0, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.if !\nF .nr F 0
+.if \nF>0 \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t"\\$2"
+..
+.    if !\nF==2 \{\
+.        nr % 0
+.        nr F 2
+.    \}
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "DH_PERL_OPENSSL 1"
+.TH DH_PERL_OPENSSL 1 "2016-12-18" "perl v5.24.1" "User Contributed Perl Documentation"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+dh_perl_openssl \- add dependencies required for OpenSSL modules
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+\&\fBdh_perl_openssl\fR [\fIdebhelper\ options\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+dh_perl_openssl is a debhelper program that is responsible for adding a dependency
+on perl\-openssl\-abi\-* to the ${perl:Depends} substitution variable.
+Such a dependency is required for packages that expose the OpenSSL binary
+interface to Perl code, such as pointers to \f(CW\*(C`SSL_CTX\*(C'\fR structs.
+.PP
+A debhelper addon is also provided.  This makes it possible to just use
+.PP
+.Vb 3
+\&  #!/usr/bin/make \-f
+\&  %:
+\&          dh $@ \-\-with perl_openssl
+.Ve
+.PP
+for \fIdebian/rules\fR.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIdebhelper\fR\|(7)
+.PP
+<http://bugs.debian.org/848113>
+.SH "COPYRIGHT AND LICENSE"
+.IX Header "COPYRIGHT AND LICENSE"
+Based on \fIdh_perl_dbi\fR in the \fIlibdbi-perl\fR package by Angar Buchardt.
+.PP
+Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+Copyright 2016, Niko Tyni <ntyni at debian.org>
+.PP
+This program is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
diff --git a/debian/files b/debian/files
new file mode 100644
index 0000000..80a7d26
--- /dev/null
+++ b/debian/files
@@ -0,0 +1,2 @@
+perl-openssl-defaults_1_amd64.buildinfo perl optional
+perl-openssl-defaults_1_amd64.deb perl optional
diff --git a/debian/install b/debian/install
new file mode 100755
index 0000000..6786763
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,7 @@
+#!/bin/sh
+DEB_HOST_MULTIARCH=${DEB_HOST_MULTIARCH:-$(dpkg-architecture -qDEB_HOST_MULTIARCH)}
+cat <<EOF
+debian/perl-openssl.make /usr/lib/${DEB_HOST_MULTIARCH}/perl-openssl-defaults
+debian/dh_perl_openssl   /usr/bin
+debian/perl_openssl.pm   /usr/share/perl5/Debian/Debhelper/Sequence
+EOF
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..e4a582b
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/dh_perl_openssl.1
diff --git a/debian/perl-openssl-defaults.debhelper.log b/debian/perl-openssl-defaults.debhelper.log
new file mode 100644
index 0000000..7b88139
--- /dev/null
+++ b/debian/perl-openssl-defaults.debhelper.log
@@ -0,0 +1 @@
+override_dh_gencontrol dh_gencontrol
diff --git a/debian/perl-openssl-defaults.substvars b/debian/perl-openssl-defaults.substvars
new file mode 100644
index 0000000..b596dce
--- /dev/null
+++ b/debian/perl-openssl-defaults.substvars
@@ -0,0 +1,3 @@
+perl:Depends=perl
+misc:Depends=
+misc:Pre-Depends=
diff --git a/debian/perl-openssl-defaults/DEBIAN/control b/debian/perl-openssl-defaults/DEBIAN/control
new file mode 100644
index 0000000..e11e5e1
--- /dev/null
+++ b/debian/perl-openssl-defaults/DEBIAN/control
@@ -0,0 +1,21 @@
+Package: perl-openssl-defaults
+Version: 1
+Architecture: amd64
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Installed-Size: 28
+Provides: perl-openssl-abi-1.1
+Section: perl
+Priority: optional
+Multi-Arch: same
+Description: Version compatibility baseline for Perl OpenSSL packages
+ A subset of Perl XS module packages expose the OpenSSL binary interface
+ to Perl code. This can lead to incompatibilities if these packages are
+ linked against different versions of OpenSSL.
+ .
+ This package provides a virtual package "perl-openssl-abi-x" that
+ corresponds to the libssl-dev package SONAME it was built against.
+ The packages that need to stay compatible with each other can depend
+ on this.
+ .
+ Tools are also provided for generating this dependency with minimum
+ hassle. See the instructions in README.Debian.
diff --git a/debian/perl-openssl-defaults/DEBIAN/md5sums b/debian/perl-openssl-defaults/DEBIAN/md5sums
new file mode 100644
index 0000000..790d92b
--- /dev/null
+++ b/debian/perl-openssl-defaults/DEBIAN/md5sums
@@ -0,0 +1,7 @@
+88d4b463c2e40be0e97181606c28657d  usr/bin/dh_perl_openssl
+63d5586a4c28835cb1d2f01f33f31448  usr/lib/x86_64-linux-gnu/perl-openssl-defaults/perl-openssl.make
+0f4b286e843170e979d12c9f91136443  usr/share/doc/perl-openssl-defaults/README.Debian
+fa96f646a3d0225dd795c265f5b557c6  usr/share/doc/perl-openssl-defaults/changelog.gz
+a8b61cd58240f76ce43ff7ad2f8cd8db  usr/share/doc/perl-openssl-defaults/copyright
+2d709342811c920a55d008dd0cec3e83  usr/share/man/man1/dh_perl_openssl.1.gz
+bb373b21ec7ed13d1feb26ecde45a134  usr/share/perl5/Debian/Debhelper/Sequence/perl_openssl.pm
diff --git a/debian/perl-openssl-defaults/usr/bin/dh_perl_openssl b/debian/perl-openssl-defaults/usr/bin/dh_perl_openssl
new file mode 100755
index 0000000..22b68e6
--- /dev/null
+++ b/debian/perl-openssl-defaults/usr/bin/dh_perl_openssl
@@ -0,0 +1,72 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib;
+
+my $openssl_abi_level;
+
+init();
+
+my $host_multiarch = dpkg_architecture_value("DEB_HOST_MULTIARCH");
+my $abifile = "/usr/lib/${host_multiarch}/perl-openssl-defaults/perl-openssl.make";
+
+open(ABI, '<', $abifile)
+    or die("Cannot open $abifile for reading: $!");
+while (<ABI>) {
+    chomp;
+    next if /^\s*#/;
+    /PERL_OPENSSL_ABI_VERSION=(.+)/ and do {
+        $openssl_abi_level = $1;
+        last;
+    }
+}
+close ABI;
+
+die("no PERL_OPENSSL_ABI_VERSION found in $abifile") if !defined $openssl_abi_level;
+
+for my $package (@{ $dh{DOPACKAGES} }) {
+  addsubstvar($package, 'perl:Depends', "perl-openssl-abi-${openssl_abi_level}", undef);
+}
+
+__END__
+
+=head1 NAME
+
+dh_perl_openssl - add dependencies required for OpenSSL modules
+
+=head1 SYNOPSIS
+
+B<dh_perl_openssl> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_perl_openssl is a debhelper program that is responsible for adding a dependency
+on perl-openssl-abi-* to the ${perl:Depends} substitution variable.
+Such a dependency is required for packages that expose the OpenSSL binary
+interface to Perl code, such as pointers to C<SSL_CTX> structs.
+
+A debhelper addon is also provided.  This makes it possible to just use
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_openssl
+
+for F<debian/rules>.
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+L<http://bugs.debian.org/848113>
+
+=head1 COPYRIGHT AND LICENSE
+
+Based on I<dh_perl_dbi> in the I<libdbi-perl> package by Angar Buchardt.
+
+Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+Copyright 2016, Niko Tyni <ntyni 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/perl-openssl-defaults/usr/lib/x86_64-linux-gnu/perl-openssl-defaults/perl-openssl.make b/debian/perl-openssl-defaults/usr/lib/x86_64-linux-gnu/perl-openssl-defaults/perl-openssl.make
new file mode 100644
index 0000000..25bfb37
--- /dev/null
+++ b/debian/perl-openssl-defaults/usr/lib/x86_64-linux-gnu/perl-openssl-defaults/perl-openssl.make
@@ -0,0 +1,3 @@
+# the ABI version for generating a perl-openssl-abi-* dependency.
+# See #848113.
+PERL_OPENSSL_ABI_VERSION=1.1
diff --git a/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/README.Debian b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/README.Debian
new file mode 100644
index 0000000..ced3554
--- /dev/null
+++ b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/README.Debian
@@ -0,0 +1,40 @@
+Dependencies for packages exposing OpenSSL binary interface to Perl code
+========================================================================
+
+This information is only relevant for maintainers of Debian packages
+of Perl XS modules dealing with OpenSSL.
+
+Packages exposing libssl binary objects like SSL_CTX struct pointers
+to Perl code need to be compiled against the same version of OpenSSL to
+avoid binary incompatibility issues. See <https://bugs.debian.org/848113>.
+
+Compatibility can be ensured by depending on the "perl-openssl-abi-x"
+virtual package, where the name is dynamically generated from the SONAME
+of the libssl.so symlink included in the libssl-dev package. There can
+be only one such package on the system at a time, so this guarantees
+that all the installed packages share the same compatibility level.
+
+To generate this dependency, please build-depend on perl-openssl-defaults
+and do one of the following:
+
+debhelper using dh:
+
+Use the "perl_openssl" addon and ensure ${perl:Depends} is used in
+debian/control.
+
+The debian/rules file might look as follows:
+
+  #!/usr/bin/make -f
+  %:
+          dh $@ --with perl_openssl
+
+old-style debhelper:
+
+Run dh_perl_openssl after dh_perl and ensure ${perl:Depends} is used in
+debian/control.
+
+packages not using debhelper:
+
+Include /usr/lib/<triplet>/perl-opensl-defaults/perl-openssl.make in debian rules and use
+PERL_OPENSSL_ABI_VERSION.
+
diff --git a/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/changelog.gz b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/changelog.gz
new file mode 100644
index 0000000..70752f3
Binary files /dev/null and b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/changelog.gz differ
diff --git a/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/copyright b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/copyright
new file mode 100644
index 0000000..ef11e83
--- /dev/null
+++ b/debian/perl-openssl-defaults/usr/share/doc/perl-openssl-defaults/copyright
@@ -0,0 +1,39 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: *
+Copyright: 2016 Niko Tyni
+License: Artistic or GPL-1+
+Comment:
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of either:
+ .
+    a) the GNU General Public License as published by the Free Software
+       Foundation; either version 1, or (at your option) any later
+       version, or
+ .
+    b) the "Artistic License" which comes with Perl.
+
+Files: debian/dh_perl_openssl debian/perl_openssl.pm
+Copyright: Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+           Copyright 2016, Niko Tyni
+License: Artistic or GPL-1+
+Comment:
+    This program is free software, you can redistribute it and/or modify it under
+    the same terms as Perl itself.
+
+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'.
+
diff --git a/debian/perl-openssl-defaults/usr/share/man/man1/dh_perl_openssl.1.gz b/debian/perl-openssl-defaults/usr/share/man/man1/dh_perl_openssl.1.gz
new file mode 100644
index 0000000..006c2aa
Binary files /dev/null and b/debian/perl-openssl-defaults/usr/share/man/man1/dh_perl_openssl.1.gz differ
diff --git a/debian/perl-openssl-defaults/usr/share/perl5/Debian/Debhelper/Sequence/perl_openssl.pm b/debian/perl-openssl-defaults/usr/share/perl5/Debian/Debhelper/Sequence/perl_openssl.pm
new file mode 100644
index 0000000..cb5d78f
--- /dev/null
+++ b/debian/perl-openssl-defaults/usr/share/perl5/Debian/Debhelper/Sequence/perl_openssl.pm
@@ -0,0 +1,16 @@
+# perl_openssl.pm - debhelper addon for running dh_perl_openssl
+#
+# Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+# Copyright 2016, Niko Tyni <ntyni 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_openssl");
+
+1;
diff --git a/debian/perl-openssl.make b/debian/perl-openssl.make
new file mode 100644
index 0000000..25bfb37
--- /dev/null
+++ b/debian/perl-openssl.make
@@ -0,0 +1,3 @@
+# the ABI version for generating a perl-openssl-abi-* dependency.
+# See #848113.
+PERL_OPENSSL_ABI_VERSION=1.1
diff --git a/debian/perl_openssl.pm b/debian/perl_openssl.pm
new file mode 100644
index 0000000..cb5d78f
--- /dev/null
+++ b/debian/perl_openssl.pm
@@ -0,0 +1,16 @@
+# perl_openssl.pm - debhelper addon for running dh_perl_openssl
+#
+# Copyright 2010, Ansgar Burchardt <ansgar at debian.org>
+# Copyright 2016, Niko Tyni <ntyni 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_openssl");
+
+1;
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..fa208f2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+OBJDUMP = $(DEB_HOST_GNU_TYPE)-objdump
+SOFILE  = /usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so
+
+# this number comes from the SONAME of libssl.so
+# it is used for the Provides: perl-openssl-abi-XX relationship
+# see #848113
+
+OPENSSL_ABI_VERSION=$(shell $(OBJDUMP) -p $(SOFILE) | perl -ne '/SONAME\s+libssl\.so\.(.+)/ and print $$1')
+
+ifeq (,$(OPENSSL_ABI_VERSION))
+    $(error Cannot determine ABI version form $(SOFILE) SONAME)
+endif
+
+override_dh_gencontrol:
+	dh_gencontrol -- -Vperl-openssl-abi-version=$(OPENSSL_ABI_VERSION)
+
+override_dh_auto_build:
+	printf "%s\n%s\n%s\n" \
+	"# the ABI version for generating a perl-openssl-abi-* dependency." \
+	"# See #848113." \
+	"PERL_OPENSSL_ABI_VERSION=$(OPENSSL_ABI_VERSION)" \
+	> debian/perl-openssl.make
+	pod2man debian/dh_perl_openssl debian/dh_perl_openssl.1
+
+%:
+	dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/perl-openssl-defaults.git



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