+#
+# Conditional build:
+%bcond_with tests # test target [fails, some files are missing]
+
Summary: Python interface to OpenSSL
Summary(pl.UTF-8): Interfejs Pythona do OpenSSL
Name: python-M2Crypto
-Version: 0.22.3
+Version: 0.24.0
Release: 1
License: BSD-like
Group: Libraries/Python
+#Source0Download: https://pypi.python.org/simple/m2crypto/
Source0: https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-%{version}.tar.gz
-# Source0-md5: 573f21aaac7d5c9549798e72ffcefedd
+# Source0-md5: 8e87235942c76d1ba9f999ee33764fdb
Patch0: %{name}-store2ssl.patch
Patch1: %{name}-swig.patch
-URL: http://chandlerproject.org/bin/view/Projects/MeTooCrypto
-BuildRequires: openssl-devel >= 0.9.8
+URL: https://gitlab.com/m2crypto/m2crypto
+BuildRequires: openssl-devel >= 1.0.1e
BuildRequires: python-devel >= 1:2.6
-BuildRequires: python-modules
+BuildRequires: python-modules >= 1:2.6
+BuildRequires: python-setuptools
+%if %{with tests}
+%if "%{py_ver}" < "2.7"
+BuildRequires: python-unittest2
+%endif
+%endif
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: rpmbuild(macros) >= 1.710
BuildRequires: swig-python >= 2.0
BuildRequires: unzip
-%pyrequires_eq python
+%pyrequires_eq python-libs
+Requires: openssl >= 1.0.1e
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
- SSL do implementacji klientów i serwerów
- S/MIME v2.
+M2Crypto jest wydane na bardzo liberalnej licencji BSD - szczegóły w
+pliku LICENCE.
+
%prep
%setup -q -n M2Crypto-%{version}
%patch0 -p1
%patch1 -p1
%build
-%{__python} setup.py build
+%py_build %{?with_tests:test}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{py_sitedir},%{_examplesdir}/%{name}-%{version}}
-%{__python} setup.py install \
- --root=$RPM_BUILD_ROOT \
- --optimize=2
+%py_install
%py_postclean
%files
%defattr(644,root,root,755)
-%doc README
+%doc CHANGES LICENCE README.rst
%dir %{py_sitedir}/M2Crypto
-%attr(755,root,root) %{py_sitedir}/M2Crypto/*.so
+%attr(755,root,root) %{py_sitedir}/M2Crypto/__m2crypto.so
%{py_sitedir}/M2Crypto/*.py[co]
+%dir %{py_sitedir}/M2Crypto/PGP
+%{py_sitedir}/M2Crypto/PGP/*.py[co]
%dir %{py_sitedir}/M2Crypto/SSL
%{py_sitedir}/M2Crypto/SSL/*.py[co]
%{py_sitedir}/M2Crypto-*.egg-info