Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:computersalat:devel:scm
gitea
gitea.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gitea.spec of Package gitea
# # spec file for package gitea # # Copyright (c) 2022 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/ # # with_get_source_sh the source must download with gitea-fetch_source_and_node_modules.sh # And you must use https://github.com/go-gitea/gitea/archive/refs/tags/v1.14.3.tar.gz # instead of # https://github.com/go-gitea/gitea/releases/download/v1.14.3/gitea-src-1.14.3.tar.gz # # Upstream continuously changes the presence of the nodejs_module. # With version 1.15.0 the modules have been removed from the sources again. %define with_get_source_sh 1 %define make_version $(make -v | head -n 1) %global provider github %global provider_tld com %global project go-gitea %global repo gitea %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} %bcond_without apparmor Name: gitea Version: 1.21.11 Release: 0 Summary: A painless self-hosted Git service License: MIT Group: Development/Tools/Version Control URL: https://gitea.io/ %if 0%{?with_get_source_sh} Source0: %{name}-%{version}.tar.xz Source1: vendor.tar.gz Source2: gitea-docs-%{version}.tar.gz Source3: gitea-docs-%{version}.tar.gz.asc Source4: gitea-node_modules-%{version}.tar.gz %else Source0: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-src-%{version}.tar.gz Source1: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-src-%{version}.tar.gz.asc Source2: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-docs-%{version}.tar.gz Source3: https://github.com/go-gitea/gitea/releases/download/v%{version}/gitea-docs-%{version}.tar.gz.asc %endif Source5: apparmor-usr.bin.gitea # Keyring from: https://docs.gitea.io/en-us/install-from-binary/#verify-gpg-signature Source9: gitea.keyring # additional confs Source20: gitea.service Source21: gitea.profile.sh Source22: gitea.profile.csh Source23: gitea.firewalld Source24: gitea.firewall Source25: gitea-apache.conf Source26: gitea-apache-vhost.conf Source27: gitea-user.conf Source90: README.SUSE Source91: get-gitea-source.sh Source99: gitea-rpmlintrc # PATCH-FEATURE-OPENSUSE gitea.app.ini.patch -- to set some variables Patch0: gitea.app.ini.patch BuildRequires: apache-rpm-macros BuildRequires: git-core BuildRequires: golang(API) = 1.21 BuildRequires: golang(github.com/jteeuwen/go-bindata) BuildRequires: golang-packaging BuildRequires: make BuildRequires: systemd-rpm-macros BuildRequires: sysuser-tools %if 0%{?suse_version} > 1500 BuildRequires: nodejs20-devel BuildRequires: npm20 %else # nodes >= 16.0.0 BuildRequires: nodejs-devel-default BuildRequires: npm-default %endif %if %{with apparmor} BuildRequires: apparmor-abstractions BuildRequires: apparmor-rpm-macros Recommends: apparmor-abstractions %endif %if 0%{?suse_version} >= 1500 BuildRequires: firewall-macros %endif Requires: git-core Requires(pre): shadow Conflicts: git-web ExclusiveArch: x86_64 ppc64le s390x riscv64 aarch64 ExclusiveArch: x86_64 ppc64le s390x riscv64 aarch64 %{?sysusers_requires} %{?systemd_requires} ##%%{go_provides} %description A painless self-hosted Git service. Gitea is a community managed fork of Gogs, lightweight code hosting solution written in Go and published under the MIT license. %package apache Summary: Apache configuration for %{name} Group: Productivity/Networking/Web/Utilities BuildRequires: apache2 Requires: %{name} >= %{version} Requires: apache2 Supplements: (apache2 and %name) %description apache This subpackage contains the Apache configuration files %package docs Summary: Documentation for %{name} Group: Productivity/Networking/Web/Utilities %description docs This subpackage contains the gitea documentation from https://docs.gitea.io/ %prep %if 0%{?with_get_source_sh} %setup -q -a 1 -a 4 %else %setup -q -c %endif %patch -P 0 -p1 # install README.SUSE install -m644 %{SOURCE90} . # rpmlint find . -type f -name "*.css" -print0 | xargs -0 chmod -x sed -i -e 's|\/usr\/bin\/env bash|\/usr\/bin\/bash|g' docs/scripts/trans-copy.sh %build %sysusers_generate_pre %{SOURCE27} %{name} %{name}-user.conf %if 0%{?with_get_source_sh} %if 0%{?suse_version} > 1500 %define _npx npx20 %else %define _npx npx %endif make fomantic # webpack %{_npx} webpack %endif # build gitea itself export GOFLAGS="$GOFLAGS -buildmode=pie -mod=vendor" go build -mod=vendor -v \ -tags sqlite,sqlite_unlock_notify \ -ldflags '-s -w -X "main.Version=%{version}" -X "code.gitea.io/gitea/modules/setting.CustomPath=%{_sysconfdir}/gitea" -X "code.gitea.io/gitea/modules/setting.AppWorkPath=%{_localstatedir}/lib/gitea"' %install export GOFLAGS="$GOFLAGS -buildmode=pie -mod=vendor" # systemd install -D -m 644 %{SOURCE20} %{buildroot}%{_unitdir}/gitea.service mkdir -p %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcgitea # config install -D -m 644 custom/conf/app.example.ini %{buildroot}%{_sysconfdir}/gitea/conf/app.ini # profile.d install -D -m 644 %{SOURCE21} %{buildroot}%{_sysconfdir}/profile.d/gitea.sh install -D -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/profile.d/gitea.csh # working_dir, log_dir mkdir -p %{buildroot}%{_datadir}/gitea mkdir -p %{buildroot}%{_localstatedir}/lib/gitea mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/lfs mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/tmp mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/tmp/uploads mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/tmp/pprof mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/sessions mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/avatars mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/attachments mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/data/repo-avatars mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/https mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/indexers mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/indexers/issues.bleve mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/indexers/issues.queue mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/indexers/repos.bleve mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/queues mkdir -p %{buildroot}%{_localstatedir}/lib/gitea/repositories mkdir -p %{buildroot}%{_localstatedir}/log/gitea mkdir -p %{buildroot}%{_sysconfdir}/gitea/conf mkdir -p %{buildroot}%{_sysconfdir}/gitea/https mkdir -p %{buildroot}%{_sysconfdir}/gitea/mailer # bin install -D -m 755 gitea %{buildroot}%{_bindir}/gitea # options, public, template cp -r options %{buildroot}%{_datadir}/gitea/ cp -r public %{buildroot}%{_datadir}/gitea/ cp -r templates %{buildroot}%{_datadir}/gitea/ # css ###cp -r web_src/less %%{buildroot}%%{_datadir}/gitea/public # docs install -d %{buildroot}%{_datadir}/%{name}/docs.gitea.io/ tar -xvzf %{SOURCE2} -C %{buildroot}%{_datadir}/%{name}/docs.gitea.io sed -i -e 's|\/usr\/bin\/env bash|\/usr\/bin\/bash|g' %{buildroot}%{_datadir}/%{name}/docs.gitea.io/scripts/trans-copy.sh chmod -x %{buildroot}%{_datadir}/%{name}/docs.gitea.io/content/index.fr-fr.md rm %{buildroot}%{_datadir}/%{name}/docs.gitea.io/.gitignore # firewalld and susefirewall2 %if 0%{?suse_version} >= 1500 install -d %{buildroot}%{_prefix}/lib/firewalld/services/ install -D -m 0644 %{SOURCE23} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml %else install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ install -D -m 0644 %{SOURCE24} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %endif # apache config install -D -m0644 %{SOURCE25} %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf install -D -m0644 %{SOURCE26} %{buildroot}%{apache_sysconfdir}/vhosts.d/%{name}.conf %if %{with apparmor} # AppArmor profile mkdir -p %{buildroot}%{_sysconfdir}/apparmor.d install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.gitea %endif # system user config install -p -D -m0644 %{SOURCE27} %{buildroot}%{_sysusersdir}/%{name}.conf %{gofilelist} %pre -f %{name}.pre %service_add_pre gitea.service %post %service_add_post gitea.service %if 0%{?suse_version} >= 1500 %firewalld_reload %endif %if %{with apparmor} %apparmor_reload %{_sysconfdir}/apparmor.d/usr.bin.gitea %endif %post docs # TODO: change doc url in /usr/share/gitea/templates/base/head_navbar.tmpl %preun %service_del_preun gitea.service %postun %service_del_postun gitea.service %check #%%gotest code.gitea.io/gitea %files %license LICENSE %doc README.SUSE README.md custom/conf/app.example.ini %exclude %{_datadir}/%{name}/docs.gitea.io %config %{_sysconfdir}/profile.d/gitea.*sh %{_unitdir}/gitea.service %{_bindir}/gitea %{_sbindir}/rcgitea %if 0%{?suse_version} >= 1500 %dir %{_prefix}/lib/firewalld %dir %{_prefix}/lib/firewalld/services %config(noreplace) %{_prefix}/lib/firewalld/services/%{name}.xml %else %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %endif %if %{with apparmor} %dir %{_sysconfdir}/apparmor.d %config %{_sysconfdir}/apparmor.d/usr.bin.gitea %ghost %config(noreplace) %{_sysconfdir}/apparmor.d/local/usr.bin.gitea %endif %defattr(0660,root,gitea,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,gitea,gitea,750) %{_datadir}/gitea %{_localstatedir}/lib/gitea %{_sysusersdir}/%{name}.conf %files apache %config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf %config(noreplace) %{apache_sysconfdir}/vhosts.d/%{name}.conf %files docs %{_datadir}/%{name}/docs.gitea.io %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor