From f33c8373347bc1ec1b2a01c3186ec1232d08bf9998c2e78891bc2cdfce0c0d6b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 20 Nov 2015 10:24:42 +0000 Subject: [PATCH] Accepting request 345304 from home:darix:branches:devel:languages:python - no longer build as noarch package, while the code is still noarch. we actually depend on the native library at runtime. To be able to make this work properly we need to require that native library, that native requires makes us arch dependent. - make sure we require the libsodium version we were built with - fix libsodium loading on Tumbleweed: soversion was bumped to 17 reported as https://github.com/saltstack/libnacl/pull/60 adds libnacl-1.4.3_bump_libsodium_soversion.patch OBS-URL: https://build.opensuse.org/request/show/345304 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libnacl?expand=0&rev=24 --- libnacl-1.4.3_bump_libsodium_soversion.patch | 13 ++++++++++++ python-libnacl.changes | 21 ++++++++++++++++++++ python-libnacl.spec | 11 +++++----- 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 libnacl-1.4.3_bump_libsodium_soversion.patch diff --git a/libnacl-1.4.3_bump_libsodium_soversion.patch b/libnacl-1.4.3_bump_libsodium_soversion.patch new file mode 100644 index 0000000..816e0b7 --- /dev/null +++ b/libnacl-1.4.3_bump_libsodium_soversion.patch @@ -0,0 +1,13 @@ +Index: libnacl-1.4.3/libnacl/__init__.py +=================================================================== +--- libnacl-1.4.3.orig/libnacl/__init__.py ++++ libnacl-1.4.3/libnacl/__init__.py +@@ -9,7 +9,7 @@ from libnacl.version import __version__ + import ctypes + import sys + +-__SONAMES = (13, 10, 5, 4) ++__SONAMES = (17, 13, 10, 5, 4) + + + def _get_nacl(): diff --git a/python-libnacl.changes b/python-libnacl.changes index dabc416..2b08675 100644 --- a/python-libnacl.changes +++ b/python-libnacl.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Thu Nov 19 17:04:26 UTC 2015 - mrueckert@suse.de + +- no longer build as noarch package, while the code is still + noarch. we actually depend on the native library at runtime. To + be able to make this work properly we need to require that native + library, that native requires makes us arch dependent. + +------------------------------------------------------------------- +Thu Nov 19 16:28:31 UTC 2015 - mrueckert@suse.de + +- make sure we require the libsodium version we were built with + +------------------------------------------------------------------- +Thu Nov 19 16:08:47 UTC 2015 - mrueckert@suse.de + +- fix libsodium loading on Tumbleweed: soversion was bumped to 17 + reported as https://github.com/saltstack/libnacl/pull/60 + + adds libnacl-1.4.3_bump_libsodium_soversion.patch + ------------------------------------------------------------------- Thu Jun 11 20:39:13 UTC 2015 - aboe76@gmail.com diff --git a/python-libnacl.spec b/python-libnacl.spec index 9e32a3c..e98f298 100644 --- a/python-libnacl.spec +++ b/python-libnacl.spec @@ -23,6 +23,7 @@ Summary: Python bindings for libsodium/tweetnacl based on ctypes Url: https://github.com/saltstack/libnacl Group: Development/Languages/Python Source0: https://pypi.python.org/packages/source/l/libnacl/libnacl-%{version}.tar.gz +Patch: libnacl-1.4.3_bump_libsodium_soversion.patch BuildRoot: %{_tmppath}/libnacl-%{version}-build BuildRequires: python @@ -30,11 +31,10 @@ BuildRequires: python-devel BuildRequires: libsodium-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch -%endif +# make sure we require the libsodium version we were built with +# this is extracted from the requires_eq macro because we need the -a parameter to expand the wildcard in the package name. +%(LC_ALL=C rpm -q -a --qf "Requires: %%{name}(%{__isa}) = %%{epoch}:%%{version}\n" 'libsodium*' | grep -v libsodium-devel | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") %description This library is used to gain direct access to the functions exposed by Daniel J. Bernstein's nacl library via libsodium or tweetnacl. @@ -43,6 +43,7 @@ in libnacl/__init__.py can be pulled out and placed directly in any project to g %prep %setup -q -n libnacl-%{version} +%patch -p1 %build python setup.py build @@ -54,4 +55,4 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot} --optimize=1 %defattr(-,root,root) %{python_sitelib}/* -%changelog \ No newline at end of file +%changelog