14
0

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
This commit is contained in:
2015-11-20 10:24:42 +00:00
committed by Git OBS Bridge
parent 429cf82364
commit f33c837334
3 changed files with 40 additions and 5 deletions

View File

@@ -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
%changelog