summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mozes <tmozes@sygic.com>2018-09-20 17:18:55 +0200
committerMichał Górny <mgorny@gentoo.org>2018-10-10 13:23:31 +0200
commit6689a871ed0f58026a4499c67905a4d6c7b941cd (patch)
treed0f3141db1d91c30f430048d52ad8a45991b46be /www-apps/gitea/gitea-1.5.2.ebuild
parentnet-libs/libircclient: Added two openssl fixes from upstream. (diff)
downloadgentoo-6689a871ed0f58026a4499c67905a4d6c7b941cd.tar.gz
gentoo-6689a871ed0f58026a4499c67905a4d6c7b941cd.tar.bz2
gentoo-6689a871ed0f58026a4499c67905a4d6c7b941cd.zip
www-apps/gitea: bump to 1.5.2
Closes: https://bugs.gentoo.org/665638 Closes: https://bugs.gentoo.org/666609 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Package-Manager: Portage-2.3.49, Repoman-2.3.10 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/9928
Diffstat (limited to 'www-apps/gitea/gitea-1.5.2.ebuild')
-rw-r--r--www-apps/gitea/gitea-1.5.2.ebuild60
1 files changed, 60 insertions, 0 deletions
diff --git a/www-apps/gitea/gitea-1.5.2.ebuild b/www-apps/gitea/gitea-1.5.2.ebuild
new file mode 100644
index 000000000000..ef344def188d
--- /dev/null
+++ b/www-apps/gitea/gitea-1.5.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit golang-build golang-vcs-snapshot systemd user
+
+EGO_PN="code.gitea.io/gitea"
+KEYWORDS="~amd64 ~arm"
+
+DESCRIPTION="A painless self-hosted Git service, written in Go"
+HOMEPAGE="https://github.com/go-gitea/gitea"
+SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+
+DEPEND="dev-go/go-bindata"
+RDEPEND="dev-vcs/git"
+
+pkg_setup() {
+ enewgroup git
+ enewuser git -1 /bin/bash /var/lib/gitea git
+}
+
+src_prepare() {
+ default
+ sed -i -e "s/\"main.Version.*$/\"main.Version=${PV}\"/"\
+ -e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN}/Makefile || die
+}
+
+src_compile() {
+ GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} generate
+ TAGS="bindata pam sqlite" LDFLAGS="" CGO_LDFLAGS="" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN} build
+}
+
+src_install() {
+ diropts -m0750 -o git -g git
+ keepdir /var/log/gitea /var/lib/gitea /var/lib/gitea/data
+ pushd src/${EGO_PN} >/dev/null || die
+ dobin gitea
+ insinto /var/lib/gitea/conf
+ newins custom/conf/app.ini.sample app.ini.example
+ popd >/dev/null || die
+ newinitd "${FILESDIR}"/gitea.initd-r1 gitea
+ newconfd "${FILESDIR}"/gitea.confd gitea
+ systemd_dounit "${FILESDIR}/gitea.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then
+ elog "No app.ini found, copying initial config over"
+ cp "${FILESDIR}"/app.ini "${EROOT}"/var/lib/gitea/conf/ || die
+ chown git:git /var/lib/gitea/conf/app.ini
+ else
+ elog "app.ini found, please check example file for possible changes"
+ ewarn "Please note that environment variables have been changed:"
+ ewarn "GITEA_WORK_DIR is set to /var/lib/gitea (previous value: unset)"
+ ewarn "GITEA_CUSTOM is set to '\$GITEA_WORK_DIR/custom' (previous: /var/lib/gitea)"
+ fi
+}