summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mozes <hydrapolic@gmail.com>2019-03-17 00:27:22 +0000
committerMichał Górny <mgorny@gentoo.org>2019-04-21 23:33:07 +0200
commitd8b847da354d330a40a67a2971bbb851744a4ec2 (patch)
treef397974c3197ed7bdcd744cfcf1c18ca50909a6c /www-apps/gitea
parentnet-libs/tox: update to tox 0.2.9 (diff)
downloadgentoo-d8b847da354d330a40a67a2971bbb851744a4ec2.tar.gz
gentoo-d8b847da354d330a40a67a2971bbb851744a4ec2.tar.bz2
gentoo-d8b847da354d330a40a67a2971bbb851744a4ec2.zip
www-apps/gitea: bump to 1.7.6
Thanks to Felix Neumärker and Pierre-Olivier Mercier for patches. Closes: https://bugs.gentoo.org/680590 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/11387 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'www-apps/gitea')
-rw-r--r--www-apps/gitea/Manifest1
-rw-r--r--www-apps/gitea/files/gitea.confd-r114
-rw-r--r--www-apps/gitea/files/gitea.initd-r222
-rw-r--r--www-apps/gitea/files/gitea.service-r128
-rw-r--r--www-apps/gitea/gitea-1.7.6.ebuild85
5 files changed, 150 insertions, 0 deletions
diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest
index 4ed8383cb255..9cdebf87da21 100644
--- a/www-apps/gitea/Manifest
+++ b/www-apps/gitea/Manifest
@@ -1 +1,2 @@
DIST gitea-1.7.4.tar.gz 20858340 BLAKE2B 81d896d313abe25bc1a5becd16249c2ce39ab45d9f40ccf3a565b6777847c7256d5b131f597be237df57513a207978e23480ad3c6087bbc588afe8bbcd46d5c9 SHA512 eede6d410529b1facf65061256e48fee7d459aa12d8c55346d3ad78004a45b7bf667536979fe92270a85901102fd9cddb8183490e16f912b742e799ca912e370
+DIST gitea-1.7.6.tar.gz 20868421 BLAKE2B bdd623c09f628a56df9e2c36958d94582707ffeaeb45960fd1ea0d50a8083458683f28ab2c398ac1e939ba6b011ba6a83cc02abd98e9b9ff131bda8fd224c66c SHA512 ad39969b5f1246875c006c72f2ea711772f29bfb9c687510efbd2089c9f88e9d218d14b03111715179b2e0f72f85731f22dd46fc022e224be73b7e73e798236b
diff --git a/www-apps/gitea/files/gitea.confd-r1 b/www-apps/gitea/files/gitea.confd-r1
new file mode 100644
index 000000000000..19018c1c645a
--- /dev/null
+++ b/www-apps/gitea/files/gitea.confd-r1
@@ -0,0 +1,14 @@
+# Gitea configuration
+GITEA_CONF="/etc/gitea/app.ini"
+
+# Gitea user
+GITEA_USER="git"
+
+# Gitea group
+GITEA_GROUP="git"
+
+# Gitea working directory
+GITEA_WORK_DIR="/var/lib/gitea"
+
+# Gitea custom directory
+GITEA_CUSTOM="${GITEA_WORK_DIR}/custom"
diff --git a/www-apps/gitea/files/gitea.initd-r2 b/www-apps/gitea/files/gitea.initd-r2
new file mode 100644
index 000000000000..24cac0b41f23
--- /dev/null
+++ b/www-apps/gitea/files/gitea.initd-r2
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 2016-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Gitea, a self-hosted Git service"
+
+: ${GITEA_CONF:=/etc/gitea/app.ini}
+: ${GITEA_USER:=git}
+: ${GITEA_GROUP:=git}
+: ${GITEA_WORK_DIR:=/var/lib/gitea}
+: ${GITEA_CUSTOM:=${GITEA_WORK_DIR}/custom}
+
+command="/usr/bin/gitea web"
+command_args="--config ${GITEA_CONF}"
+command_background="true"
+command_user="${GITEA_USER}:${GITEA_GROUP}"
+error_log="/var/log/${RC_SVCNAME}/${RC_SVCNAME}.err"
+output_log="/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+pidfile="/run/${RC_SVCNAME}.pid"
+required_files="${GITEA_CONF}"
+start_stop_daemon_args="-e GITEA_WORK_DIR=${GITEA_WORK_DIR} \
+ -e GITEA_CUSTOM=${GITEA_CUSTOM}"
diff --git a/www-apps/gitea/files/gitea.service-r1 b/www-apps/gitea/files/gitea.service-r1
new file mode 100644
index 000000000000..73f924337fd6
--- /dev/null
+++ b/www-apps/gitea/files/gitea.service-r1
@@ -0,0 +1,28 @@
+[Unit]
+Description=Gitea service
+Documentation=https://docs.gitea.io/
+
+AssertPathIsDirectory=/var/lib/gitea
+AssertPathIsReadWrite=/var/lib/gitea
+
+After=network.target
+Requires=network.target
+After=mysqld.service
+After=postgresql.service
+After=memcached.service
+After=redis.service
+
+[Service]
+User=git
+Group=git
+
+Environment="GITEA_WORK_DIR=/var/lib/gitea GITEA_CUSTOM=/var/lib/gitea/custom"
+WorkingDirectory=/var/lib/gitea
+ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini
+
+Restart=always
+PrivateTmp=true
+Nice=5
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-apps/gitea/gitea-1.7.6.ebuild b/www-apps/gitea/gitea-1.7.6.ebuild
new file mode 100644
index 000000000000..f62591346a41
--- /dev/null
+++ b/www-apps/gitea/gitea-1.7.6.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit golang-vcs-snapshot systemd user
+
+EGO_PN="code.gitea.io/gitea"
+KEYWORDS="~amd64 ~arm"
+
+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"
+IUSE="pam sqlite"
+
+COMMON_DEPEND="pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ dev-go/go-bindata"
+RDEPEND="${COMMON_DEPEND}
+ dev-vcs/git"
+
+DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
+S="${WORKDIR}/${P}/src/${EGO_PN}"
+
+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) emake "${my_makeopt[@]}" "$1"
+}
+
+src_compile() {
+ gitea_make generate
+ gitea_make build
+}
+
+src_test() {
+ gitea_make test
+}
+
+src_install() {
+ einstalldocs
+ dobin gitea
+ newconfd "${FILESDIR}"/gitea.confd-r1 gitea
+ newinitd "${FILESDIR}"/gitea.initd-r2 gitea
+ systemd_newunit "${FILESDIR}"/gitea.service-r1 gitea.service
+ diropts -m0750 -o git -g git
+ keepdir /etc/gitea
+ keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
+ keepdir /var/log/gitea
+}
+
+pkg_postinst() {
+ ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini."
+ ewarn "Please adapt the gitea-repositories hooks and ssh authorized_keys."
+ ewarn "Depending on your configuration you should run something like:"
+ ewarn "sed -i -e 's#/var/lib/gitea/conf/app.ini#/etc/gitea/app.ini#' \\"
+ ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\"
+ ewarn " /var/lib/gitea/.ssh/authorized_keys"
+
+ if [[ ! -e "${EROOT}/etc/gitea/app.ini" ]]; then
+ elog "No app.ini found, copying initial config over"
+ cp "${FILESDIR}"/app.ini "${EROOT}"/etc/gitea/ || die
+ chown git:git "${EROOT}"/etc/gitea/app.ini || die
+ elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitea)."
+ else
+ elog "app.ini found, please check the sample 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
+}