Move to macros for users and service management required in Fedora 44+

This commit is contained in:
2026-05-09 23:13:28 -04:00
parent 9d2f408a1e
commit b79a88a8c3
2 changed files with 23 additions and 12 deletions
+22 -12
View File
@@ -1,4 +1,8 @@
ExclusiveArch: %{go_arches} ExclusiveArch: %{go_arches}
%{!?_sysusersdir: %global _sysusersdir %{_prefix}/lib/sysusers.d}
%if 0%{?el8}
%global debug_package %{nil}
%endif
%if 0%{?el9} %if 0%{?el9}
%global debug_package %{nil} %global debug_package %{nil}
%endif %endif
@@ -17,18 +21,20 @@ ExclusiveArch: %{go_arches}
Name: gitea Name: gitea
Version: 1.26.1 Version: 1.26.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: Gitea: Git with a cup of tea Summary: Gitea: Git with a cup of tea
License: MIT License: MIT
URL: https://gitea.io/en-us/ URL: https://gitea.io/en-us/
Source0: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-src-%{version}.tar.gz Source0: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-src-%{version}.tar.gz
Source1: gitea.sysusers
BuildRequires: git BuildRequires: git
BuildRequires: golang >= 1.26.2 BuildRequires: golang >= 1.26.2
BuildRequires: pam-devel BuildRequires: pam-devel
Requires(pre): /usr/bin/getent BuildRequires: systemd-rpm-macros
Requires(pre): /usr/sbin/useradd %{?systemd_requires}
%{?sysusers_requires_compat}
Requires: git Requires: git
%description %description
@@ -66,20 +72,21 @@ rm -rf %{buildroot}
%{__install} -d %{buildroot}/var/log/gitea %{__install} -d %{buildroot}/var/log/gitea
%{__install} -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name} %{__install} -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
%{__install} -p -m 0644 contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service %{__install} -p -m 0644 contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service
%{__install} -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/gitea.conf
%pre %pre
getent passwd gitea > /dev/null 2>&1 || useradd -r -d /var/lib/gitea -s /bin/bash gitea %sysusers_create_compat %{SOURCE1}
%post %post
if [ -x /usr/bin/systemctl ] %systemd_post gitea.service
then
systemctl condrestart gitea %preun
elif [ -x /usr/sbin/service ] %systemd_preun gitea.service
then
service gitea condrestart %postun
fi %systemd_postun_with_restart gitea.service
%files %files
%license LICENSE %license LICENSE
@@ -95,9 +102,13 @@ fi
%{_bindir}/%{name} %{_bindir}/%{name}
%attr(0644, root, root) /usr/lib/systemd/system/gitea.service %attr(0644, root, root) /usr/lib/systemd/system/gitea.service
%attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea %attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea
%{_sysusersdir}/gitea.conf
%changelog %changelog
* Sat May 09 2026 Jason Rothstein
- Move to macros to manage services and users
* Tue Apr 28 2026 Jason Rothstein * Tue Apr 28 2026 Jason Rothstein
- Drop EL8 - Drop EL8
@@ -107,4 +118,3 @@ fi
* Mon Apr 20 2026 Jason Rothstein * Mon Apr 20 2026 Jason Rothstein
- version bump to 1.26.0 - version bump to 1.26.0
- golang >= 1.26.2 - golang >= 1.26.2
+1
View File
@@ -0,0 +1 @@
u gitea - "Gitea" /var/lib/gitea /bin/bash