# # spec file for package forgejo # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define gitea_version 1.21.7 %define forgejo_version 0 Name: forgejo Version: %{gitea_version}+%{forgejo_version} Release: 0 Summary: Self-hostable forge License: MIT Group: Development/Tools/Version Control URL: https://forgejo.org Source0: https://codeberg.org/forgejo/forgejo/releases/download/v%{gitea_version}-%{forgejo_version}/%{name}-src-%{gitea_version}-%{forgejo_version}.tar.gz Source1: https://codeberg.org/forgejo/forgejo/releases/download/v%{gitea_version}-%{forgejo_version}/%{name}-src-%{gitea_version}-%{forgejo_version}.tar.gz.asc Source2: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xeb114f5e6c0dc2bcdd183550a4b61a2dc5923710#/forgejo.keyring Source3: package-lock.json Source4: node_modules.spec.inc %include %{_sourcedir}/node_modules.spec.inc Source5: forgejo.service Source6: forgejo.sysusers Source99: get-sources.sh Patch0: custom-app.ini.patch BuildRequires: golang-packaging BuildRequires: go >= 1.21 ## node >= 20 %if 0%{?suse_version} == 1500 BuildRequires: nodejs-devel-default BuildRequires: npm-default %else BuildRequires: nodejs-packaging %endif BuildRequires: local-npm-registry BuildRequires: make BuildRequires: systemd-rpm-macros BuildRequires: sysuser-tools Requires: git-core Requires: git-lfs Requires(pre): shadow %{systemd_requires} %{sysusers_requires} %description Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo – the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of builtin functionality. %prep %autosetup -p1 -n %{name}-src-%{gitea_version}-%{forgejo_version} local-npm-registry %{_sourcedir} install --also=dev %build %sysusers_generate_pre %{SOURCE6} %{name} %{name}.conf export EXTRA_GOFLAGS="-buildmode=pie -mod=vendor" export TAGS="bindata timetzdata sqlite sqlite_unlock_notify" %{make_build} %install install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_datadir}/forgejo ln -s %{name} %{buildroot}%{_bindir}/gitea install -d %{buildroot}%{_sharedstatedir}/%{name}/{data,https,indexers,queues,repositories} install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_localstatedir}/log/%{name} install -D -m 0644 %{_builddir}/%{name}-src-%{gitea_version}-%{forgejo_version}/custom/conf/app.example.ini %{buildroot}%{_sysconfdir}/%{name}/conf/app.ini install -D -m 0755 %{_builddir}/%{name}-src-%{gitea_version}-%{forgejo_version}/gitea %{buildroot}%{_bindir}/forgejo install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/forgejo.service install -D -m 0644 %{SOURCE6} %{buildroot}%{_sysusersdir}/%{name}.conf %pre -f %{name}.pre %service_add_pre forgejo.service %post %service_add_post forgejo.service %preun %service_del_preun forgejo.service %postun %service_del_postun forgejo.service %check #right now broken, see https://github.com/openSUSE/obs-service-node_modules/issues/22 #make test %files %license LICENSE %doc CHANGELOG.md README.md RELEASE-NOTES.md CONTRIBUTING.md %{_unitdir}/%{name}.service %{_bindir}/%{name} %{_bindir}/gitea %defattr(0660,root,forgejo,770) %config(noreplace) %{_sysconfdir}/%{name}/conf/app.ini %{_sysconfdir}/%{name} %{_localstatedir}/log/%{name} %defattr(0660,forgejo,forgejo,750) %{_datadir}/forgejo %{_sharedstatedir}/%{name} %{_sysusersdir}/%{name}.conf %changelog