]> git.pld-linux.org Git - packages/python-nagiosplugin.git/commitdiff
Initial version 1.2.2-1. auto/th/python-nagiosplugin-1.2.2-1
authorMateusz Korniak <matkor@pld-linux.org>
Thu, 2 Jul 2015 14:31:08 +0000 (16:31 +0200)
committerMateusz Korniak <matkor@pld-linux.org>
Thu, 2 Jul 2015 14:31:08 +0000 (16:31 +0200)
python-nagiosplugin.spec [new file with mode: 0644]

diff --git a/python-nagiosplugin.spec b/python-nagiosplugin.spec
new file mode 100644 (file)
index 0000000..6463eff
--- /dev/null
@@ -0,0 +1,170 @@
+# TODO:
+# Split examplest to separate module
+# Conditional build:
+%bcond_with    doc             # don't build doc
+%bcond_without tests   # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+%define        module  nagiosplugin
+Summary:       Python class library which helps writing Nagios (or Icinga) compatible plugins easily in Python
+Summary(pl.UTF-8):     Biblioteka klas Pythona pomagająca łatwo pisać wtyczki dla Nagiosa (lub Icingi) w Pythonie
+# Name must match the python module/package name (as in 'import' statement)
+Name:          python-%{module}
+Version:       1.2.2
+Release:       1
+License:       ZPL 2.1
+Group:         Libraries/Python
+
+# https://pypi.python.org/packages/source/n/nagiosplugin/nagiosplugin-1.2.2.tar.gz
+Source0:       https://pypi.python.org/packages/source/n/%{module}/%{module}-%{version}.tar.gz
+# Source0-md5: c85e1641492d606d929b02aa262bf55d
+URL:           nagiosplugin
+BuildRequires: rpm-pythonprov
+# remove BR: python-devel for 'noarch' packages.
+# if py_postclean is used
+BuildRequires: rpmbuild(macros) >= 1.219
+# when using /usr/bin/env or other in-place substitutions
+#BuildRequires:        sed >= 4.0
+# when python3 present
+%if %{with python2}
+BuildRequires: python-devel
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-modules
+BuildRequires: python3-setuptools
+%endif
+# Below Rs only work for main package (python2)
+#Requires:             python-libs
+Requires:      python-modules
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+nagiosplugin is a Python class library which helps writing Nagios (or
+Icinga) compatible plugins easily in Python. It cares for much of the
+boilerplate code and default logic commonly found in Nagios checks
+
+%description -l pl.UTF-8
+nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
+wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
+typowego kodu i domyślna logikę zawartą w testach Nagiosa.
+
+%package -n python3-%{module}
+Summary:       -
+Summary(pl.UTF-8):     -
+Group:         Libraries/Python
+Requires:      python3-modules
+
+%description -n python3-%{module}
+nagiosplugin is a Python class library which helps writing Nagios (or
+Icinga) compatible plugins easily in Python. It cares for much of the
+boilerplate code and default logic commonly found in Nagios checks
+
+%description -n python3-%{module} -l pl.UTF-8
+nagiosplugin jest biblioteką klas Pythona pomagającą łatwo pisać
+wtyczki dla Nagiosa (lub Icingi) w Pythonie. Dostarcza większość
+typowego kodu i domyślna logikę zawartą w testach Nagiosa.
+
+%package apidocs
+Summary:       %{module} API documentation
+Summary(pl.UTF-8):     Dokumentacja API %{module}
+Group:         Documentation
+
+%description apidocs
+API documentation for %{module}.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API %{module}.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+# fix #!%{_bindir}/env python -> #!%{_bindir}/python:
+#%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
+
+# setup copy of source in py3 dir
+set -- *
+install -d py3
+cp -a "$@" py3
+
+%build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%if %{with doc}
+cd docs
+%{__make} -j1 html
+rm -rf _build/html/_sources
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%{__python} setup.py \
+       build --build-base build-2 \
+       install --skip-build \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+       build --build-base build-3 \
+       install --skip-build \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+%endif
+
+
+# when files are installed in other way that standard 'setup.py
+# they need to be (re-)compiled
+## change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
+#%%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+#%%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+#%%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc HACKING.txt CONTRIBUTORS.txt HISTORY.txt README.txt
+# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
+%dir %{py_sitescriptdir}/%{module}
+%{py_sitescriptdir}/%{module}/*.py[co]
+%dir %{py_sitescriptdir}/%{module}/platform
+%{py_sitescriptdir}/%{module}/platform/*.py[co]
+%dir %{py_sitescriptdir}/%{module}/tests
+%{py_sitescriptdir}/%{module}/tests/*.py[co]
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
+# %{_examplesdir}/%{name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc HACKING.txt CONTRIBUTORS.txt HISTORY.txt README.txt
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+# %{_examplesdir}/python3-%{module}-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/*
+%endif
This page took 0.112796 seconds and 4 git commands to generate.