[perl-openssl-defaults] 01/05: Add a trivial binary for generating a libsslx.x dependency

ntyni at debian.org ntyni at debian.org
Tue Dec 20 21:53:33 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 f6634632b41d4d9f0548392719f9ab6270c453c7
Author: Niko Tyni <ntyni at debian.org>
Date:   Tue Dec 20 20:39:13 2016 +0200

    Add a trivial binary for generating a libsslx.x dependency
    
    We want to explicitly depend on the libssl package whose ABI version we're
    advertising. This makes it easy for library transition tools to determine
    that this package and its reverse dependencies need to be rebuilt.
    
    To achieve the dependency, we build a trivial binary for dpkg-shlibdeps
    consumption but don't actually ship it.
    
    We could install the binary and then remove it before the package
    gets built, but that would confuse dh_strip into generating a useless
    -dbgsym package. So we rather tell dpkg-shlibdeps to scan an uninstalled
    binary, and tolerate the warning it gives.
    
    The generated dependencies also include libc, which is unnecessary
    but more or less unavoidable without even worse hacks.
---
 Makefile          | 5 +++++
 debian/control    | 2 +-
 debian/rules      | 9 +++++++++
 openssl-version.c | 8 ++++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3970fc4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+openssl-version: openssl-version.c
+	$(CC) $(CFLAGS) $(LDFLAGS) -I/usr/include/openssl $< -o $@ -lcrypto
+
+clean:
+	$(RM) openssl-version
diff --git a/debian/control b/debian/control
index 597218d..f50219c 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/perl-openssl-defaults.
 
 Package: perl-openssl-defaults
 Architecture: any
-Depends: ${misc:Depends}, ${perl:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}
 Provides: perl-openssl-abi-${perl-openssl-abi-version}
 Multi-Arch: same
 Description: Version compatibility baseline for Perl OpenSSL packages
diff --git a/debian/rules b/debian/rules
index ca28dd3..4a189b6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,7 @@ 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
+CC      = $(DEB_HOST_GNU_TYPE)-gcc
 SOFILE  = /usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so
 
 # this number comes from the SONAME of libssl.so
@@ -16,6 +17,13 @@ ifeq (,$(OPENSSL_ABI_VERSION))
     $(error Cannot determine ABI version from $(SOFILE) SONAME)
 endif
 
+# we build a binary called 'openssl-version' just to be able to generate
+# a libssl* dependency. dh_shlibdeps won't run if nothing in installed
+# in the binary package, so we run dpkg-shlibdeps by hand
+override_dh_shlibdeps:
+	# scanning uninstalled binaries is intentional, please ignore the warning
+	dpkg-shlibdeps -e$(CURDIR)/openssl-version -Tdebian/perl-openssl-defaults.substvars
+
 override_dh_gencontrol:
 	dh_gencontrol -- -Vperl-openssl-abi-version=$(OPENSSL_ABI_VERSION)
 
@@ -26,6 +34,7 @@ override_dh_auto_build:
 	"PERL_OPENSSL_ABI_VERSION=$(OPENSSL_ABI_VERSION)" \
 	> debian/perl-openssl.make
 	pod2man debian/dh_perl_openssl debian/dh_perl_openssl.1
+	CC=$(CC) dh_auto_build
 
 %:
 	dh $@
diff --git a/openssl-version.c b/openssl-version.c
new file mode 100644
index 0000000..83c1839
--- /dev/null
+++ b/openssl-version.c
@@ -0,0 +1,8 @@
+#include <crypto.h>
+#include <stdio.h>
+
+/* trivial program for linking against OpenSSL */
+
+int main (void) {
+    printf("%s\n", OpenSSL_version(OPENSSL_VERSION));
+}

-- 
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