Commit 8a0bf40e authored by root's avatar root

Added new files.

parent 43b95b11
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitaly.git"
EGIT_COMMIT="v${PV}"
USE_RUBY="ruby25"
inherit eutils git-2 user ruby-single
DESCRIPTION="Gitaly is a Git RPC service for handling all the git calls made by GitLab."
HOMEPAGE="https://gitlab.com/gitlab-org/gitaly"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm"
RESTRICT="network-sandbox"
DEPEND=">=dev-lang/go-1.10.0
dev-libs/icu
dev-ruby/bundler
dev-util/cmake
${RUBY_DEPS}"
RDEPEND="${DEPEND}"
src_prepare()
{
sed -s 's#^socket_path = .*#socket_path = "/opt/gitlabhq/tmp/sockets/gitaly.socket"#' -i "config.toml.example" || die
sed -s 's#^path = .*#path = "/var/lib/git/repositories"#' -i "config.toml.example" || die
sed -s 's#^dir = "/home/git/gitaly/ruby"#dir = "/var/lib/gitlab-gitaly/ruby"#' -i "config.toml.example" || die
sed -s 's#^dir = "/home/git/gitlab-shell"#dir = "/var/lib/gitlab-shell"#' -i "config.toml.example" || die
sed -s 's#^bin_dir = "/home/git/gitaly"#bin_dir = "/usr/bin"#' -i "config.toml.example" || die
# See https://gitlab.com/gitlab-org/gitaly/issues/493
sed -s 's#LDFLAGS#GO_LDFLAGS#g' -i Makefile || die
# Fix compiling of nokogumbo, see
# https://github.com/rubys/nokogumbo/issues/40#issuecomment-182667202
pushd ruby
bundle config build.nokogumbo --with-ldflags='-Wl,--undefined'
popd
}
find_files()
{
for f in $(find ${ED}${1} -type f) ; do
echo $f | sed "s#${ED}##"
done
}
src_install()
{
# Cleanup unneeded temp/object/source files
find ruby/vendor -name '*.[choa]' -delete
find ruby/vendor -name '*.[ch]pp' -delete
find ruby/vendor -iname 'Makefile' -delete
# Other cleanup candidates: a.out *.bin
into "/usr" # This will install the binary to /usr/bin. Don't specify the "bin" folder!
newbin "gitaly" "gitlab-gitaly"
dobin "gitaly-ssh"
insinto "/var/lib/gitlab-gitaly"
doins -r "ruby"
fperms 0755 /var/lib/gitlab-gitaly/ruby/git-hooks/gitlab-shell-hook
# If we are using wildcards, the shell fills them without prefixing ${ED}. Thus
# we would target a file list from the real system instead from the sandbox which
# results in errors if the system has other files than the sandbox.
for bin in $(find_files /var/lib/gitlab-gitaly/ruby/bin) ; do
fperms 0755 $bin
done
for hook in $(find_files /var/lib/gitlab-gitaly/ruby/gitlab-shell/hooks) ; do
fperms 0755 $hook
done
for bin in $(find_files "/var/lib/gitlab-gitaly/ruby/vendor/bundle/ruby/*/bin") ; do
fperms 0755 $bin
done
insinto "/etc/gitaly"
newins "config.toml.example" "config.toml"
}
# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitlab-shell.git"
EGIT_COMMIT="v${PV}"
USE_RUBY="ruby25"
inherit eutils git-2 ruby-ng user
DESCRIPTION="GitLab Shell is a free SSH access and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlab-shell"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm"
RESTRICT="network-sandbox"
DEPEND="$(ruby_implementations_depend)
dev-vcs/git
virtual/ssh
dev-db/redis"
RDEPEND="${DEPEND}"
GIT_USER="git"
GIT_GROUP="git"
DEST_DIR="/var/lib/${PN}"
RAILS_ENV=${RAILS_ENV:-production}
RUBY=${RUBY:-$USE_RUBY}
BUNDLE="${RUBY} /usr/bin/bundle"
REDIS_URL="unix:/var/run/redis/redis.sock"
pkg_setup() {
HOME=$(if [ -n "$(getent passwd git | cut -d: -f6)" ]; then (getent passwd git | cut -d: -f6); else (echo /var/lib/git); fi)
REPO_DIR="${HOME}/repositories"
AUTH_FILE="${HOME}/.ssh/authorized_keys"
KEY_DIR=$(dirname "${AUTH_FILE}")
enewgroup ${GIT_GROUP}
enewuser ${GIT_USER} -1 -1 "${HOME}" ${GIT_GROUP}
}
all_ruby_unpack() {
git-2_src_unpack
}
each_ruby_prepare() {
einfo $(pwd)
cp config.yml.example config.yml
sed -i \
-e "s|\(user:\).*|\1 ${GIT_USER}|" \
-e "s|\(repos_path:\).*|\1 \"${REPO_DIR}\"|" \
-e "s|\(auth_file:\).*|\1 \"${AUTH_FILE}\"|" \
config.yml || die "failed to filter config.yml"
}
each_ruby_compile() {
einfo "Running \"bundle install\" ..."
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
${BUNDLE} install --path vendor/bundle || die "failed to run bundle install"
ruby_version=$(ls $PWD/vendor/bundle/ruby)
export PATH=$PWD/vendor/bundle/ruby/$ruby_version/bin:$PATH
./bin/compile || die "failed to run ./bin/compile"
}
each_ruby_install() {
rm -Rf .git .gitignore go_build
insinto ${DEST_DIR}
touch gitlab-shell.log
doins -r . || die
dosym ${DEST_DIR}/bin/gitlab-keys /usr/bin/gitlab-keys || die
dosym ${DEST_DIR}/bin/gitlab-shell /usr/bin/gitlab-shell || die
dosym ${DEST_DIR}/bin/check /usr/bin/gitlab-check || die
for bin in $(ls bin) ; do
fperms 0755 ${DEST_DIR}/bin/${bin} || die
done
fperms 0755 ${DEST_DIR}/hooks/post-receive || die
fperms 0755 ${DEST_DIR}/hooks/pre-receive || die
fperms 0755 ${DEST_DIR}/hooks/update || die
fowners ${GIT_USER} ${DEST_DIR}/gitlab-shell.log
fowners ${GIT_USER} ${DEST_DIR} || die
}
pkg_postinst() {
dodir "${REPO_DIR}" || die
if [[ ! -d "${KEY_DIR}" ]] ; then
mkdir "${KEY_DIR}" || die
chmod 0700 "${KEY_DIR}" || die
chown ${GIT_USER}:${GIT_GROUP} "${KEY_DIR}" -R || die
fi
if [[ ! -e "${AUTH_FILE}" ]] ; then
touch "${AUTH_FILE}" || die
chmod 0600 "${AUTH_FILE}" || die
chown ${GIT_USER}:${GIT_GROUP} "${AUTH_FILE}" || die
fi
if [[ ! -d "${REPO_DIR}" ]] ; then
mkdir "${REPO_DIR}"
chmod ug+rwX,o-rwx "${REPO_DIR}" -R || die
chmod ug-s,o-rwx "${REPO_DIR}" -R || die
chown ${GIT_USER}:${GIT_GROUP} "${REPO_DIR}" -R || die
fi
elog "Copy ${DEST_DIR}/config.yml.example to ${DEST_DIR}/config.yml"
elog "and edit this file in order to configure your GitLab-Shell settings."
}
File mode changed from 100755 to 100644
This diff is collapsed.
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitlab-workhorse.git"
EGIT_COMMIT="v${PV}"
inherit eutils git-2 user
DESCRIPTION="Handles slow HTTP requests for GitLab"
HOMEPAGE="https://about.gitlab.com/gitlab-workhorse/"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm"
RESTRICT="network-sandbox"
DEPEND=">=dev-lang/go-1.10.0"
RDEPEND="${DEPEND}"
src_install()
{
into "/usr"
dobin "gitlab-workhorse"
dobin "gitlab-zip-cat"
dobin "gitlab-zip-metadata"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment