Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-util/mottainai-server: Pin to develop-20201018 #586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions dev-util/mottainai-server/mottainai-server-0.0_pre20201018.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

EGO_PN="github.com/MottainaiCI/${PN}"
S="${WORKDIR}/${P}/src/${EGO_PN}"

if [[ ${PV} == *9999 ]]; then
inherit golang-vcs
else
#SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
#inherit golang-vcs-snapshot
RESTRICT="mirror"
inherit golang-vcs git-r3
EGIT_REPO_URI="https://${EGO_PN}"
EGIT_COMMIT="ce5b031d119b6407070cfbc93c4740e46be44b0b"
EGIT_CHECKOUT_DIR="${S}"
EGIT_BRANCH="develop"
fi

inherit golang-build systemd user
DESCRIPTION="Distributed Task Build Service"
HOMEPAGE="https://mottainaici.github.com/"

LICENSE="GPL-3"
SLOT="0"
IUSE="systemd lxd"

DEPEND="lxd? ( app-emulation/lxd )"
RDEPEND="dev-vcs/git"

pkg_setup() {
enewgroup mottainai
enewuser mottainai-server -1 -1 "/var/lib/mottainai/" "mottainai"
}

src_compile() {
use lxd && EGO_BUILD_FLAGS="-tags lxd"

golang-build_src_compile
}

src_install() {
local LIB_DIR="/var/lib/mottainai/"
local SRV_DIR="/srv/mottainai"

use systemd && systemd_dounit "${S}/contrib/systemd/mottainai-server.service"

dodir /etc/mottainai
insinto /etc/mottainai
newins "${S}/contrib/config/mottainai-server.yaml.example" "mottainai-server.yaml"

dodir "${LIB_DIR}"
insinto "${LIB_DIR}"

cp -R templates "${ED}${LIB_DIR}" || die
cp -R public "${ED}${LIB_DIR}" || die
fowners -R mottainai-server:mottainai "${LIB_DIR}"
fperms -R 770 "${LIB_DIR}"
fperms -R 770 "${LIB_DIR}/templates"
fperms -R 774 "${LIB_DIR}/public"

dodir "${SRV_DIR}/web"
dodir "${SRV_DIR}/web/artefact"
dodir "${SRV_DIR}/web/namespace"
dodir "${SRV_DIR}/web/storage"
dodir "${SRV_DIR}/web/db"
dodir "${SRV_DIR}/lock"

fowners -R mottainai-server:mottainai "${SRV_DIR}"
fperms -R 774 "${SRV_DIR}"

dobin mottainai-server
}