]> git.pld-linux.org Git - packages/python-pyasn1_modules.git/blob - python-pyasn1_modules.spec
0e86cf9f5e929f482ba3617fe20c36e3afc38242
[packages/python-pyasn1_modules.git] / python-pyasn1_modules.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # unit tests
6
7 Summary:        ASN.1 modules for Python 2
8 Summary(pl.UTF-8):      Moduły ASN.1 dla Pythona 2
9 Name:           python-pyasn1_modules
10 Version:        0.2.8
11 Release:        2
12 License:        BSD-like
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/pyasn1-modules/
15 Source0:        https://files.pythonhosted.org/packages/source/p/pyasn1-modules/pyasn1-modules-%{version}.tar.gz
16 # Source0-md5:  107e1ece7d0a41d782f69f8a95a4d9bc
17 URL:            https://github.com/etingof/pyasn1-modules
18 %if %{with python2}
19 BuildRequires:  python >= 1:2.5
20 BuildRequires:  python-setuptools
21 %if %{with tests}
22 BuildRequires:  python-pyasn1 >= 0.4.1
23 BuildRequires:  python-pyasn1 < 0.5.0
24 %if "%{py_ver}" < "2.7"
25 BuildRequires:  python-unittest2
26 %endif
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3 >= 1:3.2
31 BuildRequires:  python3-setuptools
32 %if %{with tests}
33 BuildRequires:  python3-pyasn1 >= 0.4.1
34 BuildRequires:  python3-pyasn1 < 0.5.0
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 Requires:       python-modules >= 1:2.5
40 Requires:       python-pyasn1 >= 0.4.1
41 Requires:       python-pyasn1 < 0.5.0
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 This is a small but growing collection of ASN.1 data structures
47 expressed in Python terms using pyasn1 data model.
48
49 It's thought to be useful to protocol developers and testers.
50
51 %description -l pl.UTF-8
52 Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
53 wyrażona w Pythonie przy użyciu modelu danych pyasn1.
54
55 Jest rozwijana z myślą o programistach i testerach protokołów.
56
57 %package -n python3-pyasn1_modules
58 Summary:        ASN.1 modules for Python 2
59 Summary(pl.UTF-8):      Moduły ASN.1 dla Pythona 2
60 Group:          Libraries/Python
61 Requires:       python3-modules >= 1:2.5
62 Requires:       python3-pyasn1 >= 0.4.1
63 Requires:       python3-pyasn1 < 0.5.0
64 Obsoletes:      python3-pyasn1-modules
65
66 %description -n python3-pyasn1_modules
67 This is a small but growing collection of ASN.1 data structures
68 expressed in Python terms using pyasn1 data model.
69
70 It's thought to be useful to protocol developers and testers.
71
72 %description -n python3-pyasn1_modules -l pl.UTF-8
73 Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
74 wyrażona w Pythonie przy użyciu modelu danych pyasn1.
75
76 Jest rozwijana z myślą o programistach i testerach protokołów.
77
78 %prep
79 %setup -q -n pyasn1-modules-%{version}
80
81 %build
82 %if %{with python2}
83 %py_build %{?with_tests:test}
84 %endif
85
86 %if %{with python3}
87 %py3_build %{?with_tests:test}
88 %endif
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %if %{with python2}
94 %py_install
95
96 %py_postclean
97
98 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
100 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
101 %endif
102
103 %if %{with python3}
104 %py3_install
105
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version}
107 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version}
108 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version}/*.py
109 %endif
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 %if %{with python2}
115 %files
116 %defattr(644,root,root,755)
117 %doc CHANGES.txt LICENSE.txt README.md
118 %{py_sitescriptdir}/pyasn1_modules
119 %{py_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
120 %{_examplesdir}/%{name}-%{version}
121 %endif
122
123 %if %{with python3}
124 %files -n python3-pyasn1_modules
125 %defattr(644,root,root,755)
126 %doc CHANGES.txt LICENSE.txt README.md
127 %{py3_sitescriptdir}/pyasn1_modules
128 %{py3_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
129 %{_examplesdir}/python3-pyasn1_modules-%{version}
130 %endif
This page took 0.067969 seconds and 2 git commands to generate.