Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/mschiff:master commit in: dev-vcs/gitlab-shell/, dev-vcs/gitlab-shell/files/
Date: Thu, 22 May 2014 00:45:09
Message-Id: 1400719478.3a85fcba8a5851dbb955b9c552990ca83d5324ad.mschiff@gentoo
1 commit: 3a85fcba8a5851dbb955b9c552990ca83d5324ad
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 22 00:44:38 2014 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Thu May 22 00:44:38 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mschiff.git;a=commit;h=3a85fcba
7
8 bumped gitlab-shell 1.9.3
9
10 ---
11 dev-vcs/gitlab-shell/Manifest | 4 +-
12 .../gitlab-shell-1.7.1-paths-from-config.patch | 21 ----
13 dev-vcs/gitlab-shell/gitlab-shell-1.9.3.ebuild | 122 +++++++++++++++++++++
14 3 files changed, 125 insertions(+), 22 deletions(-)
15
16 diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest
17 index 0a6f8d2..dbdc17f 100644
18 --- a/dev-vcs/gitlab-shell/Manifest
19 +++ b/dev-vcs/gitlab-shell/Manifest
20 @@ -1,4 +1,6 @@
21 -AUX gitlab-shell-1.7.1-paths-from-config.patch 1725 SHA256 b730b953f5cbb7b1c248cf56074832018f78a8bdcc20f2e3869fd30be03b03e4 SHA512 ac214bdcf4d6c63d61914c11d14b24136b4eb0cda4bd09476b58e6bfedfd5a5245a5d20f128d57d05b945afa03fa56f85c4c4df8508767443720596c7beaeddc WHIRLPOOL bed74d3544be5132818a9a42770c9c9775e6b491811ff23eb186f8ea19a86912dbc399c8f92ff7d6c5f951dafd21f4f893495d3d622d5be6af02205ed3b77e06
22 +AUX gitlab-shell-1.7.1-paths-from-config.patch 922 SHA256 90ff8ce300cd2c1b60749aedb4b69fc6cfd2fa9fbe36437a90458d22e02a3801 SHA512 08bfac9d3660abea270ce0192a9af3ba2737a6de86989437b97df03c80ef7ade9c2c5214bbd2bd267840a3bc6f2cbc50d6a09be48cc89ee1c5e5642d320cd4e6 WHIRLPOOL 1f8f3eb978e244d3faf817ff07c047fd5a9aa343b2813154f76b7639cfc1b7c9e7ecff66bc24a0050193796959a992226b0fdb91b9e80ce9f566f62e08c0854f
23 AUX gitlab-shell-1.8.0-redis-db-option.patch 625 SHA256 e707b05a5f81b3769ca8125695617335a9a90eb6ad6b0fd48d99a92f70c235ee SHA512 d5fc946937cb6fcff313c2c620ce24b66c0b6226b298214a36915fa5023ae33f348698ad2505e7e441adc80137dc092dd689d066dac9abbe4261a448ad85f753 WHIRLPOOL fc6365a20089cdb923af210c1f8b825e0bdb7dd539ba272efa224c214237d61bac0d9d0730f8bc9436be16fa874752aba5938e380ab1466f2a3baafaf2bc52cc
24 DIST gitlab-shell-1.8.0.tar.gz 14912 SHA256 ac75e2a5d234f4e64760e2eda5a94c633ec2b31c269deda01e69c6bbc0a25feb SHA512 ab829b597e4610675c773be83035506a97dc623c41f294c94b57fc7351d7985156c5882ba9b1c84d140fe0e0b5c613ab138f8161eee82c4727d049aa39e17efe WHIRLPOOL 72896d55d828d7c9539168391206a908c4a899079eb9bd1461fcdca4947abd806ca91a098d6c4bd67e1f15089636b960704f89285613b86588d039e7b4df4912
25 +DIST gitlab-shell-1.9.3.tar.gz 16186 SHA256 8484554f76aea4443a9de19253a784b0164fd76230e8e1caeb6bf84df1a6a11c SHA512 4d14e731c865528650b134e493ce617b24971a927931c648253f9c3614d72eb21533f63984cb7cfc38a0201e3dfec3c2f5f57d6bd29fe791689548eecd8e9c3b WHIRLPOOL d36a79b3fed631fce5b63808a34ced5210243928209b221c18421f4a4e5af85b3476f74c4b2cbb5379a1c44a29bf7904be704bdcc5180d9d62576e6b76da60da
26 EBUILD gitlab-shell-1.8.0.ebuild 3344 SHA256 85869536daa29d5316a6050bde97d39f707ecaf9078f535f262b35e0e8c509d5 SHA512 0e314f5b32a303b3637d574a89be908fdd756eca1ee257fd12b3722fc5e3bd16624f0c26f90d6522e84d222fcfaa004a92aafbd9a63cf3f1aba91b2575b243a9 WHIRLPOOL 67149f996b6c71e26fd06d6b22ff7f159e1aa46c457b603f873542769631c51b96bbde90b90e0642e0f09f20010a7355591a38bb4e20a36bf99d1c84564e0052
27 +EBUILD gitlab-shell-1.9.3.ebuild 3346 SHA256 4acfe8b86e1d7fe71bf7725f59bb4e6f5e204ea52210d71548a34426c467040f SHA512 958d3900c8a32c637ad9a0fec7344c3886e2029fe4e51334351e527ad2084883d3df4d779580e2d9a72f1ad60506331bb605a1ce0c2951cbe9e6c65193b23421 WHIRLPOOL 0681d593c4288e6caa0943fc0ec8c026e7695a0ac93c055e1c256fd37ad9cadd621c8004aa7d966cf868afa442e64bb67c889414dbd0bd8b0cfa1513f7a46f64
28
29 diff --git a/dev-vcs/gitlab-shell/files/gitlab-shell-1.7.1-paths-from-config.patch b/dev-vcs/gitlab-shell/files/gitlab-shell-1.7.1-paths-from-config.patch
30 index 2f79e10..6ba4967 100644
31 --- a/dev-vcs/gitlab-shell/files/gitlab-shell-1.7.1-paths-from-config.patch
32 +++ b/dev-vcs/gitlab-shell/files/gitlab-shell-1.7.1-paths-from-config.patch
33 @@ -1,24 +1,3 @@
34 ---- a/support/rewrite-hooks.sh 2013-08-26 11:59:22.000000000 +0200
35 -+++ b/support/rewrite-hooks.sh 2013-09-10 21:31:30.135841009 +0200
36 -@@ -1,13 +1,14 @@
37 - #!/bin/bash
38 -
39 - # $1 is an optional argument specifying the location of the repositories directory.
40 --# Defaults to /home/git/repositories if not provided
41 -+# If no argument is provided then path is readed from /etc/gitlab-shell.yml
42 -
43 --home_dir="/home/git"
44 --src=${1:-"$home_dir/repositories"}
45 -+base_path="$(realpath `dirname $(readlink -f "$0")`/..)"
46 -+repos_path="$(ruby -ryaml -e 'puts YAML::load_file("/etc/gitlab-shell.yml")["repos_path"]')"
47 -+src=${1:-"$repos_path"}
48 -
49 - function create_link_in {
50 -- ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update"
51 -+ ln -s -f "$base_path/hooks/update" "$1/hooks/update"
52 - }
53 -
54 - for dir in `ls "$src/"`
55 --- a/support/truncate_repositories.sh 2013-08-26 11:59:22.000000000 +0200
56 +++ b/support/truncate_repositories.sh 2013-09-10 21:31:30.135841009 +0200
57 @@ -1,12 +1,12 @@
58
59 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-1.9.3.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-1.9.3.ebuild
60 new file mode 100644
61 index 0000000..57aecbc
62 --- /dev/null
63 +++ b/dev-vcs/gitlab-shell/gitlab-shell-1.9.3.ebuild
64 @@ -0,0 +1,122 @@
65 +# Copyright 1999-2014 Gentoo Foundation
66 +# Distributed under the terms of the GNU General Public License v2
67 +# $Header: $
68 +
69 +EAPI="5"
70 +
71 +USE_RUBY="ruby19 ruby20"
72 +
73 +inherit eutils ruby-ng user
74 +
75 +DESCRIPTION="SSH access and repository management for GitLab"
76 +HOMEPAGE="https://github.com/gitlabhq/gitlab-shell"
77 +SRC_URI="https://github.com/gitlabhq/gitlab-shell/archive/v${PV}.tar.gz -> ${P}.tar.gz"
78 +
79 +LICENSE="MIT"
80 +SLOT="0"
81 +KEYWORDS="~amd64 ~x86"
82 +IUSE=""
83 +
84 +DEPEND=""
85 +RDEPEND="
86 + dev-vcs/git
87 + dev-db/redis
88 + virtual/ssh"
89 +ruby_add_bdepend "
90 + virtual/ruby-ssl"
91 +
92 +MERGE_TYPE="binary"
93 +
94 +RUBY_PATCHES=(
95 + "${PN}-1.7.1-paths-from-config.patch"
96 + "${PN}-1.8.0-redis-db-option.patch"
97 +)
98 +
99 +GIT_USER="git"
100 +DEST_DIR="/usr/share/${PN}"
101 +DATA_DIR="/var/lib/git"
102 +LOGS_DIR="/var/log/gitlab"
103 +CONF_FILE="/etc/gitlab-shell.yml"
104 +
105 +pkg_setup() {
106 + enewgroup ${GIT_USER}
107 + enewuser ${GIT_USER} -1 /bin/bash ${DATA_DIR} "${GIT_USER}"
108 +
109 + local git_shell=$(egetshell ${GIT_USER})
110 + if [ ! ${git_shell} -ef '/bin/bash' ]; then
111 + ewarn "User ${GIT_USER} already exists, but with the shell ${git_shell}."
112 + ewarn "Changing shell to /bin/bash ..."
113 +
114 + usermod -s /bin/bash ${GIT_USER} \
115 + || die "failed to change login shell for ${GIT_USER}"
116 + fi
117 +}
118 +
119 +all_ruby_prepare() {
120 + # fix paths
121 + sed -i -E \
122 + -e "s|/home/git|${DATA_DIR}|" \
123 + -e "s|[\# ]*(log_file: ).*|\1\"${LOGS_DIR}/gitlab-shell.log\"|" \
124 + config.yml.example || die "failed to filter config.yml.example"
125 +
126 + sed -i \
127 + -e "s|File\.join(ROOT_PATH, 'config.yml')|'${CONF_FILE}'|" \
128 + lib/gitlab_config.rb || die "failed to filter gitlab_config.rb"
129 +}
130 +
131 +all_ruby_install() {
132 + # install lib
133 + insinto ${DEST_DIR}; doins -r lib LICENSE README.md VERSION
134 +
135 + # install scripts
136 + exeinto ${DEST_DIR}/bin; doexe bin/*
137 + exeinto ${DEST_DIR}/hooks; doexe hooks/*
138 + exeinto ${DEST_DIR}/support; doexe support/*
139 +
140 + # create symlinks to bin
141 + local name; for name in $(basename -a bin/gitlab-*); do
142 + dosym "${DEST_DIR}/bin/${name}" "/usr/bin/${name}"
143 + done
144 +
145 + insinto $(dirname ${CONF_FILE})
146 + newins config.yml.example $(basename ${CONF_FILE})
147 +
148 + # prepare directories
149 + diropts -m750; dodir ${DATA_DIR}
150 + diropts -m770; keepdir ${DATA_DIR}/repositories
151 + diropts -m755; dodir ${LOGS_DIR}
152 +
153 + # GitLab stupidly expects that gitlab-shell is in home of git user...
154 + dosym ${DEST_DIR} ${DATA_DIR}/gitlab-shell
155 +
156 + # fix permissions
157 + fowners -R ${GIT_USER}:${GIT_USER} ${DATA_DIR} ${LOGS_DIR}
158 +}
159 +
160 +pkg_postinst() {
161 + # check git home directory
162 + local git_home=$(egethome ${GIT_USER})
163 + if [ ! "${git_home}" -ef ${DATA_DIR} ]; then
164 + ewarn "An authorized_keys is configured to be inside ${DATA_DIR}/.ssh,"
165 + ewarn "but HOME of ${GIT_USER} user is located in ${git_home}. You must"
166 + ewarn "either change the authorized_keys location in ${CONF_FILE},"
167 + ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}"
168 + ewarn "and move ${git_home}/.ssh here."
169 + ewarn
170 + fi
171 +
172 + local auth_dir="${git_home}/.ssh"
173 +
174 + elog "Initializing authorized_keys file in ${auth_dir}"
175 + mkdir -p ${auth_dir}
176 + touch ${auth_dir}/authorized_keys
177 + chmod -R u=rwX,go=- ${auth_dir}
178 + chown -R ${GIT_USER}:${GIT_USER} ${auth_dir}
179 +
180 + elog
181 + elog "GitLab Shell was initialized. Repositories are located in"
182 + elog "${DATA_DIR}/repositories, scripts in ${DEST_DIR}/bin."
183 + elog "All gitlab-* scripts was symlinked to /usr/bin to be on your path."
184 + elog
185 + elog "You should change your gitlab_url in: ${CONF_FILE}."
186 +}