212 lines
6.9 KiB
RPMSpec
212 lines
6.9 KiB
RPMSpec
%global major_version 1
|
|
%global minor_version 27
|
|
%global micro_version 1
|
|
|
|
%define debug_package %{nil}
|
|
|
|
# Generated by go2rpm 1.19.0
|
|
%bcond check 1
|
|
|
|
# scancode has a lot of dependencies, so it can be disabled for a faster build
|
|
# or when its deps are unavailable.
|
|
%if %{defined rhel} || "%{_arch}" == "i386"
|
|
%global go_vendor_license_check_disable 1
|
|
%endif
|
|
|
|
Name: gitea
|
|
Version: %{major_version}.%{minor_version}.%{micro_version}
|
|
Release: %autorelease
|
|
Summary: A painless self-hosted Git service
|
|
# Generated by go-vendor-tools
|
|
License: 0BSD AND AGPL-3.0-only AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND BUSL-1.1 AND CC-BY-4.0 AND CC-BY-SA-4.0 AND CC0-1.0 AND GPL-2.0-only AND GPL-3.0-only AND ISC AND LGPL-2.1-only AND LGPL-3.0-only AND LicenseRef-Fedora-Public-Domain AND LicenseRef-scancode-musl-exception AND LicenseRef-scancode-other-permissive AND MIT AND MIT-0 AND MPL-2.0 AND OFL-1.1 AND (BSD-3-Clause OR GPL-2.0-only) AND (LicenseRef-Fedora-Public-Domain OR LicenseRef-scancode-other-permissive)
|
|
URL: https://gitea.io
|
|
Source: https://github.com/go-gitea/gitea/releases/download/v%{version}/%{name}-src-%{version}.tar.gz
|
|
Source: vendor.tar.bz2
|
|
Source: go-vendor-tools.toml
|
|
Source: gitea.service
|
|
Source: README.EL+Fedora
|
|
Source: gitea.httpd
|
|
Source: gitea.nginx
|
|
Source: gitea.caddy
|
|
Source: gitea.sysusers
|
|
Source: gitea.profile.sh
|
|
Source: gitea.profile.csh
|
|
|
|
Patch1: 0001-gitea.app.ini.patch
|
|
%dnl Patch2: 0001-makefile.patch
|
|
|
|
BuildRequires: systemd
|
|
BuildRequires: go >= 1.26.3
|
|
BuildRequires: git
|
|
BuildRequires: make
|
|
BuildRequires: nodejs-devel >= 22.21.2
|
|
BuildRequires: npm
|
|
BuildRequires: go-srpm-macros
|
|
BuildRequires: pam-devel
|
|
BuildRequires: demus-packaging
|
|
BuildRequires: systemd-rpm-macros
|
|
Requires: git
|
|
Requires: systemd
|
|
Requires: openssh-server
|
|
Requires(pre): shadow-utils
|
|
Requires(post): systemd
|
|
Requires(postun): systemd
|
|
Requires(preun): systemd
|
|
|
|
Conflicts: git-web
|
|
|
|
# Suggesting httpd for now
|
|
Suggests: httpd
|
|
|
|
%description
|
|
A painless self-hosted Git service.
|
|
|
|
Gitea is a community managed fork of Gogs. A lightweight code hosting solution
|
|
written in Go and published under the MIT license.
|
|
|
|
%package httpd
|
|
Summary: Apache (httpd) configuration for %{name}
|
|
Requires: gitea
|
|
Requires: httpd
|
|
|
|
%description httpd
|
|
This subpackage contains Apache configuration files that can be used to reverse
|
|
proxy for Gitea.
|
|
|
|
%package nginx
|
|
Summary: nginx configuration for %{name}
|
|
Requires: gitea
|
|
Requires: nginx
|
|
|
|
%description nginx
|
|
This subpackage contains an nginx configuration file that can be used to reverse
|
|
proxy for Gitea.
|
|
|
|
%package caddy
|
|
Summary: caddy configuration for %{name}
|
|
Requires: gitea
|
|
Requires: caddy >= 2.0.0
|
|
|
|
%description caddy
|
|
This subpackage contains an caddy configuration file that can be used to reverse
|
|
proxy for Gitea.
|
|
|
|
%prep
|
|
%verify_source_checksum
|
|
%setup -q -n %{name}-src-%{version}
|
|
%autopatch -p1
|
|
|
|
install -m 0644 %{S:4} .
|
|
for file in $(find . -type f -name "*.css"); do
|
|
chmod -x ${file}
|
|
done
|
|
|
|
%generate_buildrequires
|
|
%go_vendor_license_buildrequires -c %{S:2}
|
|
|
|
%build
|
|
# Default support for sqlite and pam (not provided by upstream by default)
|
|
export TAGS="sqlite sqlite_unlock_notify pam"
|
|
export LDFLAGS="-s -w -X \"main.Version=%{version}\" -X \"code.gitea.io/gitea/modules/setting.CustomPath=/etc/gitea\" -X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea\""
|
|
|
|
# Probably not needed, but just in case I guess.
|
|
TAGS="${TAGS}" LDFLAGS="${LDFLAGS}" make build
|
|
|
|
%install
|
|
%go_vendor_license_install -c %{S:2}
|
|
install -D -m 755 gitea $RPM_BUILD_ROOT%{_bindir}/gitea
|
|
install -D -m 644 %{S:3} $RPM_BUILD_ROOT/%{_unitdir}/gitea.service
|
|
install -D -m 644 custom/conf/app.example.ini $RPM_BUILD_ROOT%{_sysconfdir}/gitea/conf/app.ini
|
|
install -D -m 644 %{S:5} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
install -D -m 644 %{S:6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/%{name}.conf
|
|
install -D -m 644 %{S:7} $RPM_BUILD_ROOT%{_sysconfdir}/caddy/Caddyfile.d/%{name}.caddyfile
|
|
install -D -m 644 %{S:8} $RPM_BUILD_ROOT%{_sysusersdir}/%{name}.conf
|
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gitea \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/lfs \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/tmp \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/tmp/uploads \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/tmp/pprof \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/sessions \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/avatars \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/attachments \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/data/repo-avatars \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/https \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/indexers \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/indexers/issues.bleve \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/indexers/issues.queue \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/indexers/repos.bleve \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/queues \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/lib/gitea/repositories \
|
|
$RPM_BUILD_ROOT%{_localstatedir}/log/gitea \
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/gitea/{conf,https,mailer}
|
|
|
|
cp -r options $RPM_BUILD_ROOT%{_datadir}/gitea/
|
|
cp -r public $RPM_BUILD_ROOT%{_datadir}/gitea/
|
|
cp -r templates $RPM_BUILD_ROOT%{_datadir}/gitea/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}/
|
|
cat > $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf <<EOF
|
|
d /run/gitea 0755 git git -
|
|
EOF
|
|
|
|
install -D -m 644 %{S:9} %{buildroot}%{_sysconfdir}/profile.d/gitea.sh
|
|
install -D -m 644 %{S:10} %{buildroot}%{_sysconfdir}/profile.d/gitea.csh
|
|
|
|
%dnl %check
|
|
%dnl %go_vendor_license_check -c %{S:2}
|
|
|
|
%pre
|
|
# Not official
|
|
%if 0%{?fedora} || 0%{?rhel} >= 9
|
|
%sysusers_create_compat %{S:8}
|
|
%else
|
|
%{_sbindir}/groupadd -r git 2>/dev/null || :
|
|
%{_sbindir}/useradd -r -g git \
|
|
-s /bin/bash -d %{_datadir}/%{name} \
|
|
-c 'Gitea' git 2>/dev/null || :
|
|
%endif
|
|
|
|
%preun
|
|
%systemd_preun %{name}.service
|
|
|
|
%post
|
|
%systemd_post %{name}.service
|
|
systemd-tmpfiles --create %{name}.conf || :
|
|
|
|
%postun
|
|
%systemd_postun_with_restart %{name}.service
|
|
|
|
%files -f %{go_vendor_license_filelist}
|
|
%doc README.EL+Fedora README.md custom/conf/app.example.ini
|
|
%{_unitdir}/gitea.service
|
|
%{_bindir}/gitea
|
|
%{_tmpfilesdir}/%{name}.conf
|
|
%{_sysusersdir}/%{name}.conf
|
|
%{_sysconfdir}/profile.d/gitea.*sh
|
|
|
|
%defattr(0660,root,git,770)
|
|
%dir %{_sysconfdir}/gitea
|
|
%dir %{_sysconfdir}/gitea/conf
|
|
%dir %{_sysconfdir}/gitea/https
|
|
%dir %{_sysconfdir}/gitea/mailer
|
|
%dir %{_localstatedir}/log/gitea
|
|
%config(noreplace) %{_sysconfdir}/gitea/conf/app.ini
|
|
|
|
%defattr(0660,git,git,750)
|
|
%{_datadir}/gitea
|
|
%{_localstatedir}/lib/gitea
|
|
|
|
%files httpd
|
|
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
|
|
%files nginx
|
|
%config(noreplace) %{_sysconfdir}/nginx/conf.d/%{name}.conf
|
|
|
|
%files caddy
|
|
%config(noreplace) %{_sysconfdir}/caddy/Caddyfile.d/%{name}.caddyfile
|
|
|
|
%changelog
|
|
%autochangelog
|