From 3ab8ed6e6221d47ba2089403c4704cab553da222 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 23 Feb 2015 12:58:36 +0100 Subject: [PATCH] added ebuild for dev-vcs/gitlab-shell-2.4.3 --- dev-vcs/gitlab-shell/Manifest | 2 + .../gitlab-shell/gitlab-shell-2.4.3.ebuild | 126 ++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 dev-vcs/gitlab-shell/gitlab-shell-2.4.3.ebuild diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest index 2e17309..94002a5 100644 --- a/dev-vcs/gitlab-shell/Manifest +++ b/dev-vcs/gitlab-shell/Manifest @@ -11,6 +11,7 @@ DIST gitlab-shell-2.3.1.tar.gz 21501 SHA256 4ed5799c685b00840ddb7dbecf87401be3e7 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 DIST gitlab-shell-2.4.2.tar.gz 21864 SHA256 5f366f57562f6cc24aeb904eeec09b47b81eae8aed49caa37ff8216bad33f807 SHA512 bc66ec8afe2d452856f77e3f71ae9641a4ceb1427c0dbc8c2e50b18c0e318a0b7b4ae11f09657cb4552747a82feb3b8cca6800870ad8e096174f362b6a148aae WHIRLPOOL 3053498cc1371223708f10e7805eb3d77bc3f1842acb681e1792137da9983468d0797542e05d45eed82045dc0ace1c8ad5d2a7f94af7ff8f6c5b4e1ae3b7e421 +DIST gitlab-shell-2.4.3.tar.gz 22930 SHA256 16bdda3a3b2fe933c48f74a79a4e604fd28eb7c8d0baea60177dff19ffd7f7ca SHA512 b2884bf4fb329cd0e82233dfd8712ced193d20edd271a980ddf0c9ce8496ae09d9bd14d927876a1075165733c0ab247ab25239a6769d49cf9845a438fddd864c WHIRLPOOL bdb6dd267d94488eb57c690849d7aa60a0c8502319a4c34af477941bfdb3b905566e70f199f1a1ee929ef3c7fb3d176fdbef0b2d3227d85b01e75be6579e385f 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 @@ -22,3 +23,4 @@ EBUILD gitlab-shell-2.3.1.ebuild 3635 SHA256 d7b6f533145bdf67c3b19bfb2e5d330be77 EBUILD gitlab-shell-2.4.0.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 EBUILD gitlab-shell-2.4.1.ebuild 3501 SHA256 7df2653edb6213906f9c51f96b1516029df2bba7fed1b11468b1029e6b3f17bd SHA512 8b647a6b4513631c385f7d0b84f58f6fc4e29409512bcf7ff6a0f10c8b9cb292afa13f5ff6a1c35898a0a3f207866472f3aee1f85f77796648f1fb055281f3bd WHIRLPOOL 20d1c0545db9a11a99e6d81dfee08f39d08759534178c2fcca2a74146954cdd292bb071e53a876905cb7446bbe699b78ef26d7349611221453cfee644cafb561 EBUILD gitlab-shell-2.4.2.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 +EBUILD gitlab-shell-2.4.3.ebuild 3502 SHA256 6c604db35e20522c499f45d5994c421ea08b25313f630af8349441ddae96d757 SHA512 8d492097a53e1314212c263730b5f00f8f53c8d52b1fdc8b6c5d8abed86927f4ff56c2bf04a430dd6aa0b155d4531881d5fbbd7d8948131ec609dc2d7eb41080 WHIRLPOOL 2b491377ffe21cd0706e6c8422e1c5b52530460b08abbc315cb7e172a052f1acfdabc335575b284bd8a9107cc83d4d1411e3afe1294710d4064d14025acf1bb4 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-2.4.3.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-2.4.3.ebuild new file mode 100644 index 0000000..f900aaf --- /dev/null +++ b/dev-vcs/gitlab-shell/gitlab-shell-2.4.3.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}." +}