[openblas] 02/05: Multi-archify the package.
Sébastien Villemot
sebastien at debian.org
Sat Sep 9 08:57:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastien pushed a commit to branch master
in repository openblas.
commit 4cef2df898d60e118fd6f42771e09a0afaf0c621
Author: Sébastien Villemot <sebastien at debian.org>
Date: Fri Sep 8 22:13:06 2017 +0200
Multi-archify the package.
Incidentally, remove the dependency of libopenblas-dev on libblas-dev, since
cblas.h is now managed by the alternative.
Gbp-Dch: Full
---
debian/README.Debian | 9 ++++++---
debian/blas-openblas.pc.in | 4 ++--
debian/control | 16 ++++++++++++----
debian/lapack-openblas.pc.in | 4 ++--
debian/libopenblas-base.install | 10 ++++++----
debian/libopenblas-base.postinst | 18 ------------------
debian/libopenblas-base.postinst.in | 15 +++++++++++++++
debian/libopenblas-base.preinst | 14 +++++---------
debian/libopenblas-base.prerm | 16 ----------------
debian/libopenblas-base.prerm.in | 16 ++++++++++++++++
debian/libopenblas-dev.install | 10 ++++++----
debian/libopenblas-dev.links | 10 ++++++----
debian/libopenblas-dev.postinst | 24 ------------------------
debian/libopenblas-dev.postinst.in | 25 +++++++++++++++++++++++++
debian/libopenblas-dev.preinst | 14 +++++---------
debian/libopenblas-dev.prerm | 16 ----------------
debian/libopenblas-dev.prerm.in | 16 ++++++++++++++++
debian/patches/no-embedded-lapack.patch | 2 +-
debian/patches/order-files.patch | 2 +-
debian/rules | 28 ++++++++++++++++------------
20 files changed, 140 insertions(+), 129 deletions(-)
diff --git a/debian/README.Debian b/debian/README.Debian
index 7c1a382..5991bac 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -3,11 +3,14 @@ How to switch between the various BLAS/LAPACK implementations
- BLAS:
- $ sudo update-alternatives --config libblas.so.3
+ $ sudo update-alternatives --config libblas.so.3-<multiarch>
- LAPACK:
- $ sudo update-alternatives --config liblapack.so.3
+ $ sudo update-alternatives --config liblapack.so.3-<multiarch>
+
+where <multiarch> is the multiarch path for you architecture (e.g.
+x86_64-linux-gnu for amd64).
More information is available at:
@@ -65,5 +68,5 @@ using:
$ aptitude versions libopenblas-base
- -- Sébastien Villemot <sebastien at debian.org>, Wed, 2 Aug 2017 14:30:28 +0200
+ -- Sébastien Villemot <sebastien at debian.org>, Fri, 8 Sep 2017 21:36:31 +0200
-- Sylvestre Ledru <sylvestre at debian.org> Tue, 31 May 2011 13:56:22 +0200
diff --git a/debian/blas-openblas.pc.in b/debian/blas-openblas.pc.in
index e24eab8..022c558 100644
--- a/debian/blas-openblas.pc.in
+++ b/debian/blas-openblas.pc.in
@@ -1,6 +1,6 @@
prefix=/usr
-libdir=${prefix}/lib/openblas-base
-includedir=${prefix}/include/openblas
+libdir=${prefix}/lib/@DEB_HOST_MULTIARCH@/openblas
+includedir=${prefix}/include/@DEB_HOST_MULTIARCH@
Name: openblas-blas
Description: Optimized BLAS (linear algebra) library based on GotoBLAS2
Version: @DEB_VERSION_UPSTREAM@
diff --git a/debian/control b/debian/control
index 94a2678..9b17625 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,9 @@ Uploaders: Sébastien Villemot <sebastien at debian.org>
Section: devel
Priority: optional
Build-Depends: debhelper (>= 10),
+ dh-exec,
gfortran,
- liblapack-pic (>= 3.7.0)
+ liblapack-pic (>= 3.7.1-2~)
Standards-Version: 4.0.0
Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/openblas.git
Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/openblas.git
@@ -13,10 +14,14 @@ Homepage: https://github.com/xianyi/OpenBLAS
Package: libopenblas-base
Architecture: amd64 arm64 armhf i386 powerpc ppc64el ppc64 kfreebsd-i386 kfreebsd-amd64 mips64el sparc64
+Multi-Arch: same
Section: libs
Depends: ${shlibs:Depends},
- ${misc:Depends},
- libblas-common
+ ${misc:Depends}
+Breaks: libblas3 (<< 3.7.1-2~),
+ liblapack3 (<< 3.7.1-2~),
+ libatlas3-base (<< 3.10.3-4~),
+ libopenblas-dev (<< 0.2.20+ds-3~)
Provides: libblas.so.3,
liblapack.so.3
Built-Using: ${Built-Using}
@@ -33,11 +38,14 @@ Description: Optimized BLAS (linear algebra) library (shared library)
Package: libopenblas-dev
Architecture: amd64 arm64 armhf i386 powerpc ppc64el ppc64 kfreebsd-i386 kfreebsd-amd64 mips64el sparc64
+Multi-Arch: same
Section: libdevel
Depends: libopenblas-base (= ${binary:Version}),
- libblas-dev,
${shlibs:Depends},
${misc:Depends}
+Breaks: libblas-dev (<< 3.7.1-2~),
+ liblapack-dev (<< 3.7.1-2~),
+ libatlas-base-dev (<< 3.10.3-4~)
Provides: libblas.so,
liblapack.so
Built-Using: ${Built-Using}
diff --git a/debian/lapack-openblas.pc.in b/debian/lapack-openblas.pc.in
index 75a3f08..a5758c7 100644
--- a/debian/lapack-openblas.pc.in
+++ b/debian/lapack-openblas.pc.in
@@ -1,6 +1,6 @@
prefix=/usr
-libdir=${prefix}/lib/openblas-base
-includedir=${prefix}/include/openblas
+libdir=${prefix}/lib/@DEB_HOST_MULTIARCH@/openblas
+includedir=${prefix}/include/@DEB_HOST_MULTIARCH@
Name: openblas-lapack
Description: Optimized BLAS (linear algebra) library, LAPACK
Version: @DEB_VERSION_UPSTREAM@
diff --git a/debian/libopenblas-base.install b/debian/libopenblas-base.install
old mode 100644
new mode 100755
index 97c1ffa..8c207b1
--- a/debian/libopenblas-base.install
+++ b/debian/libopenblas-base.install
@@ -1,4 +1,6 @@
-usr/lib/libopenblas*-r0.*.so
-usr/lib/libopenblas.so.0
-interface/libblas.so.3 usr/lib/openblas-base/
-interface/liblapack.so.3 usr/lib/openblas-base/
+#!/usr/bin/dh-exec
+
+usr/lib/*/libopenblas*-r0.*.so
+usr/lib/*/libopenblas.so.0
+interface/libblas.so.3 usr/lib/${DEB_HOST_MULTIARCH}/openblas/
+interface/liblapack.so.3 usr/lib/${DEB_HOST_MULTIARCH}/openblas/
diff --git a/debian/libopenblas-base.postinst b/debian/libopenblas-base.postinst
deleted file mode 100644
index 487b869..0000000
--- a/debian/libopenblas-base.postinst
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh
-
-set -e
-
-update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 \
- /usr/lib/openblas-base/libblas.so.3 40 \
- --slave /usr/lib/libblas.so.3gf libblas.so.3gf /usr/lib/openblas-base/libblas.so.3
-
-update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 \
- /usr/lib/openblas-base/liblapack.so.3 40 \
- --slave /usr/lib/liblapack.so.3gf liblapack.so.3gf /usr/lib/openblas-base/liblapack.so.3
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/libopenblas-base.postinst.in b/debian/libopenblas-base.postinst.in
new file mode 100644
index 0000000..8da9ef2
--- /dev/null
+++ b/debian/libopenblas-base.postinst.in
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+set -e
+
+update-alternatives --install /usr/lib/@DEB_HOST_MULTIARCH@/libblas.so.3 \
+ libblas.so.3- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/libblas.so.3 40
+
+update-alternatives --install /usr/lib/@DEB_HOST_MULTIARCH@/liblapack.so.3 \
+ liblapack.so.3- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/liblapack.so.3 40
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/libopenblas-base.preinst b/debian/libopenblas-base.preinst
index e9f69a7..07942b7 100644
--- a/debian/libopenblas-base.preinst
+++ b/debian/libopenblas-base.preinst
@@ -1,18 +1,14 @@
-#! /bin/sh
+#!/bin/sh
set -e
-# In 0.2.8-4, /usr/lib/openblas-base/libopenblas.so.0 was renamed to
-# /usr/lib/openblas-base/libblas.so.3. It is therefore necessary to remove the
-# old path from the alternatives system before adding the new.
-if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 0.2.8-4
+# Cleanup pre-multiarch alternative
+if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 0.2.20+ds-3~
then
- update-alternatives --remove libblas.so.3 /usr/lib/openblas-base/libopenblas.so.0 2>/dev/null
+ update-alternatives --remove libblas.so.3 /usr/lib/openblas-base/libblas.so.3
+ update-alternatives --remove liblapack.so.3 /usr/lib/openblas-base/liblapack.so.3
fi
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
#DEBHELPER#
exit 0
diff --git a/debian/libopenblas-base.prerm b/debian/libopenblas-base.prerm
deleted file mode 100644
index c27ae00..0000000
--- a/debian/libopenblas-base.prerm
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" != "upgrade" ]
-then
- update-alternatives --remove libblas.so.3 \
- /usr/lib/openblas-base/libblas.so.3
-
- update-alternatives --remove liblapack.so.3 \
- /usr/lib/openblas-base/liblapack.so.3
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/libopenblas-base.prerm.in b/debian/libopenblas-base.prerm.in
new file mode 100644
index 0000000..094ae41
--- /dev/null
+++ b/debian/libopenblas-base.prerm.in
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "upgrade" ]
+then
+ update-alternatives --remove libblas.so.3- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/libblas.so.3
+
+ update-alternatives --remove liblapack.so.3- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/liblapack.so.3
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/libopenblas-dev.install b/debian/libopenblas-dev.install
old mode 100644
new mode 100755
index 99a451b..473c692
--- a/debian/libopenblas-dev.install
+++ b/debian/libopenblas-dev.install
@@ -1,4 +1,6 @@
-usr/lib/libopenblas*.a
-usr/lib/libopenblas.so
-usr/include/* /usr/include/openblas/
-debian/*.pc /usr/lib/pkgconfig
+#!/usr/bin/dh-exec
+
+usr/lib/*/libopenblas*.a
+usr/lib/*/libopenblas.so
+usr/include/*
+debian/*.pc /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig
diff --git a/debian/libopenblas-dev.links b/debian/libopenblas-dev.links
old mode 100644
new mode 100755
index e65523f..0e193d3
--- a/debian/libopenblas-dev.links
+++ b/debian/libopenblas-dev.links
@@ -1,4 +1,6 @@
-usr/lib/libopenblas.a usr/lib/openblas-base/libblas.a
-usr/lib/libopenblas.a usr/lib/openblas-base/liblapack.a
-usr/lib/openblas-base/libblas.so.3 usr/lib/openblas-base/libblas.so
-usr/lib/openblas-base/liblapack.so.3 usr/lib/openblas-base/liblapack.so
+#!/usr/bin/dh-exec
+
+usr/lib/${DEB_HOST_MULTIARCH}/libopenblas.a usr/lib/${DEB_HOST_MULTIARCH}/openblas/libblas.a
+usr/lib/${DEB_HOST_MULTIARCH}/libopenblas.a usr/lib/${DEB_HOST_MULTIARCH}/openblas/liblapack.a
+usr/lib/${DEB_HOST_MULTIARCH}/openblas/libblas.so.3 usr/lib/${DEB_HOST_MULTIARCH}/openblas/libblas.so
+usr/lib/${DEB_HOST_MULTIARCH}/openblas/liblapack.so.3 usr/lib/${DEB_HOST_MULTIARCH}/openblas/liblapack.so
diff --git a/debian/libopenblas-dev.postinst b/debian/libopenblas-dev.postinst
deleted file mode 100644
index f7832dc..0000000
--- a/debian/libopenblas-dev.postinst
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh
-
-set -e
-
-update-alternatives --install /usr/lib/libblas.so libblas.so \
- /usr/lib/openblas-base/libblas.so 40 \
- --slave /usr/lib/libblas.a libblas.a \
- /usr/lib/openblas-base/libblas.a \
- --slave /usr/lib/pkgconfig/blas.pc blas.pc \
- /usr/lib/pkgconfig/blas-openblas.pc
-
-update-alternatives --install /usr/lib/liblapack.so liblapack.so \
- /usr/lib/openblas-base/liblapack.so 40 \
- --slave /usr/lib/liblapack.a liblapack.a \
- /usr/lib/openblas-base/liblapack.a \
- --slave /usr/lib/pkgconfig/lapack.pc lapack.pc \
- /usr/lib/pkgconfig/lapack-openblas.pc
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/libopenblas-dev.postinst.in b/debian/libopenblas-dev.postinst.in
new file mode 100644
index 0000000..3b2ea37
--- /dev/null
+++ b/debian/libopenblas-dev.postinst.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+update-alternatives --install /usr/lib/@DEB_HOST_MULTIARCH@/libblas.so libblas.so- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/libblas.so 40 \
+ --slave /usr/lib/@DEB_HOST_MULTIARCH@/libblas.a libblas.a- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/libblas.a \
+ --slave /usr/include/@DEB_HOST_MULTIARCH@/cblas.h cblas.h- at DEB_HOST_MULTIARCH@ \
+ /usr/include/@DEB_HOST_MULTIARCH@/cblas-openblas.h \
+ --slave /usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/blas.pc \
+ blas.pc- at DEB_HOST_MULTIARCH@ /usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/blas-openblas.pc
+
+update-alternatives --install /usr/lib/@DEB_HOST_MULTIARCH@/liblapack.so \
+ liblapack.so- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/liblapack.so 40 \
+ --slave /usr/lib/@DEB_HOST_MULTIARCH@/liblapack.a liblapack.a- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/liblapack.a \
+ --slave /usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/lapack.pc \
+ lapack.pc- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/lapack-openblas.pc
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/libopenblas-dev.preinst b/debian/libopenblas-dev.preinst
index 759948a..84fcc54 100644
--- a/debian/libopenblas-dev.preinst
+++ b/debian/libopenblas-dev.preinst
@@ -1,18 +1,14 @@
-#! /bin/sh
+#!/bin/sh
set -e
-# In 0.2.8-4, /usr/lib/openblas-base/libopenblas.so was renamed to
-# /usr/lib/openblas-base/libblas.so. It is therefore necessary to remove the
-# old path from the alternatives system before adding the new.
-if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 0.2.8-4
+# Cleanup pre-multiarch alternative
+if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 0.2.20+ds-3~
then
- update-alternatives --remove libblas.so /usr/lib/openblas-base/libopenblas.so 2>/dev/null
+ update-alternatives --remove libblas.so /usr/lib/openblas-base/libblas.so
+ update-alternatives --remove liblapack.so /usr/lib/openblas-base/liblapack.so
fi
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
#DEBHELPER#
exit 0
diff --git a/debian/libopenblas-dev.prerm b/debian/libopenblas-dev.prerm
deleted file mode 100644
index 8cc8dbb..0000000
--- a/debian/libopenblas-dev.prerm
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" != "upgrade" ]
-then
- update-alternatives --remove libblas.so \
- /usr/lib/openblas-base/libblas.so
-
- update-alternatives --remove liblapack.so \
- /usr/lib/openblas-base/liblapack.so
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/libopenblas-dev.prerm.in b/debian/libopenblas-dev.prerm.in
new file mode 100644
index 0000000..d4a20dc
--- /dev/null
+++ b/debian/libopenblas-dev.prerm.in
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "upgrade" ]
+then
+ update-alternatives --remove libblas.so- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/libblas.so
+
+ update-alternatives --remove liblapack.so- at DEB_HOST_MULTIARCH@ \
+ /usr/lib/@DEB_HOST_MULTIARCH@/openblas/liblapack.so
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/patches/no-embedded-lapack.patch b/debian/patches/no-embedded-lapack.patch
index f519b5e..6f9e642 100644
--- a/debian/patches/no-embedded-lapack.patch
+++ b/debian/patches/no-embedded-lapack.patch
@@ -15,7 +15,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-ifeq ($(NO_LAPACK), 1)
netlib :
+ mkdir lapack-netlib
-+ cd lapack-netlib && ar -x /usr/lib/lapack/liblapack_pic.a
++ cd lapack-netlib && ar -x /usr/lib/$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/liblapack_pic.a
+ make -C interface delete-duplicate-lapack-objects
+ ar -ru $(LIBNAME) lapack-netlib/*
diff --git a/debian/patches/order-files.patch b/debian/patches/order-files.patch
index a48c7b4..443e7b4 100644
--- a/debian/patches/order-files.patch
+++ b/debian/patches/order-files.patch
@@ -10,7 +10,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+++ b/Makefile
@@ -210,7 +210,7 @@ netlib :
mkdir lapack-netlib
- cd lapack-netlib && ar -x /usr/lib/lapack/liblapack_pic.a
+ cd lapack-netlib && ar -x /usr/lib/$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/liblapack_pic.a
make -C interface delete-duplicate-lapack-objects
- ar -ru $(LIBNAME) lapack-netlib/*
+ ar -ru $(LIBNAME) `LC_ALL=C ls lapack-netlib/*`
diff --git a/debian/rules b/debian/rules
index e6cbac1..18ed668 100755
--- a/debian/rules
+++ b/debian/rules
@@ -65,23 +65,14 @@ endif
%:
dh $@
-debian/blas-openblas.pc: debian/blas-openblas.pc.in
- sed -e "s%@DEB_VERSION_UPSTREAM@%$(DEB_VERSION_UPSTREAM)%" < $< > $@
-
-debian/lapack-openblas.pc: debian/lapack-openblas.pc.in
- sed -e "s%@DEB_VERSION_UPSTREAM@%$(DEB_VERSION_UPSTREAM)%" < $< > $@
-
-override_dh_auto_build: debian/blas-openblas.pc debian/lapack-openblas.pc
+override_dh_auto_build:
$(MAKE) $(MAKE_OPTIONS)
$(MAKE) -C interface shared-blas-lapack $(MAKE_OPTIONS)
override_dh_auto_install:
- $(MAKE) install $(MAKE_OPTIONS) DESTDIR=debian/tmp/ PREFIX=/usr
-
-override_dh_auto_clean:
- dh_auto_clean
- rm -f debian/*.pc
+ $(MAKE) install $(MAKE_OPTIONS) DESTDIR=debian/tmp/ PREFIX=/usr OPENBLAS_INCLUDE_DIR=/usr/include/$(DEB_HOST_MULTIARCH) OPENBLAS_LIBRARY_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)
+ mv debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/cblas.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/cblas-openblas.h
# We want packages linked with -lblas to depend on any BLAS alternative, and we
# want packages linked with -lopenblas to depend specifically on
@@ -99,5 +90,18 @@ override_dh_gencontrol:
override_dh_strip:
dh_strip --dbgsym-migration='libopenblas-dbg (<< 0.2.16-1~)'
+GENERATED_DEBIAN_FILES := $(patsubst %.in,%,$(wildcard debian/*.pc.in debian/*.postinst.in debian/*.prerm.in))
+
+$(GENERATED_DEBIAN_FILES): %: %.in
+ sed -e "s/@DEB_VERSION_UPSTREAM@/$(DEB_VERSION_UPSTREAM)/g" \
+ -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" < $< > $@
+
+override_dh_install: $(GENERATED_DEBIAN_FILES)
+ dh_install
+
+override_dh_clean:
+ dh_clean
+ rm -f $(GENERATED_DEBIAN_FILES)
+
get-orig-source:
-uscan --upstream-version 0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/openblas.git
More information about the debian-science-commits
mailing list