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