summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomáš Mózes <hydrapolic@gmail.com>2023-03-09 13:26:57 +0000
committerYixun Lan <dlan@gentoo.org>2023-03-11 15:41:30 +0800
commit08bbb69122d84d0e32d3f705faa8e3edcd062fe4 (patch)
tree0bd3f82f810b9db9b8bb96b83e7cc6f4f7ca7e2e /www-apps
parentdev-ruby/power_assert: drop 1.1.7 (diff)
downloadgentoo-08bbb69122d84d0e32d3f705faa8e3edcd062fe4.tar.gz
gentoo-08bbb69122d84d0e32d3f705faa8e3edcd062fe4.tar.bz2
gentoo-08bbb69122d84d0e32d3f705faa8e3edcd062fe4.zip
www-apps/gitea: add 1.18.5
Closes: https://github.com/gentoo/gentoo/pull/30018 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/gitea/Manifest1
-rw-r--r--www-apps/gitea/gitea-1.18.5.ebuild125
2 files changed, 126 insertions, 0 deletions
diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest
index 8f27ddfe0429..af08bd90cad0 100644
--- a/www-apps/gitea/Manifest
+++ b/www-apps/gitea/Manifest
@@ -1 +1,2 @@
DIST gitea-1.18.3.tar.gz 55493166 BLAKE2B 6a0bb385244c212f577b99b54cd621bf4b9b4f7bdd77bf199e2667fcb5b77638136b2c26b0a46d755d5aea359f0eea251762f759b461377d459092c0017ed972 SHA512 4dabcafad5f4f9804f369cf248b351db68e80f193a4b2a5901f8c13b7cb6051b6b5ef1f283037376e545c3b76aabe703e947d1780ed4a4e630ec68adffa8afff
+DIST gitea-1.18.5.tar.gz 55521804 BLAKE2B fe413fce8bdba68a9ea1a75f66a69c899ca7fca367e9f3e2bbad7f506d3dd2019f634e708ff7079f31c98ccdab5605187dff20118e91675f33e2f28cee547aab SHA512 20b502a11969691e5f331844453aedc5bd1708ff13e0615b7186b00f8fa6fe8de2b2c6ec1af052bfd6f87a07c92e1118e58aacf35f59bde32d587ba400adda8a
diff --git a/www-apps/gitea/gitea-1.18.5.ebuild b/www-apps/gitea/gitea-1.18.5.ebuild
new file mode 100644
index 000000000000..14e3dc8458e3
--- /dev/null
+++ b/www-apps/gitea/gitea-1.18.5.ebuild
@@ -0,0 +1,125 @@
+# Copyright 2016-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit fcaps go-module tmpfiles systemd flag-o-matic
+
+DESCRIPTION="A painless self-hosted Git service"
+HOMEPAGE="https://gitea.io https://github.com/go-gitea/gitea"
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/go-gitea/gitea.git"
+else
+ SRC_URI="https://github.com/go-gitea/gitea/releases/download/v${PV}/gitea-src-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+fi
+
+S="${WORKDIR}/${PN}-src-${PV}"
+
+LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
+SLOT="0"
+IUSE="+acct pam sqlite pie"
+
+DEPEND="
+ acct? (
+ acct-group/git
+ acct-user/git[gitea] )
+ pam? ( sys-libs/pam )"
+RDEPEND="${DEPEND}
+ dev-vcs/git"
+
+DOCS=(
+ custom/conf/app.example.ini CONTRIBUTING.md README.md
+)
+FILECAPS=(
+ -m 711 cap_net_bind_service+ep usr/bin/gitea
+)
+
+RESTRICT="test"
+
+src_prepare() {
+ default
+
+ local sedcmds=(
+ -e "s#^ROOT =#ROOT = ${EPREFIX}/var/lib/gitea/gitea-repositories#"
+ -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#"
+ -e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${EPREFIX}/var/lib/gitea/data#"
+ -e "s#^HTTP_ADDR = 0.0.0.0#HTTP_ADDR = 127.0.0.1#"
+ -e "s#^MODE = console#MODE = file#"
+ -e "s#^LEVEL = Trace#LEVEL = Info#"
+ -e "s#^LOG_SQL = true#LOG_SQL = false#"
+ -e "s#^DISABLE_ROUTER_LOG = false#DISABLE_ROUTER_LOG = true#"
+ )
+
+ sed -i "${sedcmds[@]}" custom/conf/app.example.ini || die
+ if use sqlite ; then
+ sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.example.ini || die
+ fi
+}
+
+src_configure() {
+ # bug 832756 - PIE build issues
+ filter-flags -fPIE
+ filter-ldflags -fPIE -pie
+}
+
+src_compile() {
+ local gitea_tags=(
+ bindata
+ $(usev pam)
+ $(usex sqlite 'sqlite sqlite_unlock_notify' '')
+ )
+ local gitea_settings=(
+ "-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/gitea/app.ini"
+ "-X code.gitea.io/gitea/modules/setting.CustomPath=${EPREFIX}/var/lib/gitea/custom"
+ "-X code.gitea.io/gitea/modules/setting.AppWorkPath=${EPREFIX}/var/lib/gitea"
+ )
+ local makeenv=(
+ DRONE_TAG="${PV}"
+ LDFLAGS="-extldflags \"${LDFLAGS}\" ${gitea_settings[*]}"
+ TAGS="${gitea_tags[*]}"
+ )
+
+ GOFLAGS=""
+ if use pie ; then
+ GOFLAGS+="-buildmode=pie"
+ fi
+
+ env "${makeenv[@]}" emake EXTRA_GOFLAGS="${GOFLAGS}" backend
+}
+
+src_install() {
+ dobin gitea
+
+ einstalldocs
+
+ newconfd "${FILESDIR}/gitea.confd-r1" gitea
+ newinitd "${FILESDIR}/gitea.initd-r3" gitea
+ newtmpfiles - gitea.conf <<-EOF
+ d /run/gitea 0755 git git
+ EOF
+ systemd_newunit "${FILESDIR}"/gitea.service-r3 gitea.service
+
+ insinto /etc/gitea
+ newins custom/conf/app.example.ini app.ini
+ if use acct; then
+ fowners root:git /etc/gitea/{,app.ini}
+ fperms g+w,o-rwx /etc/gitea/{,app.ini}
+
+ diropts -m0750 -o git -g git
+ keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
+ keepdir /var/log/gitea
+ fi
+}
+
+pkg_postinst() {
+ fcaps_pkg_postinst
+ tmpfiles_process gitea.conf
+
+ ewarn "The default JWT signing algorithm changed in 1.15.0 from HS256 (symmetric) to"
+ ewarn "RS256 (asymmetric). Gitea OAuth2 tokens (and potentially client secrets) will"
+ ewarn "need to be regenerated unless you change your JWT_SIGNING_ALGORITHM back to HS256."
+ ewarn "For other breaking changes, see <https://github.com/go-gitea/gitea/releases/tag/v1.15.0>."
+}