a better ebuild for gitlab-shell-1.8.0 is available in the cvut overlay at https://github.com/cvut/gentoo-overlay

This commit is contained in:
Manuel Friedli 2014-02-19 18:47:34 +01:00
parent a0aa07b994
commit cb9f94c11e
3 changed files with 0 additions and 162 deletions

View File

@ -1,3 +0,0 @@
AUX gitlab-shell-1.8.0-paths-from-config.patch 1725 SHA256 b730b953f5cbb7b1c248cf56074832018f78a8bdcc20f2e3869fd30be03b03e4 SHA512 ac214bdcf4d6c63d61914c11d14b24136b4eb0cda4bd09476b58e6bfedfd5a5245a5d20f128d57d05b945afa03fa56f85c4c4df8508767443720596c7beaeddc WHIRLPOOL bed74d3544be5132818a9a42770c9c9775e6b491811ff23eb186f8ea19a86912dbc399c8f92ff7d6c5f951dafd21f4f893495d3d622d5be6af02205ed3b77e06
DIST gitlab-shell-1.8.0.tar.gz 14912 SHA256 ac75e2a5d234f4e64760e2eda5a94c633ec2b31c269deda01e69c6bbc0a25feb SHA512 ab829b597e4610675c773be83035506a97dc623c41f294c94b57fc7351d7985156c5882ba9b1c84d140fe0e0b5c613ab138f8161eee82c4727d049aa39e17efe WHIRLPOOL 72896d55d828d7c9539168391206a908c4a899079eb9bd1461fcdca4947abd806ca91a098d6c4bd67e1f15089636b960704f89285613b86588d039e7b4df4912
EBUILD gitlab-shell-1.8.0.ebuild 3548 SHA256 e633136ce4176d50f70a10d1ac0b074991730d7050bcb199b795732f2f34a777 SHA512 e5c60c2d8ffae16523a954f34f945e039beeaa94f81a8e3506088eff47d6d9fd78af4d8638e64ec4e26bf01ba3b92e4ea0a3a63e3daf2d3cfbbd5a2a8bbbc74b WHIRLPOOL d4d4f9405b0a9abe974bc22f8002e85844b8e4302322bd9fadb748c8644f83e4d82b595a0ba67d49d7c69d061b876dae40a7109b6c551340f9afa51c7f162efb

View File

@ -1,39 +0,0 @@
--- a/support/rewrite-hooks.sh 2013-08-26 11:59:22.000000000 +0200
+++ b/support/rewrite-hooks.sh 2013-09-10 21:31:30.135841009 +0200
@@ -1,13 +1,14 @@
#!/bin/bash
# $1 is an optional argument specifying the location of the repositories directory.
-# Defaults to /home/git/repositories if not provided
+# If no argument is provided then path is readed from /etc/gitlab-shell.yml
-home_dir="/home/git"
-src=${1:-"$home_dir/repositories"}
+base_path="$(realpath `dirname $(readlink -f "$0")`/..)"
+repos_path="$(ruby -ryaml -e 'puts YAML::load_file("/etc/gitlab-shell.yml")["repos_path"]')"
+src=${1:-"$repos_path"}
function create_link_in {
- ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update"
+ ln -s -f "$base_path/hooks/update" "$1/hooks/update"
}
for dir in `ls "$src/"`
--- a/support/truncate_repositories.sh 2013-08-26 11:59:22.000000000 +0200
+++ b/support/truncate_repositories.sh 2013-09-10 21:31:30.135841009 +0200
@@ -1,12 +1,12 @@
#!/bin/bash
-home_dir="/home/git"
+repos_path="$(ruby -ryaml -e 'puts YAML::load_file("/etc/gitlab-shell.yml")["repos_path"]')"
echo "Danger!!! Data Loss"
while true; do
- read -p "Do you wish to delete all directories (except gitolite-admin.git) from $home_dir/repositories/ (y/n) ?: " yn
+ read -p "Do you wish to delete all directories (except gitolite-admin.git) from $repos_path (y/n) ?: " yn
case $yn in
- [Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
+ [Yy]* ) sh -c "find $repos_path/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac

View File

@ -1,120 +0,0 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
USE_RUBY="ruby19 ruby20"
inherit eutils ruby-ng user
DESCRIPTION="SSH access and repository management for GitLab"
HOMEPAGE="https://github.com/gitlabhq/gitlab-shell"
SRC_URI="https://github.com/gitlabhq/gitlab-shell/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="
dev-vcs/git
virtual/ssh"
ruby_add_bdepend "
virtual/ruby-ssl"
MERGE_TYPE="binary"
RUBY_PATCHES=(
"${P}-paths-from-config.patch"
)
GIT_USER="git"
DEST_DIR="/usr/share/${PN}"
DATA_DIR="/var/lib/git"
LOGS_DIR="/var/log/gitlab"
CONF_FILE="/etc/gitlab-shell.yml"
pkg_setup() {
enewgroup ${GIT_USER}
enewuser ${GIT_USER} -1 /bin/bash ${DATA_DIR} "${GIT_USER}"
# who knows, perhaps the user "git" already exists, but with wrong home dir or shell ... perform some checks
local thehomedir=$(egethome "${GIT_USER}")
local theshell=$(egetshell "${GIT_USER}")
if [[ "${thehomedir}" != "${DATA_DIR}" ]] ; then
ewarn "User ${GIT_USER} exists and has home directory ${thehomedir}, but ${DATA_DIR} is required."
ewarn "Please adjust the home directory by hand after the installation!"
fi
if [[ "${theshell}" != "/bin/bash" ]] ; then
ewarn "User ${GIT_USER} exists and has shell ${theshell}, but /bin/bash is required."
ewarn "Please adjust the shell by hand after the installation!"
fi
}
all_ruby_prepare() {
# fix paths
sed -i -E \
-e "s|/home/git|${DATA_DIR}|" \
-e "s|[\# ]*(log_file: ).*|\1\"${LOGS_DIR}/gitlab-shell.log\"|" \
config.yml.example || die "failed to filter config.yml.example"
sed -i \
-e "s|File\.join(ROOT_PATH, 'config.yml')|'${CONF_FILE}'|" \
lib/gitlab_config.rb || die "failed to filter gitlab_config.rb"
}
all_ruby_install() {
# install lib
insinto ${DEST_DIR}; doins -r lib LICENSE README.md VERSION
# install scripts
exeinto ${DEST_DIR}/bin; doexe bin/*
exeinto ${DEST_DIR}/hooks; doexe hooks/*
exeinto ${DEST_DIR}/support; doexe support/*
# create symlinks to bin
local name; for name in $(basename -a bin/gitlab-*); do
dosym "${DEST_DIR}/bin/${name}" "/usr/bin/${name}"
done
insinto $(dirname ${CONF_FILE})
newins config.yml.example $(basename ${CONF_FILE})
# prepare directories
diropts -m750; dodir ${DATA_DIR}
diropts -m770; keepdir ${DATA_DIR}/repositories
diropts -m755; dodir ${LOGS_DIR}
# GitLab stupidly expects that gitlab-shell is in home of git user...
dosym ${DEST_DIR} ${DATA_DIR}/gitlab-shell
# fix permissions
fowners -R ${GIT_USER}:${GIT_USER} ${DATA_DIR} ${LOGS_DIR}
}
pkg_postinst() {
# check git home directory
local git_home=$(getent passwd ${GIT_USER} | cut -d: -f6)
if [ ! "${git_home}" -ef ${DATA_DIR} ]; then
ewarn "An authorized_keys is configured to be inside ${DATA_DIR}/.ssh,"
ewarn "but HOME of ${GIT_USER} user is located in ${git_home}. You must"
ewarn "either change authorized_keys location in ${CONF_FILE},"
ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}."
ewarn
fi
local auth_dir="${git_home}/.ssh"
elog "Initializing authorized_keys file in ${auth_dir}"
mkdir -p ${auth_dir}
touch ${auth_dir}/authorized_keys
chmod -R u=rwX,go=- ${auth_dir}
chown -R ${GIT_USER}:${GIT_USER} ${auth_dir}
elog
elog "GitLab Shell was initialized. Repositories are located in"
elog "${DATA_DIR}/repositories, scripts in ${DEST_DIR}/bin."
elog "All gitlab-* scripts was symlinked to /usr/bin to be on your path."
elog
elog "You should change your gitlab_url in: ${CONF_FILE}."
}