Diff gitolite-gentoo-2.3.1-r1 with a gitolite-gentoo-3.6.6.1-r1

/usr/portage/dev-vcs/gitolite-gentoo/gitolite-gentoo-3.6.6.1-r1.ebuild 2021-02-15 03:39:00.000000000 +0300
1 1
# Copyright 1999-2021 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=5
4
EAPI=6
5
[[ ${PV} == *9999 ]] && SCM="git-2"
6
EGIT_REPO_URI="git://git.gentoo.org/proj/gitolite-gentoo"
7
EGIT_MASTER=master
5 8

  
6
inherit perl-module user
9
inherit perl-module user versionator ${SCM}
7 10

  
8 11
DESCRIPTION="Highly flexible server for git directory version tracker, Gentoo fork"
9 12
HOMEPAGE="https://cgit.gentoo.org/proj/gitolite-gentoo.git"
10
SRC_URI="mirror://gentoo/${P}.tar.bz2"
13
if [[ ${PV} != *9999 ]]; then
14
	SRC_URI="mirror://gentoo/${P}.tar.bz2"
15
	KEYWORDS="~amd64 ~x86"
16
else
17
	SRC_URI=""
18
fi
11 19

  
12 20
LICENSE="GPL-2"
13 21
SLOT="0"
14
KEYWORDS="amd64 x86"
15
IUSE="contrib vim-syntax"
22
IUSE="selinux tools vim-syntax"
16 23

  
17 24
DEPEND="dev-lang/perl
18 25
	virtual/perl-File-Path
......
20 27
	>=dev-vcs/git-1.6.6"
21 28
RDEPEND="${DEPEND}
22 29
	!dev-vcs/gitolite
23
	dev-perl/Net-SSH-AuthorizedKeysFile
24
	vim-syntax? ( app-vim/gitolite-syntax )"
30
	vim-syntax? ( app-vim/gitolite-syntax )
31
	selinux? ( sec-policy/selinux-gitosis )
32
	>=dev-perl/Net-SSH-AuthorizedKeysFile-0.17
33
	dev-perl/JSON"
34

  
35
PATCHES=( )
25 36

  
26 37
pkg_setup() {
27 38
	enewgroup git
28
	enewuser git -1 /bin/bash /var/lib/gitolite git
39
	enewuser git -1 /bin/sh /var/lib/gitolite git
29 40
}
30 41

  
31 42
src_prepare() {
32
	rm Makefile doc/COPYING || die
33
	rm -rf contrib/{gitweb,vim} || die
34

  
35
	echo "${PF}-gentoo" > conf/VERSION
43
	default
44
	echo "${PF}-gentoo" > src/VERSION || die
36 45
}
37 46

  
38 47
src_install() {
39
	local gl_bin="${D}/usr/bin"
40
	gl_bin=${gl_bin/\/\//\/}
48
	local uexec=/usr/libexec/${PN}
41 49

  
42
	dodir /usr/share/gitolite/{conf,hooks} /usr/bin
43

  
44
	export PATH="${gl_bin}:${PATH}"
45
	./src/gl-system-install ${gl_bin} \
46
		"${D}"/usr/share/gitolite/conf "${D}"/usr/share/gitolite/hooks || die
47
	sed -i -e "s:${D}::g" "${D}/usr/bin/gl-setup" \
48
		"${D}/usr/share/gitolite/conf/example.gitolite.rc" || die
49

  
50
	rm "${D}"/usr/bin/*.pm
51
	insinto "${VENDOR_LIB}"
52
	doins src/*.pm
53

  
54
	dodoc README.mkd doc/*
55

  
56
	if use contrib; then
57
		insinto /usr/share/doc/${PF}
58
		doins -r contrib/
50
	rm -rf src/lib/Gitolite/Test{,.pm}
51
	insinto $VENDOR_LIB
52
	doins -r src/lib/Gitolite
53

  
54
	dodoc README.markdown CHANGELOG
55
	# These are meant by upstream as examples, you are strongly recommended to
56
	# customize them for your needs.
57
	dodoc contrib/utils/ipa_groups.pl contrib/utils/ldap_groups.sh
58

  
59
	insopts -m0755
60
	insinto $uexec
61
	doins -r src/{commands,syntactic-sugar,triggers,VREF}/
62
	doins -r contrib/{commands,triggers,hooks}
63

  
64
	insopts -m0644
65
	doins src/VERSION
66

  
67
	exeinto $uexec
68
	doexe src/gitolite{,-shell}
69

  
70
	dodir /usr/bin
71
	for bin in gitolite{,-shell}; do
72
		dosym /usr/libexec/${PN}/${bin} /usr/bin/${bin}
73
	done
74

  
75
	if use tools; then
76
		dobin check-g2-compat convert-gitosis-conf
77
		dobin contrib/utils/rc-format-v3.4
59 78
	fi
60 79

  
61 80
	keepdir /var/lib/gitolite
62 81
	fowners git:git /var/lib/gitolite
63 82
	fperms 750 /var/lib/gitolite
83

  
84
	fperms 0644 ${uexec}/VREF/MERGE-CHECK # It's meant as example only
64 85
}
65 86

  
66 87
pkg_postinst() {
88
	if [[ "$(get_major_version $REPLACING_VERSIONS)" == "2" ]]; then
89
		ewarn
90
		elog "***NOTE*** This is a major upgrade and will likely break your existing gitolite-2.x setup!"
91
		elog "Please read http://gitolite.com/gitolite/migr.html first!"
92
		ewarn
93
		elog "***NOTE*** If you're using the \"umask\" feature of ${PN}-2.x:"
94
		elog "You'll have to replace each \"umask = ...\" option by \"option umask = ...\""
95
		elog "And you'll also have to enable the \"RepoUmask\" module in your .gitolite.rc"
96
		ewarn
97
	fi
98

  
67 99
	# bug 352291
68
	ewarn
69
	elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitolite)."
70
	elog "Especially if you're migrating from gitosis."
71
	ewarn
72
	ewarn
73
	elog "If you use the umask feature and upgrade from <=gitolite-gentoo-1.5.9.1"
74
	elog "then please check the permissions of all repositories using the umask feature"
75
	ewarn
100
	gitolite_home=$(awk -F: '$1 == "git" { print $6 }' /etc/passwd)
101
	if [ -n "${gitolite_home}" -a "${gitolite_home}" != "/var/lib/gitolite" ]; then
102
		ewarn
103
		elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitolite)."
104
		elog "Especially if you're migrating from gitosis."
105
		ewarn
106
	fi
76 107
}
Thank you!