More best practice updates
This commit is contained in:
+24
-33
@@ -1,27 +1,12 @@
|
|||||||
ExclusiveArch: %{go_arches}
|
ExclusiveArch: %{go_arches}
|
||||||
%{!?_sysusersdir: %global _sysusersdir %{_prefix}/lib/sysusers.d}
|
%{!?_sysusersdir: %global _sysusersdir %{_prefix}/lib/sysusers.d}
|
||||||
%if 0%{?el8}
|
%if 0%{?el8} || 0%{?el9} || 0%{?el10} || 0%{?fc42} || 0%{?fc43} || 0%{?fc44}
|
||||||
%global debug_package %{nil}
|
|
||||||
%endif
|
|
||||||
%if 0%{?el9}
|
|
||||||
%global debug_package %{nil}
|
|
||||||
%endif
|
|
||||||
%if 0%{?el10}
|
|
||||||
%global debug_package %{nil}
|
|
||||||
%endif
|
|
||||||
%if 0%{?fc42}
|
|
||||||
%global debug_package %{nil}
|
|
||||||
%endif
|
|
||||||
%if 0%{?fc43}
|
|
||||||
%global debug_package %{nil}
|
|
||||||
%endif
|
|
||||||
%if 0%{?fc44}
|
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: gitea
|
Name: gitea
|
||||||
Version: 1.26.1
|
Version: 1.26.1
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: Gitea: Git with a cup of tea
|
Summary: Gitea: Git with a cup of tea
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@@ -39,10 +24,13 @@ BuildRequires: make
|
|||||||
Requires: git
|
Requires: git
|
||||||
|
|
||||||
%description
|
%description
|
||||||
|
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket,
|
||||||
|
and GitLab. Gitea is a lightweight code hosting solution written in Go and
|
||||||
|
published under the MIT license.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-src-%{version}
|
%autosetup -p1 -n %{name}-src-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
sed -i -e 's/-s -w //g' Makefile
|
sed -i -e 's/-s -w //g' Makefile
|
||||||
@@ -50,7 +38,7 @@ sed -i -e 's/-s -w //g' Makefile
|
|||||||
LDFLAGS=""
|
LDFLAGS=""
|
||||||
export LDFLAGS
|
export LDFLAGS
|
||||||
|
|
||||||
make \
|
%make_build \
|
||||||
TAGS="bindata pam sqlite sqlite_unlock_notify" \
|
TAGS="bindata pam sqlite sqlite_unlock_notify" \
|
||||||
GITEA_VERSION="%{version}-%{release}" \
|
GITEA_VERSION="%{version}-%{release}" \
|
||||||
build
|
build
|
||||||
@@ -58,21 +46,21 @@ make \
|
|||||||
sed -i \
|
sed -i \
|
||||||
-e 's|^User=.*$|User=gitea|g' \
|
-e 's|^User=.*$|User=gitea|g' \
|
||||||
-e 's|^Group=.*$|Group=gitea|g' \
|
-e 's|^Group=.*$|Group=gitea|g' \
|
||||||
-e 's|^WorkingDirectory=.*$|WorkingDirectory=/var/lib/gitea|g' \
|
-e 's|^WorkingDirectory=.*$|WorkingDirectory=%{_sharedstatedir}/gitea|g' \
|
||||||
-e 's|^ExecStart=.*$|ExecStart=%{_bindir}/gitea web /etc/gitea/app.ini|g' \
|
-e 's|^ExecStart=.*$|ExecStart=%{_bindir}/gitea web %{_sysconfdir}/gitea/app.ini|g' \
|
||||||
-e 's|^Environment=.*$|Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea|g' \
|
-e 's|^Environment=.*$|Environment=USER=gitea HOME=%{_sharedstatedir}/gitea GITEA_WORK_DIR=%{_sharedstatedir}/gitea|g' \
|
||||||
contrib/systemd/gitea.service
|
contrib/systemd/gitea.service
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{__install} -d %{buildroot}%{_bindir}
|
install -d %{buildroot}%{_bindir}
|
||||||
%{__install} -d %{buildroot}%{_sysconfdir}/gitea
|
install -d %{buildroot}%{_sysconfdir}/gitea
|
||||||
%{__install} -d %{buildroot}%{_unitdir}
|
install -d %{buildroot}%{_unitdir}
|
||||||
%{__install} -d %{buildroot}/var/lib/gitea
|
install -d %{buildroot}%{_sharedstatedir}/gitea
|
||||||
%{__install} -d %{buildroot}/var/log/gitea
|
install -d %{buildroot}%{_localstatedir}/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}%{_unitdir}/gitea.service
|
install -p -m 0644 contrib/systemd/gitea.service %{buildroot}%{_unitdir}/gitea.service
|
||||||
%{__install} -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/gitea.conf
|
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/gitea.conf
|
||||||
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
@@ -97,15 +85,18 @@ sed -i \
|
|||||||
%doc MAINTAINERS
|
%doc MAINTAINERS
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%doc SECURITY.md
|
%doc SECURITY.md
|
||||||
%attr(0700, gitea, gitea) %dir /var/lib/gitea
|
%attr(0750, gitea, gitea) %dir %{_sharedstatedir}/gitea
|
||||||
%attr(0700, gitea, gitea) %dir /var/log/gitea
|
%attr(0750, gitea, gitea) %dir %{_localstatedir}/log/gitea
|
||||||
%{_bindir}/%{name}
|
%{_bindir}/%{name}
|
||||||
%{_unitdir}/gitea.service
|
%{_unitdir}/gitea.service
|
||||||
%attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea
|
%attr(0750, gitea, gitea) %dir %{_sysconfdir}/gitea
|
||||||
%{_sysusersdir}/gitea.conf
|
%{_sysusersdir}/gitea.conf
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun May 10 2026 Jason Rothstein
|
||||||
|
- More best practice applied
|
||||||
|
|
||||||
* Sat May 09 2026 Jason Rothstein
|
* Sat May 09 2026 Jason Rothstein
|
||||||
- Move to macros to manage services and users
|
- Move to macros to manage services and users
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user