[packages/python-pyasn1_modules] - new URLs, updated to 0.2.1 - added python3- package

qboosh qboosh at pld-linux.org
Sat May 26 09:05:13 CEST 2018


commit 11dfbe94b24c0bda2b28033b5e60c62b30e8aa1f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat May 26 09:06:08 2018 +0200

    - new URLs, updated to 0.2.1
    - added python3- package

 python-pyasn1_modules.spec | 113 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 96 insertions(+), 17 deletions(-)
---
diff --git a/python-pyasn1_modules.spec b/python-pyasn1_modules.spec
index 72ad34b..4ba8353 100644
--- a/python-pyasn1_modules.spec
+++ b/python-pyasn1_modules.spec
@@ -1,21 +1,45 @@
+#
+# Conditional build:
+%bcond_without	python2	# CPython 2.x module
+%bcond_without	python3	# CPython 3.x module
+%bcond_without	tests	# unit tests
 
 %define		module	pyasn1-modules
-
-Summary:	ASN.1 tools for Python
-Summary(pl.UTF-8):	Narzędzia ASN.1 dla Pythona
+Summary:	ASN.1 modules for Python 2
+Summary(pl.UTF-8):	Moduły ASN.1 dla Pythona 2
 Name:		python-pyasn1_modules
-Version:	0.0.2
-Release:	2
+Version:	0.2.1
+Release:	1
 License:	BSD-like
 Group:		Libraries/Python
-Source0:	http://downloads.sourceforge.net/pyasn1/%{module}-%{version}.tar.gz
-# Source0-md5:	adc49aee6603a162f9d4a6830c8dc470
-URL:		http://pyasn1.sourceforge.net/
-BuildRequires:	rpmbuild(macros) >= 1.710
+#Source0Download: https://pypi.org/simple/pyasn1-modules/
+Source0:	https://files.pythonhosted.org/packages/source/p/pyasn1-modules/%{module}-%{version}.tar.gz
+# Source0-md5:	ff938698590f314ff9b3d5c48737d899
+URL:		https://github.com/etingof/pyasn1-modules
+%if %{with python2}
 BuildRequires:	python >= 1:2.5
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-pyasn1 >= 0.4.1
+BuildRequires:	python-pyasn1 < 0.5.0
+%if "%{py_ver}" < "2.7"
+BuildRequires:	python-unittest2
+%endif
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3 >= 1:3.2
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-pyasn1 >= 0.4.1
+BuildRequires:	python3-pyasn1 < 0.5.0
+%endif
+%endif
 BuildRequires:	rpm-pythonprov
-%pyrequires_eq	python-modules
-Requires:	python-pyasn1 >= 0.0.13
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python-modules >= 1:2.5
+Requires:	python-pyasn1 >= 0.4.1
+Requires:	python-pyasn1 < 0.5.0
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -25,27 +49,82 @@ expressed in Python terms using pyasn1 data model.
 
 It's thought to be useful to protocol developers and testers.
 
+%description -l pl.UTF-8
+Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
+wyrażona w Pythonie przy użyciu modelu danych pyasn1.
+
+Jest rozwijana z myślą o programistach i testerach protokołów.
+
+%package -n python3-%{module}
+Summary:	ASN.1 modules for Python 2
+Summary(pl.UTF-8):	Moduły ASN.1 dla Pythona 2
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:2.5
+Requires:	python3-pyasn1 >= 0.4.1
+Requires:	python3-pyasn1 < 0.5.0
+
+%description -n python3-%{module}
+This is a small but growing collection of ASN.1 data structures
+expressed in Python terms using pyasn1 data model.
+
+It's thought to be useful to protocol developers and testers.
+
+%description -n python3-%{module} -l pl.UTF-8
+Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
+wyrażona w Pythonie przy użyciu modelu danych pyasn1.
+
+Jest rozwijana z myślą o programistach i testerach protokołów.
+
 %prep
 %setup -q -n %{module}-%{version}
 
 %build
-%py_build
+%if %{with python2}
+%py_build %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%py3_build %{?with_tests:test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
+%if %{with python2}
 %py_install
 
-find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -name "*.py" | xargs rm
+%py_postclean
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
+%endif
+
+%if %{with python3}
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+%{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc README CHANGES
+%doc CHANGES.txt LICENSE.txt README.md
 %{py_sitescriptdir}/pyasn1_modules
-%{py_sitescriptdir}/*.egg-info
-%{_examplesdir}/*
+%{py_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
+%{_examplesdir}/%{name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGES.txt LICENSE.txt README.md
+%{py3_sitescriptdir}/pyasn1_modules
+%{py3_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
+%{_examplesdir}/python3-%{module}-%{version}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyasn1_modules.git/commitdiff/11dfbe94b24c0bda2b28033b5e60c62b30e8aa1f



More information about the pld-cvs-commit mailing list