Added ebuild for Gitlab 9.0.7

This commit is contained in:
Manuel Friedli 2017-05-25 10:55:56 +02:00
parent edac9c536d
commit 3a87beb3ef
2 changed files with 425 additions and 0 deletions

View file

@ -21,12 +21,14 @@ DIST gitlab-ce-8.17.4.tar.gz 22825573 SHA256 daa0d5d75295a896f7aa230bd965e12e852
DIST gitlab-ce-9.0.0_rc4.tar.gz 26270878 SHA256 f47ddcf6f4f0336228dd1ef03085c9ea6116157887e8216038d23b69cf7a4d89 SHA512 f4694ebf4ffe38e6c5495f3658eb8003d28b3ac5d67f4533ddc1932afca412a40ea786cd8d99e2891fdf9bacd7b198b29493b97d6d02455d4f4139d4e60a0d63 WHIRLPOOL 81f47820043445e9ff69ae0ad3bcd1e094ab1e3527eec279096ae16a767cec5451b2d94af4dd87cd2939eb2e64368a1a0e543ce40e0e9fd5a716eeef04741c54
DIST gitlab-ce-9.0.1.tar.gz 26350693 SHA256 94549d69650383347256b9f3f0c11f200e0e4f29118a54a99e137d895db083ed SHA512 b7eed360beab1459da5c56b911e527335f2ec7bf595649c8d0327255488d765971a612987d7b3d10f2b017bf93adfb52f739a20c6d3e251552d82f04ddcf1bea WHIRLPOOL e061946cf9831daa61809b14d71e907717e0840cc8263b5461813795871cd2bd479ddff0d3c4afeda06edfca9f819c333e0be1a0961a1dbf9c86c9d8e0315ee1
DIST gitlab-ce-9.0.2.tar.gz 26349628 SHA256 2b8913a1ed5f49c59314ce1aa5874d917d38c3c663a981aac3374ced8a123629 SHA512 563450eb22dc2eb7d8aec52b7fb2ec58339bf59f0b46e59fa2a98ff8e2634d95948b9872afc1e64bff840985ed15b8efd588661f075c27cdb984c125ea41624e WHIRLPOOL 3660dde5cadb279f48d2c43e4fb3ba47b7d7a07c38e25940d55b8cb8bf4d750ca97088db73d1f808b3ff5ef8b3867d45ec0289e1ff1e0c5e362994ed38fc9eb9
DIST gitlab-ce-9.0.7.tar.gz 26358937 SHA256 e70d1f3926f3b7e872353da2d21a7a6b44ed51a3b145e237f4768f8190eaeb08 SHA512 c3f28ef81eb546727f895d92a120e1e459b8eceb1c1068888ec9972444355c02d441bd8d85c360e684f0389b0c6f2ffae57a69a220639fa9ffe7f8c63730daad WHIRLPOOL 04380783f5074fcfe905b129e6e457da44e9dbd1d6d43d70309ea0f55fa8f916af28f52460dc68b1b588feb8d99b8ba543e52bffdee93f3115efa3473c8728ce
EBUILD gitlab-ce-8.15.8.ebuild 11982 SHA256 755bfd6fa532a308d3f458db1456f8de4f2c5f599ab76c18653aad9e038d0697 SHA512 9aa439da7dc61687f1cdce5ff693dd1c8c4edc54aaed288ad0368aa1b64d577a7f3752dee149c200c4d98b43a6347c77251cac9f6d3316b5a6d799a17c3ed583 WHIRLPOOL 02393bfd983341632663096e8b293e3611ac5328a58a50a1c7e800e348e866f37aff53ebe447507a84d5966e019265fde94a30716f43b50228437e04abcd932c
EBUILD gitlab-ce-8.16.8.ebuild 11982 SHA256 31537d4a6aeb9ff14ab14c9a27dca51a056e94ee75506ad855a1289f32468694 SHA512 01d536fcfb53a7b39943314a34eeeb9c5b5660604a2fb1a1c2dcd1d7e87d19ab0bbc5bc650feaa1db812047c3783a324d7c8a8bce7dd7381033c3d1ca2e64828 WHIRLPOOL 0f3402e30164ee6d5058c51554cc916d91d5975f438074e3193bf3bdb4e323bca4279c19f00cd7bacd01c2eb6cf13e41a0badabd958e9be58d319224f53403b0
EBUILD gitlab-ce-8.17.4.ebuild 12928 SHA256 f748d42058293ba4f593fbb36be34ecde332d896d04c610fd3b7e91288c18fbb SHA512 3c2736f9b7df066bb105faffef6ce2b6276fe60a686a7462c630a1b7c7c0296d94e33c7ea25a9f24aa814628f318e2430a3e5ca149783c86ef3fb1132dd01877 WHIRLPOOL cd629ba993df3eaef9c9ec1bf1649aa4cfea5f3787d2207a7016c092bff67175d79c6782d643d4c80b3b5971a98858feaa279a184abc4fd936c7e5c8b291dd28
EBUILD gitlab-ce-9.0.0_rc4.ebuild 12910 SHA256 8851160b4454845fb33ce0b9a9dd3e070bed07d3a0e5c5f753c77b0ef301ded0 SHA512 9d109a3ea8fa7a7bb33440b4b21bf988745c4eefb62b834ad88825f3ffa28881eceaf402ec09241b74d91e778258c1a18daae6c86254625af4f54bf6189b32f2 WHIRLPOOL 67aa480b4cf1209a3d7af3bffb1f7f774bf2c6d18bf40960478e13459813ebb9472adc5aec3b84252157b0c3e74f9e7f74cb0d57395983c02ba4c976ffae106f
EBUILD gitlab-ce-9.0.1-r1.ebuild 13083 SHA256 4340c7e3edf6b4aa69693c88f64310dd69c6079c2188dfc6ba891f26c29a5409 SHA512 be832c77b4d60f04e4f328563d30877cec03aea84aaa41daa989c67c0db7ac0a3b91ca2339b07c91785b618b2d3f636566b0625c52134ef06f02c21486e2abdb WHIRLPOOL 30488fba1af1a5892ae06a56a9aa3d7adfa8d7a5afe3dac9f333f98ea4b8557fdbe145cf60ab2d88e6b3fc6477e08c80e1cd554a0888a21a7d5a9d89e1970721
EBUILD gitlab-ce-9.0.2.ebuild 13083 SHA256 7700b86831474e92fe01938f36bf7482c4748aca78a3f5489731810ce1cc66e2 SHA512 a522c6659f927eac589f31a3f392c6a367123a55ef6f887d15440c8e90290f2aa5b9e5beb523a3e06dfad7183a9fad269eb1a88a202721604cc680e040f1d3b4 WHIRLPOOL 94948ab3c1a169a96c6300f212c00a331550d12605422d4327e5d364dfebc799fc6e0e6db7ecc3ddba36da8278cf7e065e919b90a14181e7e2ca68da4f9e81d2
EBUILD gitlab-ce-9.0.7.ebuild 13083 SHA256 df9f2ed4673ffa02cb5345b91ab4a58ff0e37f57c6dbba359232bf5ddde17b83 SHA512 dd1d8079b8de44b2f4f43a93c7bf66cb9ca5156f15a5cb5708f36ce785e241c0298db21b612dad66c9d80383c88f76327b575fc1859774e35aae27b6f6a60680 WHIRLPOOL 5d6f84409e63da3575fecf31d26e3142101177adaacc59855d8aba4aa3ebec55a4f6da4537bbb98445c874695b61288333762f0232071040852d428cc2ac81ee
EBUILD gitlab-ce-9999.ebuild 13025 SHA256 606c38870f5edcb11b2fc99e2b2a4bb045f677cd57c0985e09beabb4fa5591fe SHA512 f4a4c35bc4655908199a6ac9cc2b03c05353a2ca129c50c99fd7063ff5a4008766582ffa131e22cc068b430b01e86e90b0500a6e5721e54142a78f9fc0408e12 WHIRLPOOL db7ef4a9d86c046616c6b94c535851be341a1027765653e33ca3761ca0cc551f8179f1f2ced229b7af7908243ef7b3558c3fad6090458777df5581f9900eb5d5
MISC ChangeLog 17683 SHA256 a05dba61c9719acba11ea9e78ea5b12eb9c605df0fe2a4ad492a2e33bd171bd4 SHA512 b313183f8ebac4786b95e32700835991ae099e1b63bac7ccb7849e9528396393d97f71a77233d991b89017b0dadb54f0a125703d4525d28ec78bf7c70e14ad1d WHIRLPOOL ffedfd7f64939496a8607a99ea845baa410c3579b0d023ff407d4364f8009aad3e982403eabebc9f013dafb6a093ac37454e7f1c07f9b1c4d9c0d5f89aa9f0ad
MISC metadata.xml 801 SHA256 3dc7486a12903f47f65968d524c93500ba30a4a09fa57e5a9dacf356509b44bb SHA512 e132754b72e64246531fa883400a0cf1a473ac5a6a49623db58ccf118a038b7cf37df03d9550f37b4a25f9ddbb1dcc5652ec9a4f2259d8e3ce202692c4025f41 WHIRLPOOL e9d961681fd790008eaf80fa07ce2c55a00a58f2e920d759793783ca8c8f508602a777e94c0cb65fe87c7dbef0cabdf26e4f4082584421097d939cbab20c4ac6

View file

@ -0,0 +1,423 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
# Maintainer notes:
# - This ebuild uses Bundler to download and install all gems in deployment mode
# (i.e. into isolated directory inside application). That's not Gentoo way how
# it should be done, but GitLab has too many dependencies that it will be too
# difficult to maintain them via ebuilds.
#
USE_RUBY="ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="810cc51be37e03ebbe99711a53663956e4ffde8c"
GITALY_VERSION="0.3.0"
GITLAB_PAGES_VERSION="0.4.0"
GITLAB_SHELL_VERSION="5.0.0"
GITLAB_WORKHORSE_VERSION="1.4.2"
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://about.gitlab.com/"
SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz"
RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd pages -gitaly rugged_use_system_libraries"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# rugged dev-util/cmake, virtual/pkgconfig
# json dev-util/ragel
# pygments.rb python 2.7+
# execjs net-libs/nodejs, or any other JS runtime
# pg dev-db/postgresql
# mysql virtual/mysql
#
GEMS_DEPEND="
dev-libs/icu
dev-libs/libxml2
dev-libs/libxslt
dev-util/ragel
>=net-libs/nodejs-4.3.0
>=sys-apps/yarn-0.17.0
postgres? ( >=dev-db/postgresql-9.1:* )
mysql? ( virtual/mysql )
kerberos? ( virtual/krb5 )"
CDEPEND="
dev-util/cmake
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
~dev-vcs/gitlab-shell-${GITLAB_SHELL_VERSION}
>=dev-vcs/git-2.8.4
~dev-vcs/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )
pages? ( ~www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} )
gitaly? ( ~www-servers/gitaly-${GITALY_VERSION} )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
# required bundler >= 1.14.2
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.13.7"
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
# fix-redis-config-path:
# Point to the absolute location of redis_config.rb
#
RUBY_PATCHES=(
"01-${PN}-8.7.5-fix-sendmail-config.patch"
"02-${PN}-9.0.0-fix-redis-config-path.patch"
"03-${PN}-8.17.0-database.yml.patch"
"04-${PN}-8.12.7-fix-check-task.patch"
"05-${PN}-9.0.0-replace-sys-filesystem.patch"
"06-${PN}-8.17.0-fix-webpack-config.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}"
CONF_DIR="/etc/${MY_NAME}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
lib/support/nginx/gitlab || die "failed to filter nginx/gitlab"
# modify default database settings for PostgreSQL
sed -i -E \
-e 's|(username:).*|\1 gitlab|' \
-e 's|(password:).*|\1 gitlab|' \
-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \
config/database.yml.postgresql \
|| die "failed to filter database.yml.postgresql"
# rename config files
mv config/gitlab.yml.example config/gitlab.yml
mv config/unicorn.rb.example config/unicorn.rb
local dbconf=config/database.yml
if use postgres && ! use mysql; then
mv ${dbconf}.postgresql ${dbconf}
rm ${dbconf}.mysql
elif use mysql && ! use postgres; then
mv ${dbconf}.mysql ${dbconf}
rm ${dbconf}.postgresql
fi
# remove useless files
rm -r lib/support/{deploy,init.d}
use unicorn || rm config/unicorn.rb
}
all_ruby_install() {
local dest=${DEST_DIR}
local conf=${CONF_DIR}
local logs=${LOGS_DIR}
local temp=${TEMP_DIR}
# prepare directories
diropts -m750
dodir ${logs} ${temp}
diropts -m755
dodir ${conf} ${dest}/public/uploads
dosym ${temp} ${dest}/tmp
dosym ${logs} ${dest}/log
# install configs
insinto ${conf}
doins -r config/*
dosym ${conf} ${dest}/config
echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile"
# remove needless dirs
rm -Rf config tmp log
# install the rest files
# using cp 'cause doins is slow
cp -Rl * "${D}/${dest}"/
# install logrotate config
dodir /etc/logrotate.d
cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF
${logs}/*.log {
missingok
delaycompress
compress
copytruncate
}
EOF
## Install gems via bundler ##
cd "${D}/${dest}"
local without="development test aws"
local flag; for flag in mysql postgres unicorn kerberos; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
einfo "Cleaning old gems ..."
${RUBY} /usr/bin/bundle clean
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-8.13.3-sidekiq.init
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}"
fi
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
}
pkg_postinst() {
elog "If this is an update from a previous version, stop your GitLab"
elog "instance and issue the following command to perform all required"
elog "migrations:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
elog "before running the config phase. Run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
elog
elog "If this was a fresh install, follow these steps:"
elog
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
elog
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
elog " for \"production\" environment."
elog
elog "3. Then you should create a database for your GitLab instance, if you"
elog " haven't done so already."
elog
if use postgres; then
elog "If you have local PostgreSQL running, just copy&run:"
elog " su postgres"
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
elog " Note: You should change your password to something more random..."
elog
fi
elog "4. Finally execute the following command to initialize the environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
elog "you can't login after the upgrade, be sure to read the section about the"
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
elog "http://goo.gl/5XGRGv."
if use postgres; then
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
elog "super user for *every* GitLab database:"
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
elog "For details, see the documentation at the GitLab website."
fi
if use mysql ; then
ewarn "PLEASE also read this document about needed migrations on MySQL:"
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
ewarn "Failing to follow those instructions may make the config phase fail!"
fi
}
pkg_config() {
einfo "Checking configuration files"
if [ ! -r "${CONF_DIR}/database.yml" ]; then
eerror "Copy ${CONF_DIR}/database.yml.* to"
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
eerror "database settings for \"production\" environment."; die
fi
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
local git_home="$(egethome ${MY_USER})"
# configure Git global settings
if [ ! -e "${git_home}/.gitconfig" ]; then
einfo "Setting git user"
su -l ${MY_USER} -c "
git config --global user.email '${email_from}';
git config --global user.name 'GitLab'" \
|| die "failed to setup git name and email"
fi
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
# determine whether this is an update or a fresh install. we do this by
# checking whether the ${DEST_DIR}/.git directory exists or not
#
if [ -d "${DEST_DIR}/.git" ]; then
local update=true
else
local update=false
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
# FIXME: this line existed in older ebuilds, but the variable is
# never used. what was it for!?
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ "${update}" = 'true' ]; then
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Installing npm modules ..."
exec_yarn install
einfo "Cleaning old precompiled assets ..."
exec_rake gitlab:assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
# create dummy git repo as workaround for
# https://github.com/bundler/bundler/issues/2039
einfo "Initializing dummy git repository to avoid false errors from bundler"
su -l ${MY_USER} -c "
cd ${DEST_DIR}
git init
git add README.md
git commit -m 'Dummy repository'" >/dev/null
einfo "Initializing database ..."
exec_rake gitlab:setup
einfo "Installing npm modules ..."
exec_yarn install
fi
einfo "Precompiling assests ..."
exec_rake gitlab:assets:compile
if [ "${update}" = 'true' ]; then
ewarn
ewarn "This configuration script runs only common migration tasks."
ewarn "Please read guides on"
ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/"
ewarn "for any additional migration tasks specific to your previous GitLab"
ewarn "version."
fi
elog
elog "If you want to make sure that the install/upgrade was successful, start"
elog "Gitlab now and then run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
elog
if ! use systemd ; then
elog "You may also run"
elog " /etc/init.d/gitlab check"
elog " for convenience."
fi
}
ryaml() {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
}
exec_rake() {
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV} NODE_ENV=${RAILS_ENV}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}
exec_yarn() {
local command="yarn $@ --${RAILS_ENV}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
cd ${DEST_DIR}
${command}" \
|| die "failed to run yarn $@"
}