From 821dae8a3457ae3504899dac64990aa90230f3a5 Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Wed, 10 Jun 2020 16:57:17 +0200 Subject: [PATCH] cleanup old www-apps/gitea --- www-apps/gitea/Manifest | 6 +- ...gitea-1.9.4.ebuild => gitea-1.11.4.ebuild} | 89 +++++++++++-------- www-apps/gitea/gitea-1.7.5.ebuild | 67 -------------- 3 files changed, 56 insertions(+), 106 deletions(-) rename www-apps/gitea/{gitea-1.9.4.ebuild => gitea-1.11.4.ebuild} (54%) delete mode 100644 www-apps/gitea/gitea-1.7.5.ebuild diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest index 5cda178..20f2e8f 100644 --- a/www-apps/gitea/Manifest +++ b/www-apps/gitea/Manifest @@ -7,7 +7,5 @@ AUX gitea.initd-r1 688 BLAKE2B eb2341dee53f3fd92c49137855615d9ae7ca77efc396e2d2e AUX gitea.initd-r3 802 BLAKE2B 2e33e95f7d2762986184d45b0bbb250cc5e04fffc4e4b006233b28e5b57be69eef1d83441adebe2b94681585edaf77f9da4eb97930f91e75c1b1a5cd8d137633 SHA512 5ff2e653180a0601734fcd055dfffdfdc12363736ed2e56c8576c802398b90f4025b44002cbb9a3fd1e0c2d4c169f62d460381c6c549746d3390e55fc1c677d1 AUX gitea.service 472 BLAKE2B 4c728e2987d0c0a86e65d4b9c1a59f6193ff8a3f9b066991a06f495ad1c5586b3497c71fca1cce5b65f167af09343e7bf3215ee5e8fdefa539e384198d2d88d6 SHA512 6666fe3b4cdbb78a58db4a6bf47a15e6be9ab30b666c6eb77a9e8a002d8c0abd510fc75ef463a11ee6892ab12c98943774616072cb64fd9f2fa42ff8f676aa95 AUX gitea.service-r2 734 BLAKE2B 84825b8198e9495e2803ca3702e6a631fb269c5c8fb4ff4246465a5bd7f7d796b0c3eaea72d0a25cef4f5d38d27a6c99a1b6d41f489749bef322a4ac93cfdd12 SHA512 287670f196bf6353dbdeb6ac37b4ac73693e16a6a3a83f57e7179ccb64364d1d85950a2ddd0a77238a3d218afdaacc8ba849c2810a7ba1238c7277074d1ebe39 -DIST gitea-1.7.5.tar.gz 20855842 BLAKE2B 0455b1a467c9323ee0b5f2bb572cd3388bbf9462a28b6b8d1c87f2baab7da15b1be033d43a6c9cade34cb0c03b841fcb3f5fe42d16fb6bf3ce5c6bea72b0983f SHA512 baa917570bdfb4db86e3a2a666ba5e1e3d6fec245ece675f80a2949d15356534a8b82e29ade7c9f5add99d9a132ebf5dbf7405fec6cb07ca8ba83debb846233f -DIST gitea-1.9.4.tar.gz 25355645 BLAKE2B 69a7237f7bc2d6d90054e67faef110c2750cbca927c149f6c6b3394bef113494cda8f670809c4977c6c5e3c4ea7f609240952b262ea6c4a818c11d58945bc5d8 SHA512 a885567ffcc21ef821348be0b698b5f101bfc46b746603679441bee4c6abe34ea062bd0a2d5fb5c029ce26caa3b70a51c6d9088fdccebb44be74f1e523faf711 -EBUILD gitea-1.7.5.ebuild 2012 BLAKE2B 362f2e876cb489cef8f30bd6587f194be57c985159f53df4ea9273f9e764377b35c1173089a1f1b26dcc2eea6931b1fadb594717eda1980d93b88d5c4a2835a6 SHA512 c7ec4ba8b929327a7503ec47f95a3ee6ab4a802e04d545e6dfcfe2f56d8bcfd82bb9dc50e4c121833a97dc98b9f141243f857227e3dba8a79d80a95fe4cc8615 -EBUILD gitea-1.9.4.ebuild 3149 BLAKE2B 17ffc73b72de3f124ab56595f77321b7e0288191a3e3124d0ed319f27e9fb3e23506e8b077ed419420387d83ddda8570e0e9e9aff5c6e49df646a3087dd611de SHA512 1429e89e51953d2012d1c0179e788bfa7762e6ce6ab73e1846eb1f5ac9e84bd07cc387e832208ca126bfb36b7a9cb0b60ecb28717b268d3898cd54ea397ad386 +DIST gitea-1.11.4.tar.gz 28240336 BLAKE2B 89fc609b4f12b0c330a812cd9547fdc86768aaa0f5afbe80a41607ad9d41c6f919cee8e4cc686ffe2f24a5b0834f0f31b4e04a97d05fef044402894838fdd219 SHA512 5b7d07fd02f3acf900f1a3d2d9bb99a94487eaaf148d11a9746b309ee97ffc2d208fd47cc7e121ac0b2a6e97c919ea0232898f7f6851248a8407c706edbc904a +EBUILD gitea-1.11.4.ebuild 3454 BLAKE2B b934ea913f0c367ce1c9eb86cd39bf2f49cfc0198593137c2d1dbe9586033c4496028cc305b85a8bade67d61e039378c3081cf0da3c5488c56e8adaff1366d75 SHA512 3a1563d1837a2d1c9f83d7dd9b895650df849638fb0d04fdc3c6361833eb22e9d9ab711e733ae14ed8722833682b3cc8fa4d87795dcb80e3902be03c530cb9db diff --git a/www-apps/gitea/gitea-1.9.4.ebuild b/www-apps/gitea/gitea-1.11.4.ebuild similarity index 54% rename from www-apps/gitea/gitea-1.9.4.ebuild rename to www-apps/gitea/gitea-1.11.4.ebuild index c8bcd29..ff2e0d9 100644 --- a/www-apps/gitea/gitea-1.9.4.ebuild +++ b/www-apps/gitea/gitea-1.11.4.ebuild @@ -1,53 +1,69 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit golang-vcs-snapshot tmpfiles systemd + +if [[ ${PV} != 9999* ]] ; then + SCM="golang-vcs-snapshot" +else + SCM="git-r3" +fi + +inherit golang-base tmpfiles systemd ${SCM} +unset SCM 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 Apache-2.0 BSD MPL-2.0" +if [[ ${PV} != 9999* ]] ; then + SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64" +else + EGIT_REPO_URI="https://github.com/go-gitea/gitea" + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}" + has test ${FEATURES} && EGIT_MIN_CLONE_TYPE="mirror" +fi + +LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0" SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64" IUSE="+acct pam sqlite" -COMMON_DEPEND=" +BDEPEND="dev-lang/go + >=net-libs/nodejs-10[npm]" +DEPEND="pam? ( sys-libs/pam )" +RDEPEND="${DEPEND} acct? ( acct-group/git acct-user/git[gitea] ) - pam? ( sys-libs/pam )" -DEPEND="${COMMON_DEPEND} - dev-go/go-bindata" -RDEPEND="${COMMON_DEPEND} - dev-vcs/git - acct? ( - !dev-vcs/gitolite - !dev-vcs/gitolite-gentoo - ) - " + dev-vcs/git" DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md ) S="${WORKDIR}/${P}/src/${EGO_PN}" -PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" "${FILESDIR}/gitea-logflags.patch" ) +PATCHES=( "${FILESDIR}/gitea-logflags.patch" ) gitea_make() { - local my_tags=( + local gitea_tags=( bindata $(usev pam) $(usex sqlite 'sqlite sqlite_unlock_notify' '') ) - local my_makeopt=( - DRONE_TAG=${PV} - TAGS="${my_tags[@]}" - LDFLAGS="-extldflags \"${LDFLAGS}\"" + local gitea_settings=( + "-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/gitea/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" ) - GOPATH=${WORKDIR}/${P}:$(get_golibdir_gopath) emake "${my_makeopt[@]}" "$@" + local makeenv=( + TAGS="${gitea_tags[@]}" + LDFLAGS="-extldflags \"${LDFLAGS}\" ${gitea_settings[@]}" + GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" + ) + [[ ${PV} != 9999* ]] && makeenv+=("DRONE_TAG=${PV}") + + env "${makeenv[@]}" emake "$@" } src_prepare() { @@ -79,6 +95,21 @@ src_compile() { gitea_make build } +src_test() { + if has network-sandbox ${FEATURES}; then + einfo "Remove tests which are known to fail with network-sandbox enabled." + rm ./modules/migrations/github_test.go || die + fi + + if [[ ${PV} != 9999* ]] ; then + einfo "Remove tests which depend on gitea git-repo." + rm ./modules/git/blob_test.go || die + rm ./modules/git/repo_test.go || die + fi + + default +} + src_install() { dobin gitea @@ -102,15 +133,3 @@ src_install() { keepdir /var/log/gitea fi } - -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 -} diff --git a/www-apps/gitea/gitea-1.7.5.ebuild b/www-apps/gitea/gitea-1.7.5.ebuild deleted file mode 100644 index 6508562..0000000 --- a/www-apps/gitea/gitea-1.7.5.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -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 - sys-libs/pam -" -RDEPEND=" - dev-vcs/git - sys-libs/pam -" - -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 - elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitea)." - 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 -}