2024-02-25 09:22:07 +01:00
|
|
|
|
#
|
|
|
|
|
# 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/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2024-03-23 22:36:41 +01:00
|
|
|
|
%define gitea_version 1.21.8
|
2024-02-25 09:22:07 +01:00
|
|
|
|
%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
|
2024-03-08 08:39:42 +01:00
|
|
|
|
Source7: apparmor-usr.bin.forgejo
|
2024-02-25 09:22:07 +01:00
|
|
|
|
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
|
2024-03-08 08:39:42 +01:00
|
|
|
|
BuildRequires: apparmor-abstractions
|
2024-03-21 13:27:58 +01:00
|
|
|
|
BuildRequires: apparmor-parser
|
2024-03-08 08:39:42 +01:00
|
|
|
|
BuildRequires: apparmor-rpm-macros
|
2024-02-25 09:22:07 +01:00
|
|
|
|
Requires: git-core
|
|
|
|
|
Requires: git-lfs
|
2024-03-21 13:27:58 +01:00
|
|
|
|
Requires: (%{name}-apparmor if apparmor)
|
2024-02-25 09:22:07 +01:00
|
|
|
|
Requires(pre): shadow
|
|
|
|
|
%{systemd_requires}
|
|
|
|
|
%{sysusers_requires}
|
|
|
|
|
|
2024-03-21 13:27:58 +01:00
|
|
|
|
%package apparmor
|
|
|
|
|
Summary: Apparmor profile for %{name}
|
|
|
|
|
Supplements: (%{name} and apparmor)
|
|
|
|
|
Requires: apparmor
|
|
|
|
|
Recommends: apparmor-abstractions
|
|
|
|
|
|
|
|
|
|
%description apparmor
|
|
|
|
|
This package includes the apparmor profile for %{name}
|
|
|
|
|
|
2024-02-25 09:22:07 +01:00
|
|
|
|
%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}
|
2024-03-08 08:39:42 +01:00
|
|
|
|
install -d %{buildroot}%{_sysconfdir}/apparmor.d
|
2024-02-25 09:22:07 +01:00
|
|
|
|
install -d %{buildroot}%{_datadir}/forgejo
|
2024-03-08 08:39:42 +01:00
|
|
|
|
install -d %{buildroot}%{_datadir}/forgejo/{conf,https,mailer}
|
2024-02-25 09:22:07 +01:00
|
|
|
|
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
|
2024-03-08 08:39:42 +01:00
|
|
|
|
install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.forgejo
|
2024-02-25 09:22:07 +01:00
|
|
|
|
|
|
|
|
|
%pre -f %{name}.pre
|
|
|
|
|
%service_add_pre forgejo.service
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%service_add_post forgejo.service
|
2024-03-08 08:39:42 +01:00
|
|
|
|
%apparmor_reload %{_sysconfdir}/apparmor.d/usr.bin.forgejo
|
2024-02-25 09:22:07 +01:00
|
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
2024-03-21 13:27:58 +01:00
|
|
|
|
%files apparmor
|
|
|
|
|
%config %{_sysconfdir}/apparmor.d/usr.bin.forgejo
|
|
|
|
|
|
2024-02-25 09:22:07 +01:00
|
|
|
|
%changelog
|