]> git.pld-linux.org Git - SPECS.git/blob - python-pysnmp.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-pysnmp.spec
1 #
2 %define         module  pysnmp
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 #
6 Summary:        SNMP engine for Python
7 Summary(pl.UTF-8):      Obsługa SNMP dla Pythona
8 Name:           python-%{module}
9 Version:        4.2.5
10 Release:        8
11 License:        BSD-like
12 Group:          Libraries/Python
13 Source0:        http://downloads.sourceforge.net/pysnmp/pysnmp-%{version}.tar.gz
14 # Source0-md5:  1f75d3e392a050e84348904fc1be3212
15 URL:            http://pysnmp.sourceforge.net/
16 BuildRequires:  rpmbuild(macros) >= 1.710
17 %if %{with python2}
18 BuildRequires:  python >= 1:2.5
19 BuildRequires:  python-setuptools
20 %endif
21 %if %{with python3}
22 BuildRequires:  python3 >= 1:2.3
23 BuildRequires:  python3-setuptools
24 %endif
25 BuildRequires:  rpm-pythonprov
26 %pyrequires_eq  python-modules
27 Requires:       python-Crypto
28 Requires:       python-pyasn1
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 This is a set of tools required by the Structure of Management
34 Information (SMI v.1 & v.2) to be used in Python programming
35 environment. Primarily, they are SNMP engine and MIB compiler.
36
37 %description -l pl.UTF-8
38 Zestaw narzędzi pozwalających pisać w Pythonie programy korzystające z
39 protokołu SNMP. Zawiera procedury służące do zarządzania obiektami MIB
40 (Management Information Base), opisanych przez normy SMI (Structure of
41 Management Information) v1 i v2.
42
43 %package -n python3-%{module}
44 Summary:        SNMP engine for Python
45 Summary(pl.UTF-8):      Obsługa SNMP dla Pythona
46 Group:          Libraries/Python
47
48 %description -n python3-%{module}
49 This is a set of tools required by the Structure of Management
50 Information (SMI v.1 & v.2) to be used in Python programming
51 environment. Primarily, they are SNMP engine and MIB compiler.
52
53 %description -n python3-%{module} -l pl.UTF-8
54 Zestaw narzędzi pozwalających pisać w Pythonie programy korzystające z
55 protokołu SNMP. Zawiera procedury służące do zarządzania obiektami MIB
56 (Management Information Base), opisanych przez normy SMI (Structure of
57 Management Information) v1 i v2.
58
59 %package doc
60 Summary:        Documentation for Python pysnmp module
61 Summary(pl.UTF-8):      Dokumentacja do modułu Pythona pysnmp
62 Group:          Libraries/Python
63
64 %description doc
65 This package contains documentation files for Python pysnmp module.
66
67 %description doc -l pl.UTF-8
68 Ten pakiet zwiera dokumentację do modułu Pythona pysnmp.
69
70 %package examples
71 Summary:        Example programs for Python pysnmp module
72 Summary(pl.UTF-8):      Programy przykładowe do modułu Pythona pysnmp
73 Group:          Libraries/Python
74 Requires:       %{name} = %{version}-%{release}
75
76 %description examples
77 This package contains example programs for Python pysnmp module.
78
79 %description examples -l pl.UTF-8
80 Ten pakiet zawiera przykładowe programy do modułu Pythona pysnmp.
81
82 %package -n python3-%{module}-examples
83 Summary:        Example programs for Python pysnmp module
84 Summary(pl.UTF-8):      Programy przykładowe do modułu Pythona pysnmp
85 Group:          Libraries/Python
86 Requires:       python3-%{module} = %{version}-%{release}
87
88 %description -n python3-%{module}-examples
89 This package contains example programs for Python pysnmp module.
90
91 %description -n python3-%{module}-examples -l pl.UTF-8
92 Ten pakiet zawiera przykładowe programy do modułu Pythona pysnmp.
93
94 %prep
95 %setup -q -n %{module}-%{version}
96
97 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' \
98         tools/libsmi2pysnmp
99
100 %build
101 %if %{with python2}
102 %py_build
103 %endif
104
105 %if %{with python3}
106 %py3_build %{?with_tests:test}
107 %endif
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT{%{_bindir},%{_examplesdir}}
112
113 %if %{with python2}
114 %py_install
115
116 find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -name "*.py" '!' -path '*/v4/smi/mibs/*' | xargs rm
117
118 cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
119 %endif
120
121 %if %{with python3}
122 %py3_install
123
124 cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
125 %endif
126
127 install tools/libsmi2pysnmp $RPM_BUILD_ROOT%{_bindir}
128
129 %clean
130 rm -rf $RPM_BUILD_ROOT
131
132 %if %{with python2}
133 %files
134 %defattr(644,root,root,755)
135 %doc README CHANGES TODO docs/mibs/*
136 %attr(755,root,root) %{_bindir}/*
137 %{py_sitescriptdir}/%{module}
138 %{py_sitescriptdir}/pysnmp-*.egg-info
139 %endif
140
141 %if %{with python3}
142 %files -n python3-%{module}
143 %defattr(644,root,root,755)
144 %doc README CHANGES TODO docs/mibs/*
145 %{py3_sitescriptdir}/%{module}
146 %{py3_sitescriptdir}/pysnmp-*.egg-info
147 %endif
148
149 %files doc
150 %defattr(644,root,root,755)
151 %doc docs/*
152
153 %if %{with python2}
154 %files examples
155 %defattr(644,root,root,755)
156 %{_examplesdir}/%{name}-%{version}
157 %endif
158
159 %if %{with python3}
160 %files -n python3-%{module}-examples
161 %defattr(644,root,root,755)
162 %{_examplesdir}/python3-%{module}-%{version}
163 %endif
This page took 0.267118 seconds and 3 git commands to generate.