]> git.pld-linux.org Git - packages/python-pyasn1_modules.git/blob - python-pyasn1_modules.spec
- new URLs, updated to 0.2.1
[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 %define         module  pyasn1-modules
8 Summary:        ASN.1 modules for Python 2
9 Summary(pl.UTF-8):      Moduły ASN.1 dla Pythona 2
10 Name:           python-pyasn1_modules
11 Version:        0.2.1
12 Release:        1
13 License:        BSD-like
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/pyasn1-modules/
16 Source0:        https://files.pythonhosted.org/packages/source/p/pyasn1-modules/%{module}-%{version}.tar.gz
17 # Source0-md5:  ff938698590f314ff9b3d5c48737d899
18 URL:            https://github.com/etingof/pyasn1-modules
19 %if %{with python2}
20 BuildRequires:  python >= 1:2.5
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-pyasn1 >= 0.4.1
24 BuildRequires:  python-pyasn1 < 0.5.0
25 %if "%{py_ver}" < "2.7"
26 BuildRequires:  python-unittest2
27 %endif
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3 >= 1:3.2
32 BuildRequires:  python3-setuptools
33 %if %{with tests}
34 BuildRequires:  python3-pyasn1 >= 0.4.1
35 BuildRequires:  python3-pyasn1 < 0.5.0
36 %endif
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 Requires:       python-modules >= 1:2.5
41 Requires:       python-pyasn1 >= 0.4.1
42 Requires:       python-pyasn1 < 0.5.0
43 BuildArch:      noarch
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
47 This is a small but growing collection of ASN.1 data structures
48 expressed in Python terms using pyasn1 data model.
49
50 It's thought to be useful to protocol developers and testers.
51
52 %description -l pl.UTF-8
53 Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
54 wyrażona w Pythonie przy użyciu modelu danych pyasn1.
55
56 Jest rozwijana z myślą o programistach i testerach protokołów.
57
58 %package -n python3-%{module}
59 Summary:        ASN.1 modules for Python 2
60 Summary(pl.UTF-8):      Moduły ASN.1 dla Pythona 2
61 Group:          Libraries/Python
62 Requires:       python3-modules >= 1:2.5
63 Requires:       python3-pyasn1 >= 0.4.1
64 Requires:       python3-pyasn1 < 0.5.0
65
66 %description -n python3-%{module}
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-%{module} -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 %{module}-%{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-%{module}-%{version}
107 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
108 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{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-%{module}
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-%{module}-%{version}
130 %endif
This page took 0.051792 seconds and 3 git commands to generate.