forgejo/forgejo.spec
Richard Rahl 35e84d159a Accepting request 1160993 from home:rrahl0:branches:devel:tools:scm
- update to 1.21.8-0:
  * Fix /api/v1/{owner}/{repo}/issue_templates which was always failing with a
    500 error.
  * Prevent error 500 on /user/settings/security when SignedUser has a linked
    account from a deactivated authentication source.
  * Fix error 500 when pushing release to an empty repo.
  * Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize.
  * Fix error 500 when deleting account with incorrect password or unsupported login type.
  * handle user-defined name anchors like [Link](#link) linking to <a name="link"></a>Link.
  * Use correct head commit for CODEOWNER.
  * Fix manual merge button.
  * Make meilisearch do exact search for issues.
  * Fix PR creation via api between branches of same repo with head field namespaced.

OBS-URL: https://build.opensuse.org/request/show/1160993
OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/forgejo?expand=0&rev=6
2024-03-23 21:36:41 +00:00

136 lines
4.8 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# 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.8
%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
Source7: apparmor-usr.bin.forgejo
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
BuildRequires: apparmor-abstractions
BuildRequires: apparmor-parser
BuildRequires: apparmor-rpm-macros
Requires: git-core
Requires: git-lfs
Requires: (%{name}-apparmor if apparmor)
Requires(pre): shadow
%{systemd_requires}
%{sysusers_requires}
%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}
%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}%{_sysconfdir}/apparmor.d
install -d %{buildroot}%{_datadir}/forgejo
install -d %{buildroot}%{_datadir}/forgejo/{conf,https,mailer}
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
install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.forgejo
%pre -f %{name}.pre
%service_add_pre forgejo.service
%post
%service_add_post forgejo.service
%apparmor_reload %{_sysconfdir}/apparmor.d/usr.bin.forgejo
%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
%files apparmor
%config %{_sysconfdir}/apparmor.d/usr.bin.forgejo
%changelog