Package: libplplotada3
Version: 5.13.0+dfsg-10
Followup-For: Bug #914680

The short attachment contains untested suggestions
* for this bug
* for #821278 (Ada project)
* to set build flags (maybe fixing the empty -dbgsym packages)
* for a cosmetic change in debian/watch
>From 809d9fca94489f0845d8c5c053989150fc1b8130 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.bouleng...@free.fr>
Date: Sun, 2 Dec 2018 23:39:09 +0100
Subject: [PATCH 1/4] Improve readability of watch file thanks to version 4 of
 uscan format.

---
 debian/watch | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/debian/watch b/debian/watch
index 0b81469a..a6be85a3 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,7 @@
-version=3
-opts="uversionmangle=s/-/~/,dversionmangle=s/\+dfsg$//,repacksuffix=+dfsg" \
-  http://sf.net/plplot/plplot-(.*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+version=4
+
+opts="\
+  uversionmangle=s/-/~/,\
+  dversionmangle=s/\+dfsg$//,\
+  repacksuffix=+dfsg" \
+http://sf.net/@PACKAGE@/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
-- 
2.19.2

>From 961efce2cecfb5b3acae4086d2bd842f602b1977 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.bouleng...@free.fr>
Date: Sun, 2 Dec 2018 23:39:43 +0100
Subject: [PATCH 2/4] Complete the link step of the Ada project.  Closes:
 #821278.

Copy bindings/ada/CMakeLists.txt, which only passes -lplplot to
pkg-config.
---
 debian/plplotada.gpr.in | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/debian/plplotada.gpr.in b/debian/plplotada.gpr.in
index 9d0bae03..e3877141 100644
--- a/debian/plplotada.gpr.in
+++ b/debian/plplotada.gpr.in
@@ -5,11 +5,7 @@ library project Plplotada is
    for Library_Ali_Dir use  "/usr/lib/@DEB_HOST_MULTIARCH@/adalib/plplotada";
    for Library_Dir use  "/usr/lib/@DEB_HOST_MULTIARCH@");
    for Externally_Built use True;
-TODO:
-   --  If options must be added to the command line after
-   --  -L$(Library_Dir) -l$(Library_Name) when linking an executable:
    package Linker is
-     for Linker_Options use ("-lplplot", "-lor", "-lsomething", "-lsimilar");
+     for Linker_Options use ("-lplplot");
    end Linker;
-   --  Else remove all from TODO: to this line.
 end Plplotada;
-- 
2.19.2

>From 28451d48642cefeac83f5704f4430435696d8e71 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.bouleng...@free.fr>
Date: Sun, 2 Dec 2018 23:41:17 +0100
Subject: [PATCH 3/4] Delegate selection of default build flags to
 dpkg-buildflags.

Also, enable hardening flags. This setting can cause problems,
dpkg-buildflags(1) describes howto refine it.
---
 debian/rules | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/debian/rules b/debian/rules
index 6580e849..b9e2274c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,15 +6,21 @@
 # Paths for Octave
 OCTDIR = $(shell octave-config --print LOCALAPIOCTFILEDIR)
 
-# Note cmake ignores CPPFLAGS so add them to CFLAGS and CXXFLAGS as a
-# work around
-CPPFLAGS += $(shell mkoctfile -p INCFLAGS)
-CFLAGS += $(CPPFLAGS) -fvisibility=hidden
+DEB_BUILD_MAINT_OPTIONS       := hardening=+all
+DPKG_EXPORT_BUILDFLAGS        := 1
+DEB_CFLAGS_MAINT_APPEND       := -fvisibility=hidden
+DEB_FFLAGS_MAINT_APPEND       := -fvisibility=hidden
 # Don't add -fvisibility=hidden to CXXFLAGS for now as this breaks the
 # octave bindings.
+DEB_CPPFLAGS_MAINT_APPEND     := $(shell mkoctfile -p INCFLAGS)
+DEB_LDFLAGS_MAINT_APPEND      := -Wl,--as-needed
+include /usr/share/dpkg/default.mk
+
+# Note cmake ignores CPPFLAGS so add them to CFLAGS and CXXFLAGS as a
+# work around, see #653916.
+CFLAGS   += $(CPPFLAGS)
 CXXFLAGS += $(CPPFLAGS)
-FFLAGS += -fvisibility=hidden
-LDFLAGS += -Wl,--as-needed
+
 HOME=$(shell mktemp -d)
 
 export verbose_test = on
-- 
2.19.2

>From 24225167500a55815cf87b56db53860221637b46 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.bouleng...@free.fr>
Date: Sun, 2 Dec 2018 23:42:53 +0100
Subject: [PATCH 4/4] Set the shared object version of the Ada library. Closes:
 #914680.

The policy requires that the shared object version of the Ada library
matches the name of the binary package installing it, preventing such
bugs.
---
 debian/rules | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/debian/rules b/debian/rules
index b9e2274c..c2eb8053 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,6 +34,14 @@ CONFIGURE_OPTIONS = \
 	-DBUILD_DOC=ON \
 	-DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) 
 
+# The soversion used to build and install the Ada shared library must
+# match the end of the library package name.
+ada_lib_pkg_vsn := $(shell sed -n \
+  '/^Package: libplplotada\([0-9.]\+\)$$/{s//\1/;p;q}' debian/control)
+ada_soname := libplplotada.so.$(ada_soversion)
+CONFIGURE_OPTIONS += \
+  '-DCMAKE_SHARED_LIBRARY_SONAME_Ada_FLAG=-Wl,-soname -Wl,$(ada_soname)'
+
 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
   CONFIGURE_OPTIONS += -DBUILD_TEST=ON
 endif
-- 
2.19.2

Reply via email to