]> git.pld-linux.org Git - packages/python-nagiosplugin.git/blob - python-nagiosplugin.spec
Up to 1.3.3
[packages/python-nagiosplugin.git] / python-nagiosplugin.spec
1 # TODO:
2 # Split examplest to separate module
3 #
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
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}
14 Version:        1.3.3
15 Release:        1
16 License:        ZPL 2.1
17 Group:          Libraries/Python
18 Source0:        https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz
19 # Source0-md5:  7539bf58002fb1285706d91e94dd4e26
20 URL:            nagiosplugin
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.710
23 %if %{with python2}
24 BuildRequires:  python-devel
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-pytest
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-devel
32 BuildRequires:  python3-modules
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-pytest
36 %endif
37 %endif
38 Requires:       python-modules
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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
46
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.
51
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
57
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
62
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.
67
68 %package apidocs
69 Summary:        %{module} API documentation
70 Summary(pl.UTF-8):      Dokumentacja API %{module}
71 Group:          Documentation
72
73 %description apidocs
74 API documentation for %{module}.
75
76 %description apidocs -l pl.UTF-8
77 Dokumentacja API %{module}.
78
79 %prep
80 %setup -q -n %{module}-%{version}
81
82 install -d examples
83 cp -p nagiosplugin/examples/check_*.py examples
84
85 %build
86 %if %{with python2}
87 %py_build
88
89 %if %{with tests}
90 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
91 %{__python} -m pytest tests
92 %endif
93 %endif
94
95 %if %{with python3}
96 %py3_build
97
98 %if %{with tests}
99 %{__python3} -m pytest tests
100 %endif
101 %endif
102
103 %if %{with doc}
104 cd docs
105 %{__make} -j1 html
106 rm -rf _build/html/_sources
107 %endif
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %py_install
114
115 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/examples
116 %py_postclean
117
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
119 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
120 %endif
121
122 %if %{with python3}
123 %py3_install
124
125 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/examples
126
127 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
128 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
129 %endif
130
131 %clean
132 rm -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
138 %{py_sitescriptdir}/%{module}
139 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
140 %{_examplesdir}/python-%{module}-%{version}
141 %endif
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
149 %{_examplesdir}/python3-%{module}-%{version}
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.088058 seconds and 4 git commands to generate.