www-apps/gitea: Version bump to 1.0.0
authorManuel Rüger <mrueg@gentoo.org>
Sat, 24 Dec 2016 21:08:16 +0000 (22:08 +0100)
committerManuel Rüger <mrueg@gentoo.org>
Sat, 24 Dec 2016 21:08:29 +0000 (22:08 +0100)
Add initscript
Add logrotate file

Package-Manager: portage-2.3.3

www-apps/gitea/Manifest
www-apps/gitea/files/gitea.confd [new file with mode: 0644]
www-apps/gitea/files/gitea.initd [new file with mode: 0644]
www-apps/gitea/files/gitea.logrotated [new file with mode: 0644]
www-apps/gitea/gitea-1.0.0.ebuild [moved from www-apps/gitea/gitea-0.9.97_p20161219.ebuild with 74% similarity]

index 96821ece8b22a6ecc3b63d0fcfc77b6d1637775e..b1e5922c753b0602d98737182064bad44ddead92 100644 (file)
@@ -1 +1 @@
-DIST gitea-0.9.97_p20161219.tar.gz 14260080 SHA256 2166e85478ac1add4d5d1913cc986824cd11be92b738e91185ebdf93239e897e SHA512 046ee631db3b417141a607087bd57d0ec8eb6739510bb04e7d13c3b8254159e4fa4dfb71257b2435edecbc38d786f6d7021cfdcd4faa8de16e2b2469fedddcef WHIRLPOOL 7148c99dcec49ecc040f8d5dbfe2fd0feb368a8200842bea5b2d3e3b5283d16754a9c21994f001e9520a047990061942b2f4b69d9f77b909f56529e9699d0ff1
+DIST gitea-1.0.0.tar.gz 13444004 SHA256 3ad67b91f44e0b60739c57f42c880276686347f76e5993f9d95b99ab4f67185c SHA512 5047256cd02a5592a41600abdcb10a3ffee42dda7bd9696d60e8a926f0846098a6686de941feefc52b4070ed9842a744a2f5765c8a1e6ea26d5a63cca2fa96a2 WHIRLPOOL 1cf2205ac0cbcccb56f32101218780c250ad947ad961fcfecc5ceb5be56446a554d5cb2852569ff88fbc218eddc4bac2efd9c392fc53b2830d900b7dd76c0e99
diff --git a/www-apps/gitea/files/gitea.confd b/www-apps/gitea/files/gitea.confd
new file mode 100644 (file)
index 0000000..cb99b52
--- /dev/null
@@ -0,0 +1,2 @@
+# arguments for gitea
+command_args="--config /etc/gitea/app.ini"
diff --git a/www-apps/gitea/files/gitea.initd b/www-apps/gitea/files/gitea.initd
new file mode 100644 (file)
index 0000000..05565f6
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Gitea, a self-hosted Git service"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-${SVCNAME}}
+group=${group:-${SVCNAME}}
+
+command="/usr/bin/gitea web"
+command_args="${command_args:--config /etc/gitea/app.ini}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
+       --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
+
+depend() {
+       need net
+       after net
+}
+
+start_pre() {
+       checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}
diff --git a/www-apps/gitea/files/gitea.logrotated b/www-apps/gitea/files/gitea.logrotated
new file mode 100644 (file)
index 0000000..4ddfdf0
--- /dev/null
@@ -0,0 +1,8 @@
+/var/log/gitea/* {
+       su gitea gitea
+       missingok
+       size 5M
+       rotate 3
+       compress
+       copytruncate
+}
similarity index 74%
rename from www-apps/gitea/gitea-0.9.97_p20161219.ebuild
rename to www-apps/gitea/gitea-1.0.0.ebuild
index bba08a9f5e83069e9aa4d5ee59c391fd72d635f8..921424307218593961de3f2eefe667f7436c6969 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 inherit user golang-build golang-vcs-snapshot
 
 EGO_PN="code.gitea.io/gitea/..."
-EGIT_COMMIT="8559d6f267324241496b8611bc8e6f76efe869b7"
+EGIT_COMMIT="6aacf4d2f09631359b99df562b4bf31dcef44ea3"
 ARCHIVE_URI="https://github.com/go-gitea/gitea/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
 KEYWORDS="~amd64"
 
@@ -30,7 +30,7 @@ src_prepare() {
        default
        local GITEA_PREFIX=${EPREFIX}/var/lib/gitea
        sed -i -e "s/git rev-parse --short HEAD/echo ${EGIT_COMMIT:0:7}/"\
-               -e "s/^VERSION =*/VERSION = ${PV}/"\
+               -e "s/^LDFLAGS += -X \"main.Version.*$/LDFLAGS += -X \"main.Version=${PV}\"/"\
                -e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN%/*}/Makefile || die
        sed -i -e "s#RUN_USER = git#RUN_USER = gitea#"\
                -e "s#^STATIC_ROOT_PATH =#STATIC_ROOT_PATH = ${EPREFIX}/usr/share/themes/gitea/default#"\
@@ -39,22 +39,27 @@ src_prepare() {
                -e "s#^PROVIDER_CONFIG = data/sessions#PROVIDER_CONFIG = ${GITEA_PREFIX}/data/sessions#"\
                -e "s#^AVATAR_UPLOAD_PATH = data/avatars#AVATAR_UPLOAD_PATH = ${GITEA_PREFIX}/data/avatars#"\
                -e "s#^TEMP_PATH = data/tmp/uploads#TEMP_PATH = ${GITEA_PREFIX}/data/tmp/uploads#"\
-               -e "s#^PATH = data/attachements#PATH = ${GITEA_PREFIX}/data/attachements#"\
+               -e "s#^PATH = data/attachments#PATH = ${GITEA_PREFIX}/data/attachments#"\
                -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#" src/${EGO_PN%/*}/conf/app.ini || die
 }
 
 src_compile() {
-       TAGS="cert pam sqlite" LDFLAGS="" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} generate build || die
+       GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} generate
+       TAGS="bindata cert pam sqlite" LDFLAGS="" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} build
 }
 
 src_install() {
        pushd src/${EGO_PN%/*} || die
        dobin gitea
-       insinto /usr/share/gitea
-       doins -r conf
+       insinto /etc/gitea
+       doins conf/app.ini
        insinto /usr/share/themes/gitea/default
        doins -r public templates
        popd || die
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}"/gitea.logrotated gitea
+       newinitd "${FILESDIR}"/gitea.initd gitea
+       newconfd "${FILESDIR}"/gitea.confd gitea
        keepdir /var/log/gitea /var/lib/gitea/data
        fowners gitea:gitea /var/log/gitea /var/lib/gitea
 }