Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: xdch47@××××××.de, nemunaire@×××××××.re, idl0r@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH v2 2/5] acct-user/git: Add git user, UID 196
Date: Sat, 17 Aug 2019 20:49:27
Message-Id: 20190817204826.406692-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH v2 1/5] acct-group/git: Add git group, GID 196 by "Michał Górny"
1 Add 'git' user. UID 196 is used on Arch Linux for gitolite which serves
2 the same purpose as 'git' in Gentoo.
3
4 Note that since we have multiple git hosting providers in Gentoo,
5 and they use disjoint home directories, we need to use USE flags to
6 control the provider used. Upon switching flags, the home directory
7 for git user will be updated accordingly to permit SSH access.
8
9 Signed-off-by: Michał Górny <mgorny@g.o>
10 ---
11 acct-user/git/git-0.ebuild | 29 +++++++++++++++++++++++++++++
12 acct-user/git/metadata.xml | 15 +++++++++++++++
13 2 files changed, 44 insertions(+)
14 create mode 100644 acct-user/git/git-0.ebuild
15 create mode 100644 acct-user/git/metadata.xml
16
17 diff --git a/acct-user/git/git-0.ebuild b/acct-user/git/git-0.ebuild
18 new file mode 100644
19 index 000000000000..384b3bd703e6
20 --- /dev/null
21 +++ b/acct-user/git/git-0.ebuild
22 @@ -0,0 +1,29 @@
23 +# Copyright 2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit acct-user
29 +
30 +DESCRIPTION="Git repository hosting user"
31 +
32 +IUSE="gitea gitolite"
33 +REQUIRED_USE="^^ ( gitea gitolite )"
34 +
35 +ACCT_USER_ID=196
36 +ACCT_USER_HOME_OWNER=git:git
37 +ACCT_USER_HOME_PERMS=750
38 +ACCT_USER_SHELL=/bin/sh
39 +ACCT_USER_GROUPS=( git )
40 +
41 +acct-user_add_deps
42 +
43 +pkg_setup() {
44 + if use gitea; then
45 + ACCT_USER_HOME=/var/lib/gitea
46 + elif use gitolite; then
47 + ACCT_USER_HOME=/var/lib/gitolite
48 + else
49 + die "Incorrect USE flag combination"
50 + fi
51 +}
52 diff --git a/acct-user/git/metadata.xml b/acct-user/git/metadata.xml
53 new file mode 100644
54 index 000000000000..159d766b8251
55 --- /dev/null
56 +++ b/acct-user/git/metadata.xml
57 @@ -0,0 +1,15 @@
58 +<?xml version="1.0" encoding="UTF-8"?>
59 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
60 +<pkgmetadata>
61 + <maintainer type="person">
62 + <email>mgorny@g.o</email>
63 + <name>Michał Górny</name>
64 + </maintainer>
65 + <use>
66 + <flag name="gitea">Set home directory for git hosting
67 + via <pkg>www-apps/gitea</pkg>.</flag>
68 + <flag name="gitolite">Set home directory for git hosting
69 + via <pkg>dev-vcs/gitolite</pkg>
70 + or <pkg>dev-vcs/gitolite-gentoo</pkg>.</flag>
71 + </use>
72 +</pkgmetadata>
73 --
74 2.23.0.rc2