0cd4f98
# Created by pyp2rpm-3.3.0
0cd4f98
%global pypi_name collectd_systemd
0cd4f98
86060ed
%global commit 212cb7918fa6925213082d11a0fe0fb44fe84852
0cd4f98
%global shortcommit %(c=%{commit}; echo ${c:0:7})
86060ed
%global snapinfo 20181018git%{shortcommit}
0cd4f98
0cd4f98
Name:           python-%{pypi_name}
0cd4f98
Version:        0.0.1
5956596
Release:        0.30.%{snapinfo}%{?dist}
0cd4f98
Summary:        Collectd plugin to monitor systemd services
0cd4f98
0cd4f98
License:        MIT
0cd4f98
URL:            https://github.com/mbachry/collectd-systemd/
0cd4f98
Source0:        https://github.com/mbachry/collectd-systemd/archive/%{commit}/collectd-system-%{shortcommit}.tar.gz
1b0307e
Source1:        collectd_systemd.te
Steve Traylen 469c749
# https://github.com/mbachry/collectd-systemd/pull/12
Steve Traylen 469c749
Patch0:         oneshot-dead.patch
Steve Traylen 2be36b0
# https://github.com/mbachry/collectd-systemd/pull/13
Steve Traylen 2be36b0
Patch1:         state-start.patch
Steve Traylen 1cdec89
# https://github.com/mbachry/collectd-systemd/pull/14
Steve Traylen 1cdec89
Patch2:         getunit_loadunit.patch
0cd4f98
BuildArch:      noarch
0cd4f98
 
3773124
BuildRequires: make
0cd4f98
BuildRequires:  python3-devel
0cd4f98
BuildRequires:  python3dist(setuptools)
0cd4f98
BuildRequires:  python3dist(pytest)
0cd4f98
BuildRequires:  python3dist(mock)
0cd4f98
1b0307e
BuildRequires:  selinux-policy-devel
edb91d8
BuildRequires:  systemd-rpm-macros
1b0307e
0cd4f98
%description
0cd4f98
collectd-systemd A collectd plugin which checks if given systemd services
0cd4f98
are in "running" state and sends metrics with 1.0 or 0.0.
0cd4f98
%package -n     python3-%{pypi_name}
0cd4f98
Summary:        %{summary}
0cd4f98
%{?python_provide:%python_provide python3-%{pypi_name}}
0cd4f98
Requires:       python3-dbus
0cd4f98
Requires:       collectd-python
1b0307e
Requires:       %{name}-selinux = %{version}-%{release}
0cd4f98
0cd4f98
%description -n python3-%{pypi_name}
0cd4f98
collectd-systemd A collectd plugin which checks if given systemd services
0cd4f98
are in "running" state and sends metrics with 1.0 or 0.0.
0cd4f98
1b0307e
%package selinux
1b0307e
Summary:        selinux policy for collectd systemd plugin
1b0307e
Requires:       selinux-policy
1b0307e
Requires:       policycoreutils
1b0307e
1b0307e
%description selinux
1b0307e
This package contains selinux rules to allow the collectd
1b0307e
systemd plugin to access service status via dbus.
1b0307e
0cd4f98
%prep
0cd4f98
%autosetup -n collectd-systemd-%{commit}
0cd4f98
# Remove bundled egg-info
0cd4f98
rm -rf %{pypi_name}.egg-info
1b0307e
cp -p %{SOURCE1} .
0cd4f98
0cd4f98
%build
0cd4f98
%py3_build
1b0307e
make -f /usr/share/selinux/devel/Makefile collectd_systemd.pp
0cd4f98
0cd4f98
%install
0cd4f98
%py3_install
0cd4f98
1b0307e
mkdir -p %{buildroot}%{_datadir}/selinux/packages/%{name}
1b0307e
install -m 644 -p collectd_systemd.pp \
1b0307e
    %{buildroot}%{_datadir}/selinux/packages/%{name}/collectd_systemd.pp
1b0307e
1b0307e
%post selinux
edb9925
/usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/collectd_systemd.pp >/dev/null 2>&1 || :
1b0307e
1b0307e
%postun selinux
1b0307e
if [ $1 -eq 0 ] ; then
1b0307e
    /usr/sbin/semodule -r collectd_systemd >/dev/null 2>&1 || :
1b0307e
fi
edb91d8
%systemd_postun_with_restart collectd.service
1b0307e
1b0307e
0cd4f98
%files -n python3-%{pypi_name}
0cd4f98
%doc README.rst
0cd4f98
%license LICENSE
0cd4f98
%{python3_sitelib}/__pycache__/*
0cd4f98
%{python3_sitelib}/%{pypi_name}.py
12f57e6
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
0cd4f98
1b0307e
%files selinux
1b0307e
%{_datadir}/selinux/packages/%{name}/collectd_systemd.pp
1b0307e
0cd4f98
%check
0cd4f98
PYTHONPATH=. pytest-3
0cd4f98
0cd4f98
%changelog
5956596
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.30.20181018git212cb79
5956596
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
5956596
260dd7d
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.29.20181018git212cb79
260dd7d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
260dd7d
0d724d6
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.28.20181018git212cb79
0d724d6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
0d724d6
aa40c22
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 0.0.1-0.27.20181018git212cb79
aa40c22
- Rebuilt for Python 3.12
aa40c22
3ec9ae5
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.26.20181018git212cb79
3ec9ae5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
3ec9ae5
66d690f
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.25.20181018git212cb79
66d690f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
66d690f
b409947
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 0.0.1-0.24.20181018git212cb79
b409947
- Rebuilt for Python 3.11
b409947
8d69d35
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.23.20181018git212cb79
8d69d35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
8d69d35
57b989c
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.22.20181018git212cb79
57b989c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
57b989c
fbf63fc
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.0.1-0.21.20181018git212cb79
fbf63fc
- Rebuilt for Python 3.10
fbf63fc
6430ddc
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.20.20181018git212cb79
6430ddc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
6430ddc
Steve Traylen 469c749
* Mon Sep 28 2020 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.19.20181018git212cb79
Steve Traylen 2be36b0
- Backport bug fix for start state of services.
Steve Traylen 469c749
- Backport bug fix for acceptable dead oneshot services.
Steve Traylen 1cdec89
- Backport bug fix for LoadUnit rather than GetUnit
Steve Traylen 469c749
687e87b
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.18.20181018git212cb79
687e87b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
687e87b
c254ff4
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.0.1-0.17.20181018git212cb79
c254ff4
- Rebuilt for Python 3.9
c254ff4
edb91d8
* Fri Feb 14 2020 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.16.20181018git212cb79
edb91d8
- condrestart collectd on upgrade in particular
edb91d8
ec7dc58
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.15.20181018git212cb79
ec7dc58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ec7dc58
b98a74a
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.0.1-0.14.20181018git212cb79
b98a74a
- Rebuilt for Python 3.8.0rc1 (#1748018)
b98a74a
7ee88e7
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.0.1-0.13.20181018git212cb79
7ee88e7
- Rebuilt for Python 3.8
7ee88e7
816cc81
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.12.20181018git212cb79
816cc81
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
816cc81
da35bec
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.11.20181018git212cb79
da35bec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
da35bec
6c091bc
* Wed Oct 31 2018 Miro Hrončok <mhroncok@redhat.com> - 0.0.1-0.10.20181018git212cb79
6c091bc
- Subpackage python2-collectd_systemd has been removed
6c091bc
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
6c091bc
86060ed
* Thu Oct 18 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.9.20181018git212cb79
86060ed
- New HEAD from upstream.
86060ed
8237585
* Tue Sep 18 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.8.20180604gitbe9c647
8237585
- Policy file updated for init.d services.
8237585
c437286
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.7.20180604gitbe9c647
c437286
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c437286
9548a86
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.0.1-0.6.20180604gitbe9c647
9548a86
- Rebuilt for Python 3.7
9548a86
76c9058
* Mon Jun 04 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.5.20180604gitbe9c647
76c9058
- New HEAD from upstream.
76c9058
edb9925
* Thu May 24 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.4.20180516gita7018ec
edb9925
- Corect path to selinux module.
edb9925
88fde08
* Tue May 22 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.3.20180516gita7018ec
88fde08
- Add selinux sub package
88fde08
0cd4f98
* Thu May 17 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.2.20180516gita7018ec
0cd4f98
- Correct snapshot in string.
0cd4f98
0cd4f98
* Wed May 16 2018 Steve Traylen <steve.traylen@cern.ch> - 0.0.1-0.1.20180516gita7018ec
0cd4f98
- Initial package.