Bug#859257: libngs-sdk-dev: installs .a files to the incorrect directory

2017-04-01 Thread Graham Inggs
After filing #859260 and #859261, I looked at this again.
The attached patch uses DEB_HOST_MULTIARCH instead of
DEB_BUILD_GNU_TYPE throughout debian/rules.
--- a/debian/rules
+++ b/debian/rules
@@ -8,9 +8,9 @@
 
 OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
 CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
-BUILDTYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 # since build-results are not ending up in the proper dir its saver to use "*" 
instead of "$(CPU)"
-SODIR := $(DEBPKGNAME)/$(BUILDTYPE)/$(DEBPKGNAME)/$(OS)/gcc/*
+SODIR := $(DEBPKGNAME)/$(MULTIARCH)/$(DEBPKGNAME)/$(OS)/gcc/*
 
 build2vers := $(shell pyversions -sv)
 build3vers := $(shell py3versions -sv)
@@ -23,19 +23,19 @@
#dh_auto_clean --sourcedirectory=$(DEBPKGNAME) ; \
dh_auto_clean ; \
fi
-   rm -rf ngs-java/$(BUILDTYPE)
-   rm -rf ngs-bam/$(BUILDTYPE)
+   rm -rf ngs-java/$(MULTIARCH)
+   rm -rf ngs-bam/$(MULTIARCH)
rm -f ngs-bam/Makefile.config
rm -f ngs-bam/Makefile.config.install.linux.x86_64.prl
rm -f ngs-bam/Makefile.config.linux.x86_64
rm -f ngs-bam/reconfigure
 
-   rm -rf $(DEBPKGNAME)/$(BUILDTYPE)
+   rm -rf $(DEBPKGNAME)/$(MULTIARCH)
rm -rf ngs-python/build
 
 override_dh_auto_configure:
# # that's no standard configure script lacking support of default 
options \
-   ./configure --build=$(BUILDTYPE) --prefix=/usr -- --source=1.7
+   ./configure --build=$(MULTIARCH) --prefix=/usr -- --source=1.7
 
 override_dh_auto_build:
#dh_auto_build --sourcedirectory=$(DEBPKGNAME)
@@ -43,7 +43,7 @@
dh_auto_build --sourcedirectory=$(DEBPKGNAME)
# Remove ngs-bam generation, expects ngs-sdk and cannot find a way
# to specify it
-   #cd ngs-bam && LD_LIBRARY_PATH=../$(SODIR)/rel/lib ./configure 
--build=$(BUILDTYPE) --prefix=/usr --with-ngs-sdk-prefix=../ngs-sdk
+   #cd ngs-bam && LD_LIBRARY_PATH=../$(SODIR)/rel/lib ./configure 
--build=$(MULTIARCH) --prefix=/usr --with-ngs-sdk-prefix=../ngs-sdk
#dh_auto_build --sourcedirectory=ngs-bam
dh_auto_build --sourcedirectory=ngs-java -- JAVAC="javac -source 1.7 
-target 1.7"
markdown_py -f README.html README.md
@@ -52,8 +52,8 @@
make -C $(DEBPKGNAME)/test
# Tests of Java binding disabled because need external lib ncbi-vdb,
# not available in Debian at this time
-   #CLASSPATH=../$(BUILDTYPE)/ngs-java/jar/ngs-java.jar 
LD_LIBRARY_PATH=$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C ngs-java/examples
-   #CLASSPATH=../$(BUILDTYPE)/ngs-java/jar/ngs-java.jar 
LD_LIBRARY_PATH=../../$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C 
ngs-java/examples run_all
+   #CLASSPATH=../$(MULTIARCH)/ngs-java/jar/ngs-java.jar 
LD_LIBRARY_PATH=$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C ngs-java/examples
+   #CLASSPATH=../$(MULTIARCH)/ngs-java/jar/ngs-java.jar 
LD_LIBRARY_PATH=../../$(SODIR)/rel/lib:$(LD_LIBRARY_PATH) make -C 
ngs-java/examples run_all
 
 override_dh_auto_install:
d-shlibmove --commit \
@@ -61,8 +61,8 @@
--devunversioned \
--exclude-a \
--exclude-la \
-   --movedev "$(SODIR)/rel/lib/*.a*" usr/lib/$(BUILDTYPE) \
-   --movedev "$(SODIR)/rel/ilib/*.a" usr/lib/$(BUILDTYPE) \
+   --movedev "$(SODIR)/rel/lib/*.a*" usr/lib/$(MULTIARCH) \
+   --movedev "$(SODIR)/rel/ilib/*.a" usr/lib/$(MULTIARCH) \
--movedev ngs-sdk/ngs usr/include \
$(SODIR)/rel/lib/libngs-sdk.so
 


Bug#859257: libngs-sdk-dev: installs .a files to the incorrect directory

2017-04-01 Thread Graham Inggs
Package: libngs-sdk-dev
Version: 1.2.3-3
Severity: serious
Tags: patch

Hi Maintainer

.a files are installed to the incorrect directory (e.g.
/usr/lib/i686-linux-gnu/ instead of /usr/lib/i386-linux-gnu/) , as can
be seen in the following excerpt from a recent buildlog [1]:


libngs-sdk-dev_1.3.0-1_i386.deb
───
 new debian package, version 2.0.
 size 99736 bytes: control archive=3479 bytes.
1035 bytes,24 lines  control
6887 bytes,98 lines  md5sums
 Package: libngs-sdk-dev
 Source: ngs-sdk
 Version: 1.3.0-1
 Architecture: i386
...
drwxr-xr-x root/root 0 2016-11-09 07:54 ./usr/lib/
drwxr-xr-x root/root 0 2016-11-09 07:54 ./usr/lib/i386-linux-gnu/
lrwxrwxrwx root/root 0 2016-11-09 07:54
./usr/lib/i386-linux-gnu/libngs-sdk.so -> libngs-sdk.so.1
drwxr-xr-x root/root 0 2016-11-09 07:54 ./usr/lib/i686-linux-gnu/
lrwxrwxrwx root/root 0 2016-11-09 07:54
./usr/lib/i686-linux-gnu/libngs-adapt-c++-static.a ->
libngs-adapt-c++.a


This causes at least sra-sdk to FTBFS on i386 [2] with the following error:


checking for ngs-sdk package...
includes... /usr
libraries...
checking /usr/lib/i386-linux-gnu/libngs-c++.a
checking /usr/lib32/libngs-c++.a
checking /usr/linux/gcc/i386/dbg/lib/libngs-c++.a
no
libraries...
checking 
/«BUILDDIR»/sra-sdk-2.8.1-2+dfsg/debian/tmp/usr/lib/i386-linux-gnu/libngs-c++.a
checking /«BUILDDIR»/sra-sdk-2.8.1-2+dfsg/debian/tmp/usr/lib32/libngs-c++.a
checking 
/«BUILDDIR»/sra-sdk-2.8.1-2+dfsg/debian/tmp/usr/linux/gcc/i386/dbg/lib/libngs-c++.a
no
not found /«BUILDDIR»/sra-sdk-2.8.1-2+dfsg/debian/tmp/usr/ngs-sdk
libraries...
checking /usr/lib/i386-linux-gnu/libngs-c++.a
checking /usr/lib32/libngs-c++.a
checking /usr/linux/gcc/i386/dbg/lib/libngs-c++.a
no
ngs-sdk: includes: /usr/include; libs: ; ilibs: not needed
configure: error: required ngs-sdk package not found.
debian/rules:24: recipe for target 'override_dh_auto_configure' failed


The following patch lets the .a files be installed to the correct
multiarch directory:


--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,7 @@
 OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
 CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
 BUILDTYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 # since build-results are not ending up in the proper dir its saver
to use "*" instead of "$(CPU)"
 SODIR := $(DEBPKGNAME)/$(BUILDTYPE)/$(DEBPKGNAME)/$(OS)/gcc/*

@@ -61,8 +62,8 @@
 --devunversioned \
 --exclude-a \
 --exclude-la \
---movedev "$(SODIR)/rel/lib/*.a*" usr/lib/$(BUILDTYPE) \
---movedev "$(SODIR)/rel/ilib/*.a" usr/lib/$(BUILDTYPE) \
+--movedev "$(SODIR)/rel/lib/*.a*" usr/lib/$(MULTIARCH) \
+--movedev "$(SODIR)/rel/ilib/*.a" usr/lib/$(MULTIARCH) \
 --movedev ngs-sdk/ngs usr/include \
 $(SODIR)/rel/lib/libngs-sdk.so


Regards
Graham


[1] 
https://buildd.debian.org/status/fetch.php?pkg=ngs-sdk=i386=1.3.0-1=1478684848=0
[2] 
https://buildd.debian.org/status/fetch.php?pkg=sra-sdk=i386=2.8.1-2%2Bdfsg-1=1485249305=0