%global debug_package %{nil} %global build_ldflags %{nil} Name: forgejo Version: 9.0.0 Release: 1%{?dist} Summary: Beyond coding, we forge License: GPL-3.0-or-later URL: https://codeberg.org/forgejo/forgejo Source0: %{URL}/releases/download/v%{version}/forgejo-src-%{version}.tar.gz BuildRequires: golang BuildRequires: nodejs BuildRequires: make Requires: git Requires: git-lfs %description Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. %prep %setup -q -n forgejo-src-%{version} %build TAGS="bindata timetzdata sqlite sqlite_unlock_notify" make build %install install -Dm755 gitea --target-directory %{buildroot}%{_bindir} install -Dm644 contrib/systemd/forgejo.service --target-directory %{buildroot}%{_prefix}/lib/systemd/system mv %{buildroot}%{_bindir}/gitea %{buildroot}%{_bindir}/forgejo %post useradd -mr -c "Git Version Control" -s /sbin/nologin git passwd -dl git sudo mkdir %{buildroot}%{_sharedstatedir}/forgejo sudo mkdir %{buildroot}%{_sysconfdir}/forgejo sudo chown git:git %{buildroot}%{_sharedstatedir}/forgejo && chmod 750 %{buildroot}%{_sharedstatedir}/forgejo sudo chown root:git %{buildroot}%{_sysconfdir}/forgejo && chmod 770 %{buildroot}%{_sysconfdir}/forgejo systemctl daemon-reload systemctl enable forgejo %postun systemctl disable --now forgejo rm -rf %{_sysconfdir}/forgejo %{_sharedstatedir}/forgejo userdel -r git %files %license LICENSE %{_prefix}/lib/systemd/system/forgejo.service %{_bindir}/forgejo %changelog * Wed Oct 16 2024 Forgejo Release Team See https://codeberg.org/forgejo/forgejo/milestone/7235