www-apps/forgejo: add 1.21.5.0

Signed-off-by: Artemis Everfree <artemis@artemis.sh>
This commit is contained in:
Artemis Everfree
2024-02-03 15:28:17 -08:00
parent a4ebfd80c3
commit 8010ec9244
3 changed files with 138 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
DIST forgejo-1.19.4.0.tar.gz 60635393 BLAKE2B 7fe8e10f7aae8371c4a540290bb24c67a0521080eb58c7749c95d977320781e2e11ba754a42a333c706d243cf0170178dd62da5338540576d214f281b3da6daa SHA512 4870a7804c3cefab4aac38f30ac60874d9a7359b29e8f765ee9a1f41bc543fdd445a21c6e808f864c56ce22f79f6038b15eec4325c556ef6288ad6635977533f
DIST forgejo-1.20.5.0.tar.gz 55539985 BLAKE2B 09830af9cfac13e3ca790cd54fd884f1d3cfa1e18b7d8c07517c669fe15e28a3074777ad2f031533aab4a9812fd9e580eeaa6be7d88b68fce2ccfdfbd258d37e SHA512 db42ae29fb5005a2ebf3474784fbec15bbae25c255ead00c7aa6227f844a608cd52c146b215ffec6b7e6ead5f001c37d459b01695c224c0edb519cb71c249eb5
DIST forgejo-1.20.6.0.tar.gz 55539743 BLAKE2B d44fcaec52b164099a221f2172faab8fe078b5fdaf8c9910042278f6276f4ff557d2a527a5159a0bb157f773ffcc91595d2183e1be53b97187cb35ee684fa7ce SHA512 047b41b3192053df8c0f37675c087bc5fbed9967e8f23cab35bede76071129e6f18ec0561a0415a2eaa2010877dedfd15a231f050a1738fca1a5e437f89e93b5
DIST forgejo-1.21.5.0.tar.gz 58775082 BLAKE2B 05b5ee8a394ad2968769cda82b0caa368d6a0fa81686c67e3384ad8b69b43acfd53702af3ff383f05c6b2a4a2e191fb77ca7bd4755ce231451c21c97cc79e270 SHA512 947870af1601dcad9ed08157c0dc8971e333646b1ff1312592f408896e6a87804ed4dc1a22af87d1948fd64a34ec5af0209bad23fb742bb585244588b11062cf

View File

@@ -0,0 +1,136 @@
# 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
MY_PV="$(ver_cut 1-3)-$(ver_cut 4)"
DESCRIPTION="A self-hosted lightweight software forge"
HOMEPAGE="https://forgejo.org/ https://codeberg.org/forgejo/forgejo"
SRC_URI="https://codeberg.org/forgejo/forgejo/releases/download/v${MY_PV}/forgejo-src-${MY_PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
S="${WORKDIR}/${PN}-src-${MY_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
!www-apps/gitea" # until acct-user/git[forgejo]
DOCS=(
custom/conf/app.example.ini CONTRIBUTING.md README.md
)
FILECAPS=(
-m 711 cap_net_bind_service+ep usr/bin/forgejo
)
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/forgejo#"
-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 forgejo_tags=(
bindata
$(usev pam)
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
)
local forgejo_settings=(
"-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/forgejo/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}\" ${forgejo_settings[*]}"
TAGS="${forgejo_tags[*]}"
)
GOFLAGS=""
if use pie ; then
GOFLAGS+="-buildmode=pie"
fi
# need to set -j1 or build fails due to a race condition between MAKE jobs.
# this does not actually impact build parallelism, because the go compiler
# will still build everything in parallel when it's invoked.
env "${makeenv[@]}" emake -j1 EXTRA_GOFLAGS="${GOFLAGS}" backend
}
src_install() {
cp gitea forgejo
dobin forgejo
einstalldocs
newconfd "${FILESDIR}/forgejo.confd-r1" forgejo
newinitd "${FILESDIR}/forgejo.initd-r3" forgejo
newtmpfiles - forgejo.conf <<-EOF
d /run/forgejo 0755 git git
EOF
systemd_newunit "${FILESDIR}"/forgejo.service-r3 forgejo.service
insinto /etc/forgejo
newins custom/conf/app.example.ini app.ini
if use acct; then
fowners root:git /etc/forgejo/{,app.ini}
fperms g+w,o-rwx /etc/forgejo/{,app.ini}
diropts -m0750 -o git -g git
keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
keepdir /var/log/forgejo
fi
}
pkg_postinst() {
fcaps_pkg_postinst
tmpfiles_process forgejo.conf
ewarn "${PN} ${MY_PV} will continue to use /var/lib/gitea as the default home,"
ewarn "as acct-user/git[gitea] depends on it, and acct-user[forgejo] does not"
ewarn "exist yet."
ewarn ""
ewarn "1.21.x includes changes that may require manual intervention when"
ewarn "upgrading from 1.20.x:"
ewarn ""
ewarn "> Git branches are stored in the databases to reduce the calls to a"
ewarn "> git process and improve performances. After upgrading, login as an"
ewarn "> admin, go to the /admin page and click run Sync missed branches"
ewarn "> from git data to databases. If this is not done there will be"
ewarn "> messages such as LoadBranches: branch does not exist in the logs."
ewarn ""
ewarn "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#1-21-1-0"
ewarn "for more information"
}

View File

@@ -9,6 +9,7 @@
<upstream>
<changelog>https://codeberg.org/forgejo/forgejo/releases</changelog>
<bugs-to>https://codeberg.org/forgejo/forgejo/issues</bugs-to>
<remote-id type="codeberg">forgejo/forgejo</remote-id>
</upstream>
<use>
<flag name="acct">User and group management via acct-*/git packages</flag>