From 35f7773afe07b6c2546d4c9a5bde52361d212d47 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 26 Jan 2015 19:02:23 +0100 Subject: [PATCH] added ebuild for gitlab-shell-2.4.1 --- dev-vcs/gitlab-shell/Manifest | 2 + .../gitlab-shell/gitlab-shell-2.4.1.ebuild | 126 ++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 dev-vcs/gitlab-shell/gitlab-shell-2.4.1.ebuild diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest index f2a0669..548240f 100644 --- a/dev-vcs/gitlab-shell/Manifest +++ b/dev-vcs/gitlab-shell/Manifest @@ -9,6 +9,7 @@ DIST gitlab-shell-2.0.0.tar.gz 19880 SHA256 da6caeca56889464055edf13e7617a4c4c85 DIST gitlab-shell-2.0.1.tar.gz 19905 SHA256 5a10be90c02dfc05e32943c08c556fff3f1175af41e9fd09bade644e655da7f4 SHA512 381b71001526530d6fdba02abefbd812d9b1ad338bedc8599ce632bde20665a9c07df22c81634a505d8b6e71cf5b5824fa6f1219ac4789c05d3a99e52d972c24 WHIRLPOOL 5ba43a9b94e0e4822b6050ec493ad07bb93ad278b3fa204b792bddf186c22da4b1663fb58627f4ed9fa9d793e6f97ac0b45a6cacab9c56794283af1071c967ed DIST gitlab-shell-2.3.1.tar.gz 21501 SHA256 4ed5799c685b00840ddb7dbecf87401be3e75454424dde5d3a99c07a76b033aa SHA512 b456fe85dae428f7626bab78dcda64e842f29a12238cbf214b7f21f97d9ab3b2e9b2fa78257ff01c97f1576fc28fbdb3f7db5f33fbbdfb9b72371b8850632190 WHIRLPOOL 8acc8af2ad87e0d83fd53c6985b61004323c3fde3b11e6e8379b9e8d6a05f069133540dfd60051e5dab8ca0357a57b4815d685d9a550196e1e14a2a91b1da6f2 DIST gitlab-shell-2.4.0.tar.gz 21760 SHA256 31629b085794312c90757340ec2cbf2a5c760b98e72fc0e75d5989aa82ce2184 SHA512 9849c44d907ca13647bd4ec8fd1ad889abf957b8be4e0b902eb6e380ab5586a5d595db7821b0fb37381a03aad439171dd37f70da99492ced2643fc9b4e317d43 WHIRLPOOL 2bcfa1a62754fd3776fe1ea4cb4344d34baa065a6717b6418b25ac5095ae2160f55c6d2bbb525e6101553288883b84a8c7d153ffd0cbaef1d0a582cbf6e3ff70 +DIST gitlab-shell-2.4.1.tar.gz 21776 SHA256 9b656a8662b1e8d95e30470209c613d6a7b4f9bb6141185fa6013934f56a3d8d SHA512 1afcbb45e2b4fb39eac2903d28614ea101bd52b9032d2cd59ec9c60f005a9991dd1cfbfd4cae2444d05e63fe2f08b931e95f95edb41ee933825290b6faf9aa64 WHIRLPOOL 56725a5732d3be5e429504137073ff24e5f0bc5181b2615b38a6ff6eacb62b607e03c42c87bfae6515d625c102fb99b4d64c27ae2f91d1291d89c6d2e7c9cc30 EBUILD gitlab-shell-1.9.3.ebuild 3381 SHA256 c62f0c0d33d004fadbc8172254ca61a04b921cad4fb21228284502ce79dbf983 SHA512 de85888a48e18210c0b3b5ce6bd36c9473e5c0d592c8657fea9c56856661cc261a3542b6cdcc4277a52d810265c73098ec81045abf2e5d33970a3116125b7719 WHIRLPOOL acf3fdedb73b8ecf025cad85bfd1503b8de796d6bc4d5c37a2ac371c4cd94c777f868cf514f201909ea660de8f6fecc02d177254764ba25ac3b75d8e5804b332 EBUILD gitlab-shell-1.9.4.ebuild 3341 SHA256 6947af19aeb95a832fc2fc7a82b021afe5a4fb3897c37cde62929125ae31f471 SHA512 ad20f6df96a12aa5afa2a659f92889a39bdd7f8a9dee8df6362d90a41e982d7d49162adc44a2d20fbd9a739f2a11dfd440fd89a611bb580d423198f0baa53578 WHIRLPOOL eca0e2d014bcc81655cec619515ad4fc3efd83a9375042a75ae5a03b048c6ea5f56f4291d30a94de9ca6fc5bdef4910ffef87d063b09f10f50b084569c629695 EBUILD gitlab-shell-1.9.6.ebuild 3341 SHA256 6947af19aeb95a832fc2fc7a82b021afe5a4fb3897c37cde62929125ae31f471 SHA512 ad20f6df96a12aa5afa2a659f92889a39bdd7f8a9dee8df6362d90a41e982d7d49162adc44a2d20fbd9a739f2a11dfd440fd89a611bb580d423198f0baa53578 WHIRLPOOL eca0e2d014bcc81655cec619515ad4fc3efd83a9375042a75ae5a03b048c6ea5f56f4291d30a94de9ca6fc5bdef4910ffef87d063b09f10f50b084569c629695 @@ -18,3 +19,4 @@ EBUILD gitlab-shell-2.0.1.ebuild 3304 SHA256 35c085cd702149462fafe0bdfdb41ab244f EBUILD gitlab-shell-2.3.1-r1.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 EBUILD gitlab-shell-2.3.1.ebuild 3635 SHA256 d7b6f533145bdf67c3b19bfb2e5d330be77077939d2b75bff73d056c29645dd6 SHA512 b3f1690327682a30fbe166e38ec49171fedec22127db1555195271e4ed949238ad6d1b186dcb4d7a9c31f5c44ad60663e68efb0adfd29f1b9d6e18f58b260954 WHIRLPOOL 2a24f5a92d4a2495b8d4dd7a4182c869e32def571b2e74450659017256be08c02f4a9fa6ff8523c819391b8204aebbac41ecb6d8f5e4198168a34f10348cd73a EBUILD gitlab-shell-2.4.0.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 +EBUILD gitlab-shell-2.4.1.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-2.4.1.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-2.4.1.ebuild new file mode 100644 index 0000000..f900aaf --- /dev/null +++ b/dev-vcs/gitlab-shell/gitlab-shell-2.4.1.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-6/.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}." +}