]> git.pld-linux.org Git - packages/python-nagiosplugin.git/blame - python-nagiosplugin.spec
Up to 1.3.3
[packages/python-nagiosplugin.git] / python-nagiosplugin.spec
CommitLineData
7b621577
MK
1# TODO:
2# Split examplest to separate module
63ec028d 3#
7b621577
MK
4# Conditional build:
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
9
10%define module nagiosplugin
11Summary: Python class library which helps writing Nagios (or Icinga) compatible plugins easily in Python
12Summary(pl.UTF-8): Biblioteka klas Pythona pomagająca łatwo pisać wtyczki dla Nagiosa (lub Icingi) w Pythonie
7b621577 13Name: python-%{module}
52380365
AM
14Version: 1.3.3
15Release: 1
7b621577
MK
16License: ZPL 2.1
17Group: Libraries/Python
52380365
AM
18Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz
19# Source0-md5: 7539bf58002fb1285706d91e94dd4e26
7b621577
MK
20URL: nagiosplugin
21BuildRequires: rpm-pythonprov
72ef76f7 22BuildRequires: rpmbuild(macros) >= 1.710
7b621577
MK
23%if %{with python2}
24BuildRequires: python-devel
25BuildRequires: python-setuptools
52380365
AM
26%if %{with tests}
27BuildRequires: python-pytest
28%endif
7b621577
MK
29%endif
30%if %{with python3}
31BuildRequires: python3-devel
32BuildRequires: python3-modules
33BuildRequires: python3-setuptools
52380365
AM
34%if %{with tests}
35BuildRequires: python3-pytest
36%endif
7b621577 37%endif
7b621577
MK
38Requires: python-modules
39BuildArch: noarch
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42%description
43nagiosplugin is a Python class library which helps writing Nagios (or
44Icinga) compatible plugins easily in Python. It cares for much of the
45boilerplate code and default logic commonly found in Nagios checks
46
47%description -l pl.UTF-8
48nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
49wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
50typowego kodu i domyślna logikę zawartą w testach Nagiosa.
51
52%package -n python3-%{module}
63ec028d
ER
53Summary: Python class library which helps writing Nagios (or Icinga) compatible plugins easily in Python
54Summary(pl.UTF-8): Biblioteka klas Pythona pomagająca łatwo pisać wtyczki dla Nagiosa (lub Icingi) w Pythonie
7b621577
MK
55Group: Libraries/Python
56Requires: python3-modules
57
58%description -n python3-%{module}
59nagiosplugin is a Python class library which helps writing Nagios (or
60Icinga) compatible plugins easily in Python. It cares for much of the
61boilerplate code and default logic commonly found in Nagios checks
62
63%description -n python3-%{module} -l pl.UTF-8
64nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
65wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
66typowego kodu i domyślna logikę zawartą w testach Nagiosa.
67
68%package apidocs
69Summary: %{module} API documentation
70Summary(pl.UTF-8): Dokumentacja API %{module}
71Group: Documentation
72
73%description apidocs
74API documentation for %{module}.
75
76%description apidocs -l pl.UTF-8
77Dokumentacja API %{module}.
78
79%prep
80%setup -q -n %{module}-%{version}
81
1a00d221 82install -d examples
52380365 83cp -p nagiosplugin/examples/check_*.py examples
1a00d221 84
7b621577
MK
85%build
86%if %{with python2}
52380365
AM
87%py_build
88
89%if %{with tests}
90PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
91%{__python} -m pytest tests
92%endif
7b621577
MK
93%endif
94
95%if %{with python3}
52380365
AM
96%py3_build
97
98%if %{with tests}
99%{__python3} -m pytest tests
100%endif
7b621577
MK
101%endif
102
103%if %{with doc}
104cd docs
105%{__make} -j1 html
106rm -rf _build/html/_sources
107%endif
108
109%install
110rm -rf $RPM_BUILD_ROOT
111
112%if %{with python2}
5a273683 113%py_install
7b621577 114
63ec028d 115%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/examples
7b621577 116%py_postclean
1a00d221
ER
117
118install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
119cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
7b621577
MK
120%endif
121
122%if %{with python3}
5a273683 123%py3_install
7b621577 124
63ec028d 125%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/examples
1a00d221
ER
126
127install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
128cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
63ec028d 129%endif
7b621577
MK
130
131%clean
132rm -rf $RPM_BUILD_ROOT
133
134%if %{with python2}
135%files
136%defattr(644,root,root,755)
137%doc HACKING.txt CONTRIBUTORS.txt HISTORY.txt README.txt
63ec028d 138%{py_sitescriptdir}/%{module}
7b621577 139%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
1a00d221 140%{_examplesdir}/python-%{module}-%{version}
7b621577 141%endif
7b621577
MK
142
143%if %{with python3}
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
1a00d221 149%{_examplesdir}/python3-%{module}-%{version}
7b621577
MK
150%endif
151
152%if %{with doc}
153%files apidocs
154%defattr(644,root,root,755)
155%doc docs/_build/html/*
156%endif
This page took 0.096001 seconds and 4 git commands to generate.