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