From c3708bc21bea076dbb014797e6ae9db88cc216a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 17 Aug 2019 08:31:21 +0200 Subject: [PATCH] acct-user/git: Add git user, UID 196 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add 'git' user. UID 196 is used on Arch Linux for gitolite which serves the same purpose as 'git' in Gentoo. Note that since we have multiple git hosting providers in Gentoo, and they use disjoint home directories, we need to use USE flags to control the provider used. Upon switching flags, the home directory for git user will be updated accordingly to permit SSH access. Signed-off-by: Michał Górny --- acct-user/git/git-0.ebuild | 29 +++++++++++++++++++++++++++++ acct-user/git/metadata.xml | 15 +++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 acct-user/git/git-0.ebuild create mode 100644 acct-user/git/metadata.xml diff --git a/acct-user/git/git-0.ebuild b/acct-user/git/git-0.ebuild new file mode 100644 index 000000000000..384b3bd703e6 --- /dev/null +++ b/acct-user/git/git-0.ebuild @@ -0,0 +1,29 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit acct-user + +DESCRIPTION="Git repository hosting user" + +IUSE="gitea gitolite" +REQUIRED_USE="^^ ( gitea gitolite )" + +ACCT_USER_ID=196 +ACCT_USER_HOME_OWNER=git:git +ACCT_USER_HOME_PERMS=750 +ACCT_USER_SHELL=/bin/sh +ACCT_USER_GROUPS=( git ) + +acct-user_add_deps + +pkg_setup() { + if use gitea; then + ACCT_USER_HOME=/var/lib/gitea + elif use gitolite; then + ACCT_USER_HOME=/var/lib/gitolite + else + die "Incorrect USE flag combination" + fi +} diff --git a/acct-user/git/metadata.xml b/acct-user/git/metadata.xml new file mode 100644 index 000000000000..159d766b8251 --- /dev/null +++ b/acct-user/git/metadata.xml @@ -0,0 +1,15 @@ + + + + + mgorny@gentoo.org + Michał Górny + + + Set home directory for git hosting + via www-apps/gitea. + Set home directory for git hosting + via dev-vcs/gitolite + or dev-vcs/gitolite-gentoo. + + -- 2.26.2