gitea/gitea.spec
Jason Rothstein 92147cec07
1.23.7
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2025-04-27 18:53:45 -05:00

162 lines
3.6 KiB
RPMSpec

ExclusiveArch: %{go_arches}
%if 0%{?el8}
%global debug_package %{nil}
%endif
%if 0%{?el9}
%global debug_package %{nil}
%endif
%if 0%{?fc40}
%global debug_package %{nil}
%endif
%if 0%{?fc41}
%global debug_package %{nil}
%endif
Name: gitea
Version: 1.23.7
Release: 1%{?dist}
Summary: Gitea: Git with a cup of tea
License: MIT
URL: https://gitea.io/en-us/
Source0: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-src-%{version}.tar.gz
BuildRequires: git
BuildRequires: golang >= 1.23.8
BuildRequires: pam-devel
Requires(pre): /usr/bin/getent
Requires(pre): /usr/sbin/useradd
Requires: git
%description
%prep
%setup -q -n %{name}-src-%{version}
%build
sed -i -e 's/-s -w //g' Makefile
LDFLAGS=""
export LDFLAGS
make \
TAGS="bindata pam sqlite sqlite_unlock_notify" \
GITEA_VERSION="%{version}-%{release}" \
build
sed -i \
-e 's|^User=.*$|User=gitea|g' \
-e 's|^Group=.*$|Group=gitea|g' \
-e 's|^WorkingDirectory=.*$|WorkingDirectory=/var/lib/gitea|g' \
-e 's|^ExecStart=.*$|ExecStart=%{_bindir}/gitea web /etc/gitea/app.ini|g' \
-e 's|^Environment=.*$|Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea|g' \
contrib/systemd/gitea.service
%install
rm -rf %{buildroot}
%{__install} -d %{buildroot}%{_bindir}
%{__install} -d %{buildroot}%{_sysconfdir}/gitea
%{__install} -d %{buildroot}/usr/lib/systemd/system
%{__install} -d %{buildroot}/var/lib/gitea
%{__install} -d %{buildroot}/var/log/gitea
%{__install} -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
%{__install} -p -m 0644 contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service
%pre
getent passwd gitea > /dev/null 2>&1 || useradd -r -d /var/lib/gitea -s /bin/bash gitea
%post
if [ -x /usr/bin/systemctl ]
then
systemctl condrestart gitea
elif [ -x /usr/sbin/service ]
then
service gitea condrestart
fi
%files
%license LICENSE
%doc CHANGELOG.md
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
%doc DCO
%doc MAINTAINERS
%doc README.md
%doc README_ZH.md
%doc SECURITY.md
%attr(0700, gitea, gitea) %dir /var/lib/gitea
%attr(0700, gitea, gitea) %dir /var/log/gitea
%{_bindir}/%{name}
%attr(0644, root, root) /usr/lib/systemd/system/gitea.service
%attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea
%changelog
* Sun Apr 27 2025 Jason Rothstein
- version bump to 1.23.7
* Sat Apr 19 2025 Jason Rothstein
- version bump to 1.23.6
* Sat Mar 22 2025 Jason Rothstein
- version bump to 1.23.5
* Fri Feb 28 2025 Jason Rothstein
- version bump to 1.23.4
* Tue Feb 25 2025 Jason Rothstein
- version bump to 1.23.3
* Fri Feb 21 2025 Jason Rothstein
- version bump to 1.23.2
* Sun Feb 02 2025 Jason Rothstein
- Block on minimum go versions
* Sun Jan 19 2025 Jason Rothstein
- version bump to 1.23.1
* Sat Jan 18 2025 Jason Rothstein
- version bump to 1.23.0
* Wed Jan 01 2025 Jason Rothstein
- version bump to 1.22.6
* Sat Dec 28 2024 Jason Rothstein
- version bump to 1.22.5
* Thu Dec 05 2024 Jason Rothstein
- version bump to 1.22.4
* Thu Oct 03 2024 Jason Rothstein
- version bump to 1.22.3
* Thu Oct 03 2024 Jason Rothstein
- version bump to 1.22.2
* Sun Jul 07 2024 Jason Rothstein
- version bump to 1.22.1
* Fri Apr 19 2024 Jason Rothstein
- version bump to 1.21.11
* Tue Mar 26 2024 Jason Rothstein
- version bump to 1.21.10
* Tue Mar 26 2024 Jason Rothstein
- version bump to 1.21.9
* Tue Mar 26 2024 Jason Rothstein
- version bump to 1.20.6
* Sun Mar 24 2024 Jason Rothstein
- rebuild for Fedora 39
- version bump to 1.19.4
- add new nodejs, npm, git package dependency
- strip -Wl,-z,relro from LDFLAGS because that isn't compatible with Go