## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond bootstrap 0 %bcond check %{without bootstrap} # We don’t use go macros to build, but this is what they do to prevent binutils-style-ld flags to # mess things up for the Go linker. %undefine _auto_set_build_flags # The binaries are all statically linked. %global debug_package %{nil} Name: forgejo Version: 10.0.1 Release: %autorelease Summary: A lightweight software forge # Forgejo itself is "MIT AND GPL-3.0-or-later", this is the combination with vendored sources: License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND GPL-3.0-or-later AND ICU AND ISC AND LicenseRef-scancode-public-domain-disclaimer AND MIT AND MPL-2.0 AND (FTL OR GPL-2.0-or-later) URL: https://codeberg.org/forgejo/forgejo %global src_tarball %{url}/releases/download/v%{version}/%{name}-src-%{version}.tar.gz Source0: %{src_tarball} Source1: %{src_tarball}.asc Source2: https://openpgpkey.forgejo.org/.well-known/openpgpkey/forgejo.org/hu/dj3498u4hyyarh35rkjfnghbjxug6b19#/dj3498u4hyyarh35rkjfnghbjxug6b19.pgp Source3: go-vendor-tools.toml Source4: robots.txt Source5: forgejo.service Source6: forgejo.sysusers.conf Source7: forgejo.sysconfig Patch0: forgejo-10.0.1-app.ini.tmpl.patch ExclusiveArch: %golang_arches_future BuildRequires: coreutils BuildRequires: gnupg2 BuildRequires: go-rpm-macros BuildRequires: golang-bin >= 1.23 BuildRequires: golang-src >= 1.23 BuildRequires: go-vendor-tools BuildRequires: make BuildRequires: nodejs >= 20 BuildRequires: sed BuildRequires: sqlite-devel BuildRequires: systemd-rpm-macros Requires(post): sed %{?sysusers_requires_compat} %description Forgejo is a lightweight software forge. %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -N -n %{name}-src-%{version} patch --input=%{PATCH0} --output=app.ini.tmpl custom/conf/app.example.ini %generate_buildrequires %go_vendor_license_buildrequires -c %{S:3} %build export TAGS="rpm_crashtraceback bindata timetzdata sqlite sqlite_unlock_notify" export EXTRA_GOFLAGS="%gocompilerflags -mod=vendor" export LDFLAGS=" \ -X \"code.gitea.io/gitea/modules/setting.CustomPath=%{_sysconfdir}/%{name}\" \ -X \"code.gitea.io/gitea/modules/setting.CustomConf=%{_sysconfdir}/%{name}/conf/app.ini\" \ -X \"code.gitea.io/gitea/modules/setting.AppWorkPath=%{_sharedstatedir}/%{name}\" \ -X \"main.Version=%{version}\" \ " %make_build build forgejo sed -e 's/gitea/%{name}/g' \ < contrib/autocompletion/bash_autocomplete \ > %{name}.complete touch -r contrib/autocompletion/bash_autocomplete %{name}.complete %install %go_vendor_license_install -c %{S:3} install -D %{name} %{buildroot}%{_bindir}/%{name} install -d %{buildroot}%{_sysconfdir}/%{name}/conf \ %{buildroot}%{_sysconfdir}/%{name}/public/assets \ %{buildroot}%{_sysconfdir}/%{name}/templates install -p -D app.ini.tmpl %{buildroot}%{_sysconfdir}/%{name}/conf/app.ini.tmpl install -p -D %{S:4} %{buildroot}%{_sysconfdir}/%{name}/public/robots.txt install -p -D %{name}.complete %{buildroot}%{_datadir}/bash-completion/completions/%{name} install -p -D %{S:5} %{buildroot}%{_unitdir}/%{name}.service install -p -D %{S:6} %{buildroot}%{_sysusersdir}/%{name}.conf install -d %{buildroot}%{_sharedstatedir}/%{name} \ %{buildroot}%{_sharedstatedir}/%{name}/data \ %{buildroot}%{_sharedstatedir}/%{name}/log install -D %{S:7} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %check %go_vendor_license_check -c %{S:3} %pre %sysusers_create_compat %{S:6} %post %systemd_post %{name}.service if [ ! -f "%{_sysconfdir}/%{name}/conf/app.ini" ]; then umask 077 INTERNAL_TOKEN="$(forgejo generate secret INTERNAL_TOKEN)" JWT_SECRET="$(forgejo generate secret LFS_JWT_SECRET)" LFS_JWT_SECRET="$(forgejo generate secret LFS_JWT_SECRET)" SECRET_KEY="$(forgejo generate secret SECRET_KEY)" sed \ -e "s/@INTERNAL_TOKEN@/${INTERNAL_TOKEN}/g" \ -e "s/@JWT_SECRET@/${JWT_SECRET}/g" \ -e "s/@LFS_JWT_SECRET@/${LFS_JWT_SECRET}/g" \ -e "s/@SECRET_KEY@/${SECRET_KEY}/g" \ < "%{_sysconfdir}/%{name}/conf/app.ini.tmpl" \ > "%{_sysconfdir}/%{name}/conf/app.ini" chgrp %{name} "%{_sysconfdir}/%{name}/conf/app.ini" chmod 640 "%{_sysconfdir}/%{name}/conf/app.ini" fi %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files -f %{go_vendor_license_filelist} %doc CONTRIBUTING.md README.md RELEASE-NOTES.md %doc custom/conf/app.example.ini %{_bindir}/%{name} %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/conf %dir %{_sysconfdir}/%{name}/public %dir %{_sysconfdir}/%{name}/public/assets %dir %{_sysconfdir}/%{name}/templates %attr(0640,-,%{name}) %{_sysconfdir}/%{name}/conf/app.ini.tmpl %attr(0640,-,%{name}) %ghost %config(missingok) %{_sysconfdir}/%{name}/conf/app.ini %config(noreplace) %{_sysconfdir}/%{name}/public/robots.txt %config(noreplace,missingok) %{_sysconfdir}/sysconfig/%{name} %{_sysusersdir}/%{name}.conf %{_datadir}/bash-completion/completions/%{name} %{_unitdir}/%{name}.service %attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name} %attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name}/data %attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name}/log %changelog ## START: Generated by rpmautospec * Tue Mar 25 2025 Nils Philippsen - 10.0.1-1 - Uncommitted changes ## END: Generated by rpmautospec