+
Summary: Python interface to OpenSSL
+Summary(pl): Interfejs Pythona do OpenSSL
Name: python-M2Crypto
-Version: 0.06
-Release: 1
-License: BSD-style
-Source0: http://www.pobox.org.sg/home/ngps/m2/m2crypto-%{version}.zip
-URL: http://www.pobox.org.sg/home/ngps/m2/
+Version: 0.13
+Release: 4
+License: BSD-like
+Source0: http://sandbox.rulemaker.net/ngps/Dist/m2crypto-%{version}.zip
+# Source0-md5: be2790a34349ab452dddbcfe4c95606a
+# http://sandbox.rulemaker.net/ngps/Dist/0.13p1.patch
+Patch0: %{name}-0.13p1.patch
+Patch1: %{name}-swig_sources.patch
+URL: http://sandbox.rulemaker.net/ngps/m2/
Group: Development/Languages/Python
-Group(de): Entwicklung/Sprachen/Python
-Group(pl): Programowanie/Jêzyki/Python
-Requires: python >= 1.5.2
-BuildRequires: python-devel >= 1.5.2
-BuildRequires: openssl-devel >= 0.9.6
-BuildRequires: swig
+%pyrequires_eq python
+BuildRequires: python-devel >= 2.2.1
+BuildRequires: openssl-devel >= 0.9.7d
+BuildRequires: swig >= 1.3.17
+BuildRequires: rpm-pythonprov
+BuildRequires: unzip
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define python_prefix %(echo `python -c "import sys; print sys.prefix"`)
-%define python_version %(echo `python -c "import sys; print sys.version[:3]"`)
-%define python_includedir %{_includedir}/python%{python_version}
-%define python_libdir %{python_prefix}/lib/python%{python_version}
-%define python_sitedir %{python_libdir}/site-packages
-%define python_compile_opt python -O -c "import compileall; compileall.compile_dir('.')"
-%define python_compile python -c "import compileall; compileall.compile_dir('.')"
-
%description
M2Crypto makes accessible to the Python programmer the following:
- DH, RSA, DSA, symmetric ciphers, message digests, HMACs.
- SSL functionality to implement clients and servers.
- S/MIME v2.
-M2Crypto is released under a very liberal BSD-style licence. See
+M2Crypto is released under a very liberal BSD-like licence. See
LICENCE for details.
+%description -l pl
+M2Crypto udostêpnia z poziomu Pythona nastêpuj±ce funkcje:
+- DH, RSA, DSA, szyfry symetryczne, skróty, HMAC
+- SSL do implementacji klientów i serwerów
+- S/MIME v2.
+
%prep
%setup -q -n m2crypto-%{version}
+%patch0 -p0
+%patch1 -p1
%build
-make -C swig INCLUDE="-I. -I%{python_includedir}"
-cd M2Crypto
-%{python_compile}
-%{python_compile_opt}
+python setup.py build
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{python_sitedir}
-
-find M2Crypto -name \*.py | xargs -r rm -f
-cp -a M2Crypto $RPM_BUILD_ROOT%{python_sitedir}
+install -d $RPM_BUILD_ROOT%{py_sitedir}
-gzip -9nf BUGS CHANGES INSTALL LICENCE README STORIES
+python setup.py install \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
+# shutup check-files
+find $RPM_BUILD_ROOT/%{py_sitedir} -name \*.py \
+ -exec rm {} \;
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc *.gz doc/*.html demo
-%{python_sitedir}/M2Crypto
+%doc BUGS CHANGES INSTALL LICENCE README doc/*.html demo
+%attr(755,root,root) %{py_sitedir}/M2Crypto/*.so
+%{py_sitedir}/M2Crypto/*.py[oc]
+%dir %{py_sitedir}/M2Crypto/SSL
+%{py_sitedir}/M2Crypto/SSL/*.py[oc]
+%dir %{py_sitedir}/M2Crypto/PGP
+%{py_sitedir}/M2Crypto/PGP/*.py[oc]