Blob Blame History Raw
Name:           regindexer
Version:        0.4
Release:        1%{?dist}
Summary:        Tool for creating an index of a container registry

License:        MIT
URL:            https://pagure.io/regindexer
Source0:        https://releases.pagure.org/regindexer/regindexer-%{version}.tar.gz
Source1:        regindexer.service

BuildArch:      noarch

BuildRequires:  python2-setuptools
BuildRequires:  python2-devel
BuildRequires:  systemd

Requires: %{py2_dist fedmsg PyYAML requests six}

%description
regindexer is a tool for creating an index of a container registry. It can
be run manually from the command line, or can run run as a daemon
rebuilding the index when it sees messages from Bodhi.

%prep
%autosetup


%build
%py2_build


%install
%py2_install
install -m 0644 -D config-example.yaml $RPM_BUILD_ROOT%{_sysconfdir}/regindexer/config.yaml
install -m 0755 -d $RPM_BUILD_ROOT%{_sharedstatedir}/regindexer

install -m 0644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/regindexer.service

%pre
getent group regindexer >/dev/null || groupadd -r regindexer
getent passwd regindexer >/dev/null || \
    useradd -r -g regindexer -d %{_sharedstatedir}/regindexer -s /sbin/nologin \
    -c "regindexer daemon user" regindexer
exit 0

%post
%systemd_post regindexer.service

%preun
%systemd_preun regindexer.service

%postun
%systemd_postun_with_restart regindexer.service

%files
%license LICENSE
%doc README.md
%{python2_sitelib}/regindexer/
%{python2_sitelib}/regindexer*.egg-info/
%{_bindir}/regindexer
%{_bindir}/regindexer-daemon
%{_unitdir}/*
%config(noreplace) %{_sysconfdir}/regindexer
%attr(-, regindexer, regindexer) %{_sharedstatedir}/regindexer

%changelog
* Fri Nov 30 2018 fedora-toolbox <otaylor@redhat.com> - 0.4-1
- Version 0.4 (fixes problem with > 100 repositories)

* Wed Aug 29 2018 Owen Taylor <otaylor@redhat.com> - 0.3-1
- Version 0.3

* Sat Aug 11 2018 Owen Taylor <otaylor@redhat.com> - 0.2-1
- Version 0.2 - switch from fedmsg-hub plugin to a daemon

* Thu Aug  2 2018 Owen Taylor <otaylor@redhat.com> - 0.1-1
- Initial version