Update Gitea ebuilds.
This commit is contained in:
parent
f2230774f5
commit
d98c2b0535
|
@ -17,3 +17,4 @@ DIST gitea-1.8.3.tar.gz 24320679 BLAKE2B 9ef901ef7e1cb6ffa9a2aa082798b7a18ac2a6f
|
||||||
DIST gitea-1.9.0.tar.gz 24304805 BLAKE2B 4300125da2116218c0609bb8974b2abea22593161dd60e12390eea7e60865df40a089126748b3f5c9e856b2c59fdb6a4b9997c6d0bb9743ceb0c413c41caa903 SHA512 b583ba21ae9c896d527d299d5a14f7b99e40b474da7ca40521487f0459c877da9c21825b40dc0f981af7813bcabca11f62d8076cc1e401adda57d0e0505b96ce
|
DIST gitea-1.9.0.tar.gz 24304805 BLAKE2B 4300125da2116218c0609bb8974b2abea22593161dd60e12390eea7e60865df40a089126748b3f5c9e856b2c59fdb6a4b9997c6d0bb9743ceb0c413c41caa903 SHA512 b583ba21ae9c896d527d299d5a14f7b99e40b474da7ca40521487f0459c877da9c21825b40dc0f981af7813bcabca11f62d8076cc1e401adda57d0e0505b96ce
|
||||||
DIST gitea-1.9.1.tar.gz 24074441 BLAKE2B 597463b8fcaff0b4b4edbf69ba2ab48cdce5e79ae113fab8b36bb614c1226a5e5513e9e165ae4189efe100c8acfff2f4598f10999d974ed39eb7810403b108db SHA512 6be868415eeb82722c9b3a1341ddc432bc20acba247839b81c38ebb27642b8e8089b6a285042e8e386dfc909c4716194cd17f44598efed25b26773524630458e
|
DIST gitea-1.9.1.tar.gz 24074441 BLAKE2B 597463b8fcaff0b4b4edbf69ba2ab48cdce5e79ae113fab8b36bb614c1226a5e5513e9e165ae4189efe100c8acfff2f4598f10999d974ed39eb7810403b108db SHA512 6be868415eeb82722c9b3a1341ddc432bc20acba247839b81c38ebb27642b8e8089b6a285042e8e386dfc909c4716194cd17f44598efed25b26773524630458e
|
||||||
DIST gitea-1.9.2.tar.gz 24073823 BLAKE2B ca465a9825ee3fbf90255a529311d899c5d068062f5bd928ea9b24a5af6f1f45ffbd9539d9fd157776282a7b020ac182f3f3be57b5f3c33c8ec13ad3bebca22a SHA512 00c91032948feb76899835e874c5d11828b24d1e112b90d5bc645d6acc9965744123f879562629c8af02285d73e42dda54689697523bd16a5acce69bbed9b989
|
DIST gitea-1.9.2.tar.gz 24073823 BLAKE2B ca465a9825ee3fbf90255a529311d899c5d068062f5bd928ea9b24a5af6f1f45ffbd9539d9fd157776282a7b020ac182f3f3be57b5f3c33c8ec13ad3bebca22a SHA512 00c91032948feb76899835e874c5d11828b24d1e112b90d5bc645d6acc9965744123f879562629c8af02285d73e42dda54689697523bd16a5acce69bbed9b989
|
||||||
|
DIST gitea-1.9.3.tar.gz 24064564 BLAKE2B f65c10d335735e107a8bc24e102c6e3e979516f3c557483af83a49358be7441b12e948b04a540c2981f71eb2424f8205488816251782ab0f132a549ee22c3349 SHA512 331a719cfec73f64650525c17d035c3df1ff23703196a8b0d4495693eecac7cced1f103012b694e8b37b9ee4ebf16f252f303a7525c06512c3124bed66043e27
|
||||||
|
|
|
@ -1,65 +1,112 @@
|
||||||
# Copyright 1999-2018 Gentoo Foundation
|
# Copyright 1999-2019 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
inherit user systemd golang-build golang-vcs-snapshot
|
inherit fcaps golang-vcs-snapshot systemd user
|
||||||
|
|
||||||
EGO_PN="code.gitea.io/gitea"
|
EGO_PN="code.gitea.io/gitea"
|
||||||
KEYWORDS="~amd64 ~arm"
|
|
||||||
|
|
||||||
DESCRIPTION="A painless self-hosted Git service, written in Go"
|
DESCRIPTION="A painless self-hosted Git service"
|
||||||
HOMEPAGE="https://github.com/go-gitea/gitea"
|
HOMEPAGE="https://gitea.io/"
|
||||||
SRC_URI="https://github.com/go-gitea/gitea/archive/v1.9.0.tar.gz -> ${P}.tar.gz"
|
SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
|
||||||
|
|
||||||
LICENSE="MIT"
|
LICENSE="MIT"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE=""
|
KEYWORDS="~amd64 ~arm ~arm64"
|
||||||
|
IUSE="pam sqlite"
|
||||||
|
|
||||||
DEPEND="dev-go/go-bindata"
|
COMMON_DEPEND="pam? ( sys-libs/pam )"
|
||||||
RDEPEND="dev-vcs/git"
|
DEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-go/go-bindata
|
||||||
|
"
|
||||||
|
RDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-vcs/git[curl,threads]
|
||||||
|
"
|
||||||
|
|
||||||
|
FILECAPS=( cap_net_bind_service+ep usr/bin/gitea )
|
||||||
|
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
|
||||||
|
S="${WORKDIR}/${P}/src/${EGO_PN}"
|
||||||
|
|
||||||
|
PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" )
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
enewgroup git
|
enewgroup git
|
||||||
enewuser git -1 /bin/bash /var/lib/gitea git
|
enewuser git -1 /bin/bash /var/lib/gitea git
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitea_make() {
|
||||||
|
local my_tags=(
|
||||||
|
bindata
|
||||||
|
$(usev pam)
|
||||||
|
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
|
||||||
|
)
|
||||||
|
local my_makeopt=(
|
||||||
|
DRONE_TAG=${PV}
|
||||||
|
TAGS="${my_tags[@]}"
|
||||||
|
)
|
||||||
|
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" LDFLAGS="-X main.Version=${PV}" emake "${my_makeopt[@]}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
sed -i -e "s/\"main.Version.*$/\"main.Version=${PV}\"/"\
|
sed -i \
|
||||||
-e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN}/Makefile || die
|
-e "s#^RUN_MODE = dev#RUN_MODE = prod#" \
|
||||||
|
-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#" \
|
||||||
|
-e "s#^APP_ID =#;APP_ID =#" \
|
||||||
|
-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#" \
|
||||||
|
custom/conf/app.ini.sample || die
|
||||||
|
if use sqlite ; then
|
||||||
|
sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
gitea_make generate
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} generate
|
gitea_make build
|
||||||
TAGS="bindata pam sqlite" LDFLAGS="" CGO_LDFLAGS="-fno-PIC" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} build
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
gitea_make test
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
mkdir -p ${D}/var/lib/gitea/custom
|
|
||||||
pushd src/${EGO_PN} || die
|
|
||||||
cp -apr options ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr public ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr templates ${D}/var/lib/gitea/custom/
|
|
||||||
dobin gitea
|
dobin gitea
|
||||||
insinto /var/lib/gitea/conf
|
|
||||||
newins custom/conf/app.ini.sample app.ini.example
|
einstalldocs
|
||||||
popd || die
|
|
||||||
|
newconfd "${FILESDIR}"/gitea.confd-r1 gitea
|
||||||
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
||||||
newconfd "${FILESDIR}"/gitea.confd gitea
|
systemd_newunit "${FILESDIR}"/gitea.service-r1 gitea.service
|
||||||
keepdir /var/log/gitea /var/lib/gitea/data
|
|
||||||
fowners -R git:git /var/log/gitea /var/lib/gitea/
|
insinto /etc/gitea
|
||||||
systemd_dounit "${FILESDIR}/gitea.service"
|
newins custom/conf/app.ini.sample app.ini
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [[ ! -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
fcaps_pkg_postinst
|
||||||
elog "No app.ini found, copying initial config over"
|
if [[ -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
||||||
cp "${FILESDIR}"/app.ini "${EROOT}"/var/lib/gitea/conf/ || die
|
ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini."
|
||||||
chown git:git /var/lib/gitea/conf/app.ini
|
ewarn "Please move your configuration from ${EROOT}/var/lib/gitea/conf/app.ini"
|
||||||
else
|
ewarn "and adapt the gitea-repositories hooks and ssh authorized_keys."
|
||||||
elog "app.ini found, please check example file for possible changes"
|
ewarn "Depending on your configuration you should run something like:"
|
||||||
ewarn "Please note that environment variables have been changed:"
|
ewarn "sed -i -e 's#${EROOT}/var/lib/gitea/conf/app.ini#${EROOT}/etc/gitea/app.ini#' \\"
|
||||||
ewarn "GITEA_WORK_DIR is set to /var/lib/gitea (previous value: unset)"
|
ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\"
|
||||||
ewarn "GITEA_CUSTOM is set to '\$GITEA_WORK_DIR/custom' (previous: /var/lib/gitea)"
|
ewarn " /var/lib/gitea/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,65 +1,112 @@
|
||||||
# Copyright 1999-2018 Gentoo Foundation
|
# Copyright 1999-2019 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
inherit user systemd golang-build golang-vcs-snapshot
|
inherit fcaps golang-vcs-snapshot systemd user
|
||||||
|
|
||||||
EGO_PN="code.gitea.io/gitea"
|
EGO_PN="code.gitea.io/gitea"
|
||||||
KEYWORDS="~amd64 ~arm"
|
|
||||||
|
|
||||||
DESCRIPTION="A painless self-hosted Git service, written in Go"
|
DESCRIPTION="A painless self-hosted Git service"
|
||||||
HOMEPAGE="https://github.com/go-gitea/gitea"
|
HOMEPAGE="https://gitea.io/"
|
||||||
SRC_URI="https://github.com/go-gitea/gitea/archive/v1.9.1.tar.gz -> ${P}.tar.gz"
|
SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
|
||||||
|
|
||||||
LICENSE="MIT"
|
LICENSE="MIT"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE=""
|
KEYWORDS="~amd64 ~arm ~arm64"
|
||||||
|
IUSE="pam sqlite"
|
||||||
|
|
||||||
DEPEND="dev-go/go-bindata"
|
COMMON_DEPEND="pam? ( sys-libs/pam )"
|
||||||
RDEPEND="dev-vcs/git"
|
DEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-go/go-bindata
|
||||||
|
"
|
||||||
|
RDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-vcs/git[curl,threads]
|
||||||
|
"
|
||||||
|
|
||||||
|
FILECAPS=( cap_net_bind_service+ep usr/bin/gitea )
|
||||||
|
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
|
||||||
|
S="${WORKDIR}/${P}/src/${EGO_PN}"
|
||||||
|
|
||||||
|
PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" )
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
enewgroup git
|
enewgroup git
|
||||||
enewuser git -1 /bin/bash /var/lib/gitea git
|
enewuser git -1 /bin/bash /var/lib/gitea git
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitea_make() {
|
||||||
|
local my_tags=(
|
||||||
|
bindata
|
||||||
|
$(usev pam)
|
||||||
|
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
|
||||||
|
)
|
||||||
|
local my_makeopt=(
|
||||||
|
DRONE_TAG=${PV}
|
||||||
|
TAGS="${my_tags[@]}"
|
||||||
|
)
|
||||||
|
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" LDFLAGS="-X main.Version=${PV}" emake "${my_makeopt[@]}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
sed -i -e "s/\"main.Version.*$/\"main.Version=${PV}\"/"\
|
sed -i \
|
||||||
-e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN}/Makefile || die
|
-e "s#^RUN_MODE = dev#RUN_MODE = prod#" \
|
||||||
|
-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#" \
|
||||||
|
-e "s#^APP_ID =#;APP_ID =#" \
|
||||||
|
-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#" \
|
||||||
|
custom/conf/app.ini.sample || die
|
||||||
|
if use sqlite ; then
|
||||||
|
sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
gitea_make generate
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} generate
|
gitea_make build
|
||||||
TAGS="bindata pam sqlite" LDFLAGS="" CGO_LDFLAGS="-fno-PIC" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} build
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
gitea_make test
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
mkdir -p ${D}/var/lib/gitea/custom
|
|
||||||
pushd src/${EGO_PN} || die
|
|
||||||
cp -apr options ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr public ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr templates ${D}/var/lib/gitea/custom/
|
|
||||||
dobin gitea
|
dobin gitea
|
||||||
insinto /var/lib/gitea/conf
|
|
||||||
newins custom/conf/app.ini.sample app.ini.example
|
einstalldocs
|
||||||
popd || die
|
|
||||||
|
newconfd "${FILESDIR}"/gitea.confd-r1 gitea
|
||||||
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
||||||
newconfd "${FILESDIR}"/gitea.confd gitea
|
systemd_newunit "${FILESDIR}"/gitea.service-r1 gitea.service
|
||||||
keepdir /var/log/gitea /var/lib/gitea/data
|
|
||||||
fowners -R git:git /var/log/gitea /var/lib/gitea/
|
insinto /etc/gitea
|
||||||
systemd_dounit "${FILESDIR}/gitea.service"
|
newins custom/conf/app.ini.sample app.ini
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [[ ! -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
fcaps_pkg_postinst
|
||||||
elog "No app.ini found, copying initial config over"
|
if [[ -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
||||||
cp "${FILESDIR}"/app.ini "${EROOT}"/var/lib/gitea/conf/ || die
|
ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini."
|
||||||
chown git:git /var/lib/gitea/conf/app.ini
|
ewarn "Please move your configuration from ${EROOT}/var/lib/gitea/conf/app.ini"
|
||||||
else
|
ewarn "and adapt the gitea-repositories hooks and ssh authorized_keys."
|
||||||
elog "app.ini found, please check example file for possible changes"
|
ewarn "Depending on your configuration you should run something like:"
|
||||||
ewarn "Please note that environment variables have been changed:"
|
ewarn "sed -i -e 's#${EROOT}/var/lib/gitea/conf/app.ini#${EROOT}/etc/gitea/app.ini#' \\"
|
||||||
ewarn "GITEA_WORK_DIR is set to /var/lib/gitea (previous value: unset)"
|
ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\"
|
||||||
ewarn "GITEA_CUSTOM is set to '\$GITEA_WORK_DIR/custom' (previous: /var/lib/gitea)"
|
ewarn " /var/lib/gitea/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,65 +1,112 @@
|
||||||
# Copyright 1999-2018 Gentoo Foundation
|
# Copyright 1999-2019 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
inherit user systemd golang-build golang-vcs-snapshot
|
inherit fcaps golang-vcs-snapshot systemd user
|
||||||
|
|
||||||
EGO_PN="code.gitea.io/gitea"
|
EGO_PN="code.gitea.io/gitea"
|
||||||
KEYWORDS="~amd64 ~arm"
|
|
||||||
|
|
||||||
DESCRIPTION="A painless self-hosted Git service, written in Go"
|
DESCRIPTION="A painless self-hosted Git service"
|
||||||
HOMEPAGE="https://github.com/go-gitea/gitea"
|
HOMEPAGE="https://gitea.io/"
|
||||||
SRC_URI="https://github.com/go-gitea/gitea/archive/v1.9.2.tar.gz -> ${P}.tar.gz"
|
SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
|
||||||
|
|
||||||
LICENSE="MIT"
|
LICENSE="MIT"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE=""
|
KEYWORDS="~amd64 ~arm ~arm64"
|
||||||
|
IUSE="pam sqlite"
|
||||||
|
|
||||||
DEPEND="dev-go/go-bindata"
|
COMMON_DEPEND="pam? ( sys-libs/pam )"
|
||||||
RDEPEND="dev-vcs/git"
|
DEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-go/go-bindata
|
||||||
|
"
|
||||||
|
RDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-vcs/git[curl,threads]
|
||||||
|
"
|
||||||
|
|
||||||
|
FILECAPS=( cap_net_bind_service+ep usr/bin/gitea )
|
||||||
|
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
|
||||||
|
S="${WORKDIR}/${P}/src/${EGO_PN}"
|
||||||
|
|
||||||
|
PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" )
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
enewgroup git
|
enewgroup git
|
||||||
enewuser git -1 /bin/bash /var/lib/gitea git
|
enewuser git -1 /bin/bash /var/lib/gitea git
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitea_make() {
|
||||||
|
local my_tags=(
|
||||||
|
bindata
|
||||||
|
$(usev pam)
|
||||||
|
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
|
||||||
|
)
|
||||||
|
local my_makeopt=(
|
||||||
|
DRONE_TAG=${PV}
|
||||||
|
TAGS="${my_tags[@]}"
|
||||||
|
)
|
||||||
|
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" LDFLAGS="-X main.Version=${PV}" emake "${my_makeopt[@]}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
sed -i -e "s/\"main.Version.*$/\"main.Version=${PV}\"/"\
|
sed -i \
|
||||||
-e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN}/Makefile || die
|
-e "s#^RUN_MODE = dev#RUN_MODE = prod#" \
|
||||||
|
-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#" \
|
||||||
|
-e "s#^APP_ID =#;APP_ID =#" \
|
||||||
|
-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#" \
|
||||||
|
custom/conf/app.ini.sample || die
|
||||||
|
if use sqlite ; then
|
||||||
|
sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
gitea_make generate
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} generate
|
gitea_make build
|
||||||
TAGS="bindata pam sqlite" LDFLAGS="" CGO_LDFLAGS="-fno-PIC" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} build
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
gitea_make test
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
mkdir -p ${D}/var/lib/gitea/custom
|
|
||||||
pushd src/${EGO_PN} || die
|
|
||||||
cp -apr options ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr public ${D}/var/lib/gitea/custom/
|
|
||||||
cp -apr templates ${D}/var/lib/gitea/custom/
|
|
||||||
dobin gitea
|
dobin gitea
|
||||||
insinto /var/lib/gitea/conf
|
|
||||||
newins custom/conf/app.ini.sample app.ini.example
|
einstalldocs
|
||||||
popd || die
|
|
||||||
|
newconfd "${FILESDIR}"/gitea.confd-r1 gitea
|
||||||
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
||||||
newconfd "${FILESDIR}"/gitea.confd gitea
|
systemd_newunit "${FILESDIR}"/gitea.service-r1 gitea.service
|
||||||
keepdir /var/log/gitea /var/lib/gitea/data
|
|
||||||
fowners -R git:git /var/log/gitea /var/lib/gitea/
|
insinto /etc/gitea
|
||||||
systemd_dounit "${FILESDIR}/gitea.service"
|
newins custom/conf/app.ini.sample app.ini
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [[ ! -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
fcaps_pkg_postinst
|
||||||
elog "No app.ini found, copying initial config over"
|
if [[ -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
||||||
cp "${FILESDIR}"/app.ini "${EROOT}"/var/lib/gitea/conf/ || die
|
ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini."
|
||||||
chown git:git /var/lib/gitea/conf/app.ini
|
ewarn "Please move your configuration from ${EROOT}/var/lib/gitea/conf/app.ini"
|
||||||
else
|
ewarn "and adapt the gitea-repositories hooks and ssh authorized_keys."
|
||||||
elog "app.ini found, please check example file for possible changes"
|
ewarn "Depending on your configuration you should run something like:"
|
||||||
ewarn "Please note that environment variables have been changed:"
|
ewarn "sed -i -e 's#${EROOT}/var/lib/gitea/conf/app.ini#${EROOT}/etc/gitea/app.ini#' \\"
|
||||||
ewarn "GITEA_WORK_DIR is set to /var/lib/gitea (previous value: unset)"
|
ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\"
|
||||||
ewarn "GITEA_CUSTOM is set to '\$GITEA_WORK_DIR/custom' (previous: /var/lib/gitea)"
|
ewarn " /var/lib/gitea/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
# Copyright 1999-2019 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI=7
|
||||||
|
inherit fcaps golang-vcs-snapshot systemd user
|
||||||
|
|
||||||
|
EGO_PN="code.gitea.io/gitea"
|
||||||
|
|
||||||
|
DESCRIPTION="A painless self-hosted Git service"
|
||||||
|
HOMEPAGE="https://gitea.io/"
|
||||||
|
SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="MIT"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64 ~arm ~arm64"
|
||||||
|
IUSE="pam sqlite"
|
||||||
|
|
||||||
|
COMMON_DEPEND="pam? ( sys-libs/pam )"
|
||||||
|
DEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-go/go-bindata
|
||||||
|
"
|
||||||
|
RDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
dev-vcs/git[curl,threads]
|
||||||
|
"
|
||||||
|
|
||||||
|
FILECAPS=( cap_net_bind_service+ep usr/bin/gitea )
|
||||||
|
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
|
||||||
|
S="${WORKDIR}/${P}/src/${EGO_PN}"
|
||||||
|
|
||||||
|
PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" )
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup git
|
||||||
|
enewuser git -1 /bin/bash /var/lib/gitea git
|
||||||
|
}
|
||||||
|
|
||||||
|
gitea_make() {
|
||||||
|
local my_tags=(
|
||||||
|
bindata
|
||||||
|
$(usev pam)
|
||||||
|
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
|
||||||
|
)
|
||||||
|
local my_makeopt=(
|
||||||
|
DRONE_TAG=${PV}
|
||||||
|
TAGS="${my_tags[@]}"
|
||||||
|
)
|
||||||
|
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" LDFLAGS="-X main.Version=${PV}" emake "${my_makeopt[@]}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
default
|
||||||
|
sed -i \
|
||||||
|
-e "s#^RUN_MODE = dev#RUN_MODE = prod#" \
|
||||||
|
-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#" \
|
||||||
|
-e "s#^APP_ID =#;APP_ID =#" \
|
||||||
|
-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#" \
|
||||||
|
custom/conf/app.ini.sample || die
|
||||||
|
if use sqlite ; then
|
||||||
|
sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
gitea_make generate
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
gitea_make build
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
gitea_make test
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
dobin gitea
|
||||||
|
|
||||||
|
einstalldocs
|
||||||
|
|
||||||
|
newconfd "${FILESDIR}"/gitea.confd-r1 gitea
|
||||||
|
newinitd "${FILESDIR}"/gitea.initd-r1 gitea
|
||||||
|
systemd_newunit "${FILESDIR}"/gitea.service-r1 gitea.service
|
||||||
|
|
||||||
|
insinto /etc/gitea
|
||||||
|
newins custom/conf/app.ini.sample app.ini
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
fcaps_pkg_postinst
|
||||||
|
if [[ -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
|
||||||
|
ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini."
|
||||||
|
ewarn "Please move your configuration from ${EROOT}/var/lib/gitea/conf/app.ini"
|
||||||
|
ewarn "and adapt the gitea-repositories hooks and ssh authorized_keys."
|
||||||
|
ewarn "Depending on your configuration you should run something like:"
|
||||||
|
ewarn "sed -i -e 's#${EROOT}/var/lib/gitea/conf/app.ini#${EROOT}/etc/gitea/app.ini#' \\"
|
||||||
|
ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\"
|
||||||
|
ewarn " /var/lib/gitea/.ssh/authorized_keys"
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in New Issue