aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-09-21 09:41:46 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-09-21 09:41:46 -0400
commiteabd1f4fd750d22ecec89c6ed04acd8a6803a761 (patch)
tree0791993c265b3e2a8b60640ccee0ba484ca93c3a
parentb0d4e6d812630baf2e8b99b597f9cd8141dd040c (diff)
downloadgrokmirror-eabd1f4fd750d22ecec89c6ed04acd8a6803a761.tar.gz
Add rpm spec file to contribv2.0.0
This conforms to the Fedora packaging standard, though we don't package SELinux modules with it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--CHANGELOG.rst2
-rw-r--r--contrib/python-grokmirror.spec89
2 files changed, 90 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 3a95775..5612cf2 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,4 +1,4 @@
-v2.0.0 (2020-09-18)
+v2.0.0 (2020-09-21)
-------------------
Major rewrite to improve shared object storage and replication for VERY
LARGE repository collections (codeaurora.org is ~30,000 repositories,
diff --git a/contrib/python-grokmirror.spec b/contrib/python-grokmirror.spec
new file mode 100644
index 0000000..760d614
--- /dev/null
+++ b/contrib/python-grokmirror.spec
@@ -0,0 +1,89 @@
+%global srcname grokmirror
+%global groupname mirror
+%global username mirror
+%global userhome %{_sharedstatedir}/grokmirror
+
+Name: python-%{srcname}
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Framework to smartly mirror git repositories
+
+License: GPLv3+
+URL: https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git
+Source0: https://www.kernel.org/pub/software/network/grokmirror/grokmirror-%{version}.tar.xz
+
+BuildArch: noarch
+
+%global _description %{expand:
+Grokmirror was written to make mirroring large git repository
+collections more efficient. Grokmirror uses the manifest file published
+by the master mirror in order to figure out which repositories to
+clone, and to track which repositories require updating. The process is
+extremely lightweight and efficient both for the master and for the
+mirrors.}
+
+%description %_description
+
+%package -n python3-%{srcname}
+Summary: %{summary}
+Requires(pre): shadow-utils
+Requires: git-core, python3-packaging, python3-requests
+BuildRequires: python3-devel, python3-setuptools
+BuildRequires: systemd
+Obsoletes: python-%{srcname} < 2, python2-%{srcname} < 2
+
+%description -n python3-%{srcname} %_description
+
+%prep
+%autosetup -n %{srcname}-%{version}
+
+%build
+%py3_build
+
+%install
+%py3_install
+
+%{__mkdir_p} -m 0755 \
+ %{buildroot}%{userhome} \
+ %{buildroot}%{_sysconfdir}/%{srcname} \
+ %{buildroot}%{_sysconfdir}/logrotate.d \
+ %{buildroot}%{_unitdir} \
+ %{buildroot}%{_bindir} \
+ %{buildroot}%{_tmpfilesdir} \
+ %{buildroot}%{_mandir}/man1 \
+ %{buildroot}%{_localstatedir}/log/%{srcname} \
+ %{buildroot}/run/%{srcname}
+
+%{__install} -m 0644 man/*.1 %{buildroot}/%{_mandir}/man1/
+%{__install} -m 0644 contrib/*.service %{buildroot}/%{_unitdir}/
+%{__install} -m 0644 contrib/*.timer %{buildroot}/%{_unitdir}/
+%{__install} -m 0644 contrib/logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/grokmirror
+%{__install} -m 0644 grokmirror.conf %{buildroot}/%{_sysconfdir}/%{srcname}/grokmirror.conf.example
+
+echo "d /run/%{srcname} 0755 %{username} %{groupname}" > %{buildroot}/%{_tmpfilesdir}/%{srcname}.conf
+
+%pre -n python3-%{srcname}
+getent group %{groupname} >/dev/null || groupadd -r %{groupname}
+getent passwd %{username} >/dev/null || \
+ useradd -r -g %{groupname} -d %{userhome} -s /sbin/nologin \
+ -c "Grokmirror user" %{username}
+exit 0
+
+%files -n python3-%{srcname}
+%license LICENSE.txt
+%doc README.rst grokmirror.conf
+%dir %attr(0750, %{username}, %{groupname}) %{userhome}
+%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/log/%{srcname}/
+%dir %attr(0755, %{username}, %{groupname}) /run/%{srcname}/
+%config %{_sysconfdir}/%{srcname}/*
+%config %{_sysconfdir}/logrotate.d/*
+%{_tmpfilesdir}/%{srcname}.conf
+%{_unitdir}/*
+%{python3_sitelib}/%{srcname}-*.egg-info/
+%{python3_sitelib}/%{srcname}/
+%{_bindir}/grok-*
+%{_mandir}/*/*
+
+%changelog
+* Mon Sep 21 2020 Konstantin Ryabitsev <konstantin@linuxfoundation.org> - 2.0.0-1
+- Initial 2.0.0 packaging