2 # Split examplest to separate module
5 %bcond_with doc # don't build doc
6 %bcond_without tests # do not perform "make test"
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
10 %define module nagiosplugin
11 Summary: Python class library which helps writing Nagios (or Icinga) compatible plugins easily in Python
12 Summary(pl.UTF-8): Biblioteka klas Pythona pomagająca łatwo pisać wtyczki dla Nagiosa (lub Icingi) w Pythonie
13 Name: python-%{module}
17 Group: Libraries/Python
18 Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz
19 # Source0-md5: 7539bf58002fb1285706d91e94dd4e26
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.710
24 BuildRequires: python-devel
25 BuildRequires: python-setuptools
27 BuildRequires: python-pytest
31 BuildRequires: python3-devel
32 BuildRequires: python3-modules
33 BuildRequires: python3-setuptools
35 BuildRequires: python3-pytest
38 Requires: python-modules
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 nagiosplugin is a Python class library which helps writing Nagios (or
44 Icinga) compatible plugins easily in Python. It cares for much of the
45 boilerplate code and default logic commonly found in Nagios checks
47 %description -l pl.UTF-8
48 nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
49 wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
50 typowego kodu i domyślna logikę zawartą w testach Nagiosa.
52 %package -n python3-%{module}
53 Summary: Python class library which helps writing Nagios (or Icinga) compatible plugins easily in Python
54 Summary(pl.UTF-8): Biblioteka klas Pythona pomagająca łatwo pisać wtyczki dla Nagiosa (lub Icingi) w Pythonie
55 Group: Libraries/Python
56 Requires: python3-modules
58 %description -n python3-%{module}
59 nagiosplugin is a Python class library which helps writing Nagios (or
60 Icinga) compatible plugins easily in Python. It cares for much of the
61 boilerplate code and default logic commonly found in Nagios checks
63 %description -n python3-%{module} -l pl.UTF-8
64 nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
65 wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
66 typowego kodu i domyślna logikę zawartą w testach Nagiosa.
69 Summary: %{module} API documentation
70 Summary(pl.UTF-8): Dokumentacja API %{module}
74 API documentation for %{module}.
76 %description apidocs -l pl.UTF-8
77 Dokumentacja API %{module}.
80 %setup -q -n %{module}-%{version}
83 cp -p nagiosplugin/examples/check_*.py examples
90 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
91 %{__python} -m pytest tests
99 %{__python3} -m pytest tests
106 rm -rf _build/html/_sources
110 rm -rf $RPM_BUILD_ROOT
115 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/examples
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
119 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
125 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/examples
127 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
128 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
132 rm -rf $RPM_BUILD_ROOT
136 %defattr(644,root,root,755)
137 %doc HACKING.txt CONTRIBUTORS.txt HISTORY.txt README.txt
138 %{py_sitescriptdir}/%{module}
139 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
140 %{_examplesdir}/python-%{module}-%{version}
144 %files -n python3-%{module}
145 %defattr(644,root,root,755)
146 %doc HACKING.txt CONTRIBUTORS.txt HISTORY.txt README.txt
147 %{py3_sitescriptdir}/%{module}
148 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
149 %{_examplesdir}/python3-%{module}-%{version}
154 %defattr(644,root,root,755)
155 %doc docs/_build/html/*