From 9d92dcf28769bd18488943380c27cdfd86ad95eb Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 14 Sep 2015 13:01:42 +0200 Subject: [PATCH] added ebuild for dev-vcs/gitlab-shell-2.6.5 --- dev-vcs/gitlab-shell/Manifest | 2 + .../gitlab-shell/gitlab-shell-2.6.5.ebuild | 126 ++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 dev-vcs/gitlab-shell/gitlab-shell-2.6.5.ebuild diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest index ce70536..7860ddb 100644 --- a/dev-vcs/gitlab-shell/Manifest +++ b/dev-vcs/gitlab-shell/Manifest @@ -5,9 +5,11 @@ DIST gitlab-shell-2.5.4.tar.gz 31787 SHA256 d27d5c5d73724d68af99783f8fc561b93985 DIST gitlab-shell-2.6.2.tar.gz 32108 SHA256 4e9885379af546ad50165f3c95110f130f8a4b2bddfae1a746f225df19960826 SHA512 353a25a391ad6818f631437cbd6735491e7ae61e0184f5ee52a69eb9a1f24354fc7c6752896c91dbf7ff6dd5f9df6ae8cb4cb0f022ac3d838fa693aa5244410a WHIRLPOOL c32642442b3a1d0519aa563261cd353ee8bc2cfc115d868a3179f56d947be0fdbbd3bb6bea8a4b2e1077f8de890b430a534f1135b59e2562d06c41ce0b995db0 DIST gitlab-shell-2.6.3.tar.gz 32152 SHA256 1c5582aa1f5552c2299b186fe12bf1ee5bafcf2bf855ecc193b1ca346d25ae9d SHA512 bac120eef30b7c6c2ee59a0a1063eed3416bc1eaea99df7a61bcb98d2b64528f948944f3daab44af186f9383e740b6746955d2a0425b5e8cebaf0836c853b235 WHIRLPOOL 94b5c3d7ca26601a1bdad19187b2694895ef932b175a1cd3a6295ac3f66f50588120e077c313f7b488ab4ae5b76749c673a4234fee3f85cad82e10c89e2dc436 DIST gitlab-shell-2.6.4.tar.gz 33163 SHA256 27b7d9c73353ed1370c38e75d85f1e6c569de3a2dc45fe684391b6802abd0d29 SHA512 0fe2377e74957b37cd7ab5126551e4cb1e3ac76355883a23ef9bb0b1c100e09aabaad8b27826e9f961bdeae8b6e56fd0d54789804d53d672f069397487aad8ef WHIRLPOOL 3981c346fe14162b9248f20165c4c2014f211dd0066481cf43adae04b173642d8f5eaafd37a328a1fb5e4deceec220e0679b6697d1f01e0a1bf77ca588b64384 +DIST gitlab-shell-2.6.5.tar.gz 33445 SHA256 586092a62b053adf0b046372aa5983b1170446456cd24e63c145460acc927648 SHA512 52f5c1db5b813dcd68183c6ca02e1fa0eb693040d2e6dedbb903743c285feaddd2a2836726228673eb6da99da07fcd04103e9207443b9f4fb42ba6d1bd4e29db WHIRLPOOL f52937b73942bd2064bc4414f9d4c8b34366dac59912ee926347ba02b7d44c28630a8f530beea82c3df5b6b801db5249080269a9a4e2f8daf33c484a3d203754 EBUILD gitlab-shell-2.4.1.ebuild 3501 SHA256 7df2653edb6213906f9c51f96b1516029df2bba7fed1b11468b1029e6b3f17bd SHA512 8b647a6b4513631c385f7d0b84f58f6fc4e29409512bcf7ff6a0f10c8b9cb292afa13f5ff6a1c35898a0a3f207866472f3aee1f85f77796648f1fb055281f3bd WHIRLPOOL 20d1c0545db9a11a99e6d81dfee08f39d08759534178c2fcca2a74146954cdd292bb071e53a876905cb7446bbe699b78ef26d7349611221453cfee644cafb561 EBUILD gitlab-shell-2.4.3.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 EBUILD gitlab-shell-2.5.4.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 EBUILD gitlab-shell-2.6.2.ebuild 3500 SHA256 8de274d1be0c80ad57639ade47a6ca9d4446aed136a8cf75d6d821a3e9c414cf SHA512 10f1720fdcdbf96f95b9c5c5e2d396d49b1012bb7dc41c8cea3d9b9d3add0c7dc9574b47a90790e189e755ca8097c076a92cb279291f7112af1bfe5c6fd15fdd WHIRLPOOL affb0799af07ee36201eb5594296a74eb279d176b1713f6566cec067db5b4749057c5189b291f9fe28d94bb35e1e8e7d5baa6f00915ef9fa220199b3ed2b66c6 EBUILD gitlab-shell-2.6.3.ebuild 3500 SHA256 8de274d1be0c80ad57639ade47a6ca9d4446aed136a8cf75d6d821a3e9c414cf SHA512 10f1720fdcdbf96f95b9c5c5e2d396d49b1012bb7dc41c8cea3d9b9d3add0c7dc9574b47a90790e189e755ca8097c076a92cb279291f7112af1bfe5c6fd15fdd WHIRLPOOL affb0799af07ee36201eb5594296a74eb279d176b1713f6566cec067db5b4749057c5189b291f9fe28d94bb35e1e8e7d5baa6f00915ef9fa220199b3ed2b66c6 EBUILD gitlab-shell-2.6.4.ebuild 3500 SHA256 8de274d1be0c80ad57639ade47a6ca9d4446aed136a8cf75d6d821a3e9c414cf SHA512 10f1720fdcdbf96f95b9c5c5e2d396d49b1012bb7dc41c8cea3d9b9d3add0c7dc9574b47a90790e189e755ca8097c076a92cb279291f7112af1bfe5c6fd15fdd WHIRLPOOL affb0799af07ee36201eb5594296a74eb279d176b1713f6566cec067db5b4749057c5189b291f9fe28d94bb35e1e8e7d5baa6f00915ef9fa220199b3ed2b66c6 +EBUILD gitlab-shell-2.6.5.ebuild 3500 SHA256 8de274d1be0c80ad57639ade47a6ca9d4446aed136a8cf75d6d821a3e9c414cf SHA512 10f1720fdcdbf96f95b9c5c5e2d396d49b1012bb7dc41c8cea3d9b9d3add0c7dc9574b47a90790e189e755ca8097c076a92cb279291f7112af1bfe5c6fd15fdd WHIRLPOOL affb0799af07ee36201eb5594296a74eb279d176b1713f6566cec067db5b4749057c5189b291f9fe28d94bb35e1e8e7d5baa6f00915ef9fa220199b3ed2b66c6 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-2.6.5.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-2.6.5.ebuild new file mode 100644 index 0000000..ef904e0 --- /dev/null +++ b/dev-vcs/gitlab-shell/gitlab-shell-2.6.5.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +USE_RUBY="ruby20 ruby21" + +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 + dev-db/redis + virtual/ssh" +ruby_add_bdepend " + virtual/ruby-ssl" + +MERGE_TYPE="binary" + +RUBY_PATCHES=( + "${PN}-2.0.0-config-paths.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}" + + local git_shell=$(egetshell ${GIT_USER}) + if [ ! ${git_shell} -ef '/bin/bash' ]; then + ewarn "User ${GIT_USER} already exists, but with the shell ${git_shell}." + ewarn "Changing shell to /bin/bash ..." + + usermod -s /bin/bash ${GIT_USER} \ + || die "failed to change login shell for ${GIT_USER}" + 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}) + + # create symlink for .gitlab_shell_secret + einfo "creating symlink for .gitlab_shell_secret" + TOKEN_FILE="${DEST_DIR}/.gitlab_shell_secret" + dosym /opt/gitlab/.gitlab_shell_secret "$TOKEN_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=$(egethome ${GIT_USER}) + 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 the authorized_keys location in ${CONF_FILE}," + ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}" + ewarn "and move ${git_home}/.ssh here." + 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}." +}