Gentoo Archives: gentoo-commits

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