Merge branch 'gitlab-prune-old-versions' into 'master'

Gitlab prune old versions

See merge request !130
This commit is contained in:
Manuel Friedli 2016-11-23 18:05:38 +01:00
commit bcd5a750ca
18 changed files with 20 additions and 2083 deletions

View File

@ -1,3 +1,7 @@
23 Nov 2016; Manuel Friedli <manuel@fritteli.ch> -gitlab-shell-3.5.0.ebuild,
-gitlab-shell-3.6.1.ebuild:
dev-vcs/gitlab-shell: pruned old ebuilds
*gitlab-shell-4.0.0 (11 Nov 2016)
11 Nov 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-shell-4.0.0.ebuild:

View File

@ -1,11 +1,7 @@
AUX gitlab-shell-3.2.0-config-paths.patch 1826 SHA256 c83db7c37dcac577ce499eab4bb0168253f49d303ba1991fdec90d13cc3fe37a SHA512 7524b6b8cd7cd141a56c468efa303b1d21576ac9e03cb866cbf9dcac34e1b8d4f356333737050e2e5dfeb0f0ad904b3f548c40e1209c1f35054ed2027b1d8271 WHIRLPOOL fdbd2dfe43ff4a2af97227fbf8c4589ca3734ebf0320b7e9c5e8ea39882c49d45815a0ee3c765a141affacbe48f4063987b9664a918e0e216b49ca46a475cc5f
DIST gitlab-shell-3.5.0.tar.gz 73374 SHA256 6591b768a4f51c535e97e5632518583f6559a4202f4219739ad01a27161687ef SHA512 b5935c6f9b19bab1716901c8015e107f7fbc545646d5e35a6a943e1692d3ddd61efeb862f4d59efe75eda9c1117adf9d90b50f572ab0a69199069d1fc52e8718 WHIRLPOOL 938c600d0810867fc9aef62a286b05dc34bf52352612530d459614483e3c37b3cef6ee5b2dc11f7b041218cbe569d11f4f5f0240b9c28e613bd762c06786772e
DIST gitlab-shell-3.6.1.tar.gz 74806 SHA256 180dcce14e9caa9c7f09eefdb2e10189318a0f994c4931fae2acebd92e9e4fa3 SHA512 6f54b0a9ddccabb3971c48301292835ecf953e0a9bb3b9d1d78af416a42e3d2883a157ab02990e748b0e6b02805864c314fe9cd538834ab831f565f0c573ed3a WHIRLPOOL 1219213217d5ec280ee521c4f64328634402c795a4fbd10beac3481f4e622faf03859589ee641bbd34647b057c77bdef0d7e1a2906375c3de21cd6b4739a7826
DIST gitlab-shell-3.6.6.tar.gz 77199 SHA256 db3f54b561bb81059256c634967b181707e11cc25e30b0fa76eb034718d0eaf9 SHA512 d1d15687169f7b151caf3b371d6570099129a2a69d7732e6be7337f70aaef7e36c87e8aa5140e9697c7be36185743bb939d862790b440fc18d7a864d570fcb6b WHIRLPOOL 4161901369cc12a89fb89c41bd98cfc2cfdeb5aac6d317597ae11f10bcd401e4c18148ce9a20f5e967a6fb11559f33aa72c82dff1a52764c5a19bcd0f06250c1
DIST gitlab-shell-4.0.0.tar.gz 76582 SHA256 2d8d5e31eac5007a70720465d71c6cee74428a71c2fda7e21ca8393bc8c8966f SHA512 dd44528dc2914025e850b7172df1c5e0b39f8c1764adeea62a824643723c3264c462006ddf0cc6f4519d0caf0c39e6cee601f9f7988eb54138118176178045e4 WHIRLPOOL 462886da23a1723049914759f0b315d39c42488e55dfab4debae57c7b20878a421dac36a77d5e82603119e4eb142c83dbf18e28213670abd81396de1d0c683cf
EBUILD gitlab-shell-3.5.0.ebuild 3653 SHA256 3b73797e283ff4ec30c87d50a54a80cf6895c0c03dedc3ff34087b3037dd9fd5 SHA512 cc235d625f1eabac09822fbca06b706886601e550958338ea5ee7ccfdbbb85e2d96bb348b4ccce532c92d18389c63ddb78bcd77e407f789127fbb3d9ac32d0d9 WHIRLPOOL 4a8bb0ee8a1b547bb8517c300806457187a8fd1855b223cf079784733fdef55e2dd5fa9998da9523bcd3b021aa10d45cc74445bae5bd8f853e3355d6a1d6417a
EBUILD gitlab-shell-3.6.1.ebuild 3653 SHA256 c36f3fcec5b4f954c404e4f41a773461971116d7ad2bd484b05ef479c4915ad2 SHA512 fedce05647f773f5a7e54fd8764f8934666a51d9b5e8a5e93201bd504a042ade828cbb0043817b8552bdb4d1cdee6fd2404b17c4e9a7ed3ce75fc41e79c866fd WHIRLPOOL 4853bcfb4dfe1dd152645ce4d572797ba158d5edf53349f3d66489009b10ec2cd7a598beef46bc9b1e104891a3071e1cb9b67471e284b626023a9e1b46b559a8
EBUILD gitlab-shell-3.6.6.ebuild 3653 SHA256 49c383d1d5895069a6783e44d492935879801efd95f57548a81e10df48339038 SHA512 4e6dd5c34a56ed0e1fc45819c93239c61d900304cc8df20855f4e71e4fab234b5e81612f256155022f362f4f9a0959531a3999eb7ece9013914129e4343795cf WHIRLPOOL 92d40a6cb8dd19a42093a746e29ead878eeb9b0c741e23ca3e6213c0a14b820584633db8f2d5ac60cd28da15546232de417db72ccdf8608bc49ac333107f7193
EBUILD gitlab-shell-4.0.0.ebuild 3653 SHA256 1413668c9a75cc89b4043e497b9339639bcfce942486d8dada512968c53633b9 SHA512 0f825e5812084601b56f790d880da266986717cd2a35a4033cb75710b3cae624fe5015412a0674dab3c2099eaf29a956af19ffcc6d671bcddf72dfb8507f47e1 WHIRLPOOL dff4dc61e0f568767e25e865546a57018f82b2f28c5bc974df263021d19c0cf194a269b21b8422878e09cb3fd8c7cb34600e005c49dacde0c56df1701bb5e64c
MISC ChangeLog 2210 SHA256 e0078f0626c5c8bb11243563a54e3596f4d145204d481800491417627d0b33d9 SHA512 1a55c57982db8ee7c6f3b776503fa78faa3a19fda2f11592aeb15716d250f843c2546c8628af42f9d2ee0c8f34e39ba95da04576b770fb6c4d7c9f67e8b23275 WHIRLPOOL ee5cec43e3b6a25f3a3ff45d98bf2fcb4000a684b4d8da63fc9c1858f68b5959561ef744096522f69fd1e63f97f7a0736750c795487a257fb9d3cdab0c9b4f09
MISC ChangeLog 2364 SHA256 32bb4af74bce1cc6fa0e4baa257b94472850cf83c0b4f3cf7ebdd1f9ad19ff46 SHA512 d9074b513070eac189c3991e16f3315e2fcc96cd723bef0c3ad557f04c9910ddf81739bdfd83a08ca351081001b960eb91af5f1ace3b64a127f2dea5256b8abc WHIRLPOOL d50e06a7847c1ddc50317edd42b593b5fc2c47d144bef4ee1f2d476a7a42a35b88552ed7b53e2156ffde2ab51accfcf38e24bfd157e3dc47589db7a98f31ef77
MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1

View File

@ -1,130 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
USE_RUBY="ruby20 ruby21"
inherit eutils ruby-ng user
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="c6d8af599dc797ec8ba7874380abad393b439c9e"
DESCRIPTION="SSH access and repository management for GitLab"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell"
SRC_URI="https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz"
RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE=""
DEPEND=""
RDEPEND="
>=dev-vcs/git-2.7.4
dev-db/redis
virtual/ssh"
ruby_add_bdepend "
virtual/ruby-ssl"
MERGE_TYPE="binary"
RUBY_PATCHES=(
"${PN}-3.2.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}."
}

View File

@ -1,130 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
USE_RUBY="ruby21 ruby23"
inherit eutils ruby-ng user
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="b71ca5da9fde4fa8457af146bd090ec7caa28d60"
DESCRIPTION="SSH access and repository management for GitLab"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell"
SRC_URI="https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz"
RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE=""
DEPEND=""
RDEPEND="
>=dev-vcs/git-2.7.4
dev-db/redis
virtual/ssh"
ruby_add_bdepend "
virtual/ruby-ssl"
MERGE_TYPE="binary"
RUBY_PATCHES=(
"${PN}-3.2.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}."
}

View File

@ -1,3 +1,7 @@
23 Nov 2016; Manuel Friedli <manuel@fritteli.ch>
-files/fix-Makefile-0.8.2.patch, -gitlab-workhorse-0.8.2-r1.ebuild:
dev-vcs/gitlab-workhorse: pruned old ebuilds
*gitlab-workhorse-1.0.0 (11 Nov 2016)
11 Nov 2016; Manuel Friedli <manuel@fritteli.ch>

View File

@ -1,13 +1,10 @@
AUX fix-Makefile-0.8.2.patch 354 SHA256 5ad06525d351b433d32569040eac8756aa067860e20f68cea92e59807bbebfbb SHA512 e39e834c3346a75494de0b2daebaa2a2d519c35b5d4f42ffb5a92dcedfca9d2541f523791c744eb3effdcc62503134e3585a9f002425f787727e18614116c670 WHIRLPOOL 39bd515da32f8aa31be1532d5b32f073feaed3cbee2064075c67669c5c683094806e8438b4cf5bf3601de3009b0279787813f78827c25dd3fa7b6c455ab6823c
AUX fix-Makefile-0.8.5.patch 354 SHA256 1773a2e9f535c08f602903924b24918553acf563ac9804f79f26f9f58cd915bf SHA512 2fa8ed07e5e2d012452368047b8aef441015f013c92670961d3b1ea7f131eb49379e0817eeb0da38f04ddd6b9aaf0d081bfcc6ed9c5b83c94ef97b1831836b08 WHIRLPOOL 20849d2cbbb2d5feb48255c3e98a0c9a524078fb51c311d09e833056f07a35c938bc82686338f028ade7eb74090c6c84473e6945e9bde99dbe3d2d057b94a7f2
AUX fix-Makefile-1.0.0.patch 354 SHA256 97432841e31d2904f6c3d23b4a5e885def82423c404d45e7b0a03be23bf683cc SHA512 44c0a7b8a3078b7308645fcb7c2ec801ac774dcd138356f3c01e6cdd6cd80bbf1fab155f2b604b0f000f6189f36b3c0a1bd8cf9dbb69ca2f8e6fe7e709ffe86b WHIRLPOOL ca42e23b701247f900615d2dbf1d6c983bfb5aa0519c9e100d94e6019a018f11c30794522aba05e0bee89dfa1a898dc2271326fc495cb3428603e972d3c548d0
AUX gitlab-workhorse-0.8.2.conf 297 SHA256 8bb99a78197ad22892e4c85496101a39f2c82f6c537f44da8185af54dbb44a38 SHA512 d143489c165ef5e68810bb10d5e97da7ad3be6d53618380231706ec16c3fd8bc3eedbc78a09949479a408646e32aae4cdceaca9b271ba3b816e3449b792c5406 WHIRLPOOL 649d34b60afab816dac559989c9a3b0cb9620c2ac2a7617cfcae8bcc2c421791fa612571f83e6611ec8ab8c26c9c79f9832f4e6a70396497dfc5a40d99bbbef9
AUX gitlab-workhorse-0.8.2.init 681 SHA256 bf3f94853781251629daae935d04294febf317061536624e2c01188dd6688ae7 SHA512 6275abe0910e7327f952dba36827a9083264f76753605767cc11ee7b162fdecef3170783800263bf8acbe891d41e6be9e27b5fcca2a4f035b990c9865aa02647 WHIRLPOOL bc983d0413c0743ef0843a3abb46ee2be78ac6e18b56f96de63b4ea8cb9242f8ef6a96f2d593dbcda33a0a60b7f941f27bd704b7f64a85db7379ef0b42233527
DIST gitlab-workhorse-0.8.2.tar.bz2 226124 SHA256 869feddeef18ab01183e2cd969445d5d091cbd09b7e9d98d1c1b505df7c84d62 SHA512 ad9d24e9eaed2644e5703600341aa1af37f69cc902d1dc49b0338dddbb56f987fa9608d447b29419c5e5d7548f4e8fa8f073b76dd9799994fb1464fb766e9da9 WHIRLPOOL 70f605ed70e1696e89ebd0964ded9e47f6401a0da942edf90a9fac4366a67d85e1b8e339cc8928bce5ba84af7ace950e17eaa3d2393ca19f3f39ee9a52cc27c3
DIST gitlab-workhorse-0.8.5.tar.bz2 229807 SHA256 fec50a37d17c359726ac3e0d2bad4ad3431e6bec9aaa6dbf5dcb81bfce469369 SHA512 c149c4cecc1c64c472e38eaae8cf4522a4b19907ef3a9eda4490ddb6cda6083bdbbc1a827cfc2c4d7ac151e3edc4b5dbfb168e2590ea71f12c2836680b2d8033 WHIRLPOOL 21aa589997e934c664fcf3b6cfb19246910a87ec674fbf2fea5a04728bc00248c79b4ed555601af0adbd20a11ca2ba040c1ccb92323acda7bab3da8c37840340
DIST gitlab-workhorse-1.0.0.tar.bz2 233511 SHA256 c053224e050b9169441316bb1ab1a23449c7e8c125d4172badfc84ddc700e09a SHA512 f6369c777e3fd422f8136276c8f7ccd5a73d60e2559427074c484672d048dbbae9c7f8a0af7fd54e64de0ca3d1a679cb294f114397b8137a929437b7e10284db WHIRLPOOL b322ee8150c2ca6d0f85a211240fe87b15006ad364c333126d48d65d93ebd57d31f312f88d437bbd473acdaa1f74154b20f9f71a51e8ff0f381f793d89fba6e7
EBUILD gitlab-workhorse-0.8.2-r1.ebuild 950 SHA256 9ac8a68b13fded800fdaa077df3a5a448662d36e88ef144e565719e95d847612 SHA512 0d776e4be9abef95576103a600425dbb9a73d87dd21387b71dd3f54a62ffb7a9f36713f84c8c6222df0f694d8199148c02b884a56a6abb030d5d3fc9cebd6649 WHIRLPOOL b03658ea70cc2a1bc5034699ef6f6fb8d823889438da7f98d8ba728c7a1c56329aa2e934f902a2964f21975e4a3595d0d7011524ccab31fd0c6e52eea1967ea3
EBUILD gitlab-workhorse-0.8.5.ebuild 950 SHA256 259a4406de93bd2849916d537b67103bcbd4247c5e00871a0c4d9f0bfc84ae11 SHA512 b30e842434de5ba6277b7e1cb3bc38240eeba272dc3ace95a1dfc2dac7b63b1a7cc098e4c2e763ec57b4592c66b3b990a903e1d2382613ef1a7acd5346e9a9c5 WHIRLPOOL a8734afda28cd6c76c3ff381d780188a4d79c7abe3ca2f96087cb1e82c0f7e37acf0610ae80eed1123a66da16a53b6d4d5f080588a45d3016d73efcd5dc91b3a
EBUILD gitlab-workhorse-1.0.0.ebuild 950 SHA256 0177716249d616021e648a97e2ca38972a5587e09357f6bf96086b655dbdd7a5 SHA512 65976da76880b22341a0317a97baf4be786fb593e1fc33774d31e8c23ae7b91f67a1d890f3decd6cf83b5732da311c042ef60cd26f030b8f6ad2fd61a27e7f74 WHIRLPOOL 437c69ce0cc4025fa4d32346b9eef9de78ef1a215de2ff8bc6edfb72af43708e35dc6ee1b064f021c566acfcd0bb11156487042e7468680b5781904ce4fbda16
MISC ChangeLog 4570 SHA256 8df9a2d2435bdd01c1a16cc84c6f8013030ba9c29c26a7f57995befea6e1cc80 SHA512 75b87f3fcb526ccb814b2c7a0c39e8ca30eff705e4070f5fe397c55afe7495625355ba928086261822e9adbf86eb35ac63dffe87be8e7d52323fccfbf68e772c WHIRLPOOL b9eedbaf47a7a3457e26a8ebbafd7a6b136793a446755f29becf8a39ce5d0e6620cd4a1d22d6d0fa6b4502468a078b7e9c62346c5effe90b2789019e502e96d1
MISC ChangeLog 4740 SHA256 1b29bef557b6e69aea73a5d6d1e8ed53547ad30096ab18950d3ea0d977d98e6b SHA512 5e484860434330c55eb152f2acad0ee2756563ca9df53779110754f733c8918482e4a76d250b2a88d7687209610b00c0954efd7f8c06a93eb9f7b52624b82a67 WHIRLPOOL 83cef370e52f7dba225046ade3f41616044f344d93652185c33aa46ea3a00e1d8f01b531615ea700cc60c04c8354625793bd8e6062aba2078cc3e3047b306e09
MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1

View File

@ -1,12 +0,0 @@
diff --git a/Makefile b/Makefile
index 3f6ac91..663ffbb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-PREFIX=/usr/local
-VERSION=$(shell git describe)-$(shell date -u +%Y%m%d.%H%M%S)
+PREFIX=${DESTDIR}/usr
+VERSION=v0.8.2-$(shell date -u +%Y%m%d.%H%M%S)
BUILD_DIR = $(shell pwd)
export GOPATH=${BUILD_DIR}/_build
export GO15VENDOREXPERIMENT=1

View File

@ -1,39 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
inherit eutils user
DESCRIPTION="This is the new backend for Git-over-HTTP communication needed for GitLab >= 8.4"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-workhorse"
SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.bz2?ref=v${PV} -> ${P}.tar.bz2"
MY_GIT_COMMIT="06632c751d46de97776f1a5aeb2432fae0f6fd4d"
S="${WORKDIR}/${PN}-v${PV}-${MY_GIT_COMMIT}"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
DEPEND=">=dev-lang/go-1.5.1"
PATCHES=( "${FILESDIR}/fix-Makefile-${PV}.patch" )
src_install() {
local dest=/usr/bin
diropts -m755
dodir ${dest}
exeinto ${dest}
for f in "${PN}" gitlab-zip-cat gitlab-zip-metadata ; do
doexe "${S}/${f}"
done
## RC script ##
newinitd "${FILESDIR}/${PN}-${PV}.init" "${PN}"
newconfd "${FILESDIR}/${PN}-${PV}.conf" "${PN}"
}

View File

@ -1,3 +1,10 @@
23 Nov 2016; Manuel Friedli <manuel@fritteli.ch>
-files/gitlab-8.10.6-sidekiq.service, -files/gitlab-8.13.0-sidekiq.init,
-files/gitlab-8.13.0-unicorn.init, -gitlab-ce-8.12.7.ebuild,
-gitlab-ce-8.13.0.ebuild, -gitlab-ce-8.13.3.ebuild, -gitlab-ce-8.13.5.ebuild,
gitlab-ce-9999.ebuild:
www-apps/gitlab-ce: pruned old ebuilds
*gitlab-ce-8.14.0 (23 Nov 2016)
*gitlab-ce-8.14.0_rc4 (23 Nov 2016)

View File

@ -4,10 +4,7 @@ AUX 03-gitlab-ce-8.12.7-database.yml.patch 2154 SHA256 6daf34a6be5038e0108169a1a
AUX 03-gitlab-ce-8.14.0-database.yml.patch 2172 SHA256 8435bf632aab03057342d5d6d75f016b006da00157c0cce2661416b752f8b75d SHA512 048aa5877ef30e702727b917cf7fb6bd534c497a7c24ab55640635598af293b0567bb9f356c4b91d55291341ced50847909f117f46d3fc9962c2f7a0f7b6bfb9 WHIRLPOOL 87b62f5e326211c2ff9001742a04b71bd94b21f4851778a513f7e1981da193dc16718559be42a0ba21aaa0c2f5b65a2571bc20174c063aa13e6436f0b422f057
AUX 04-gitlab-ce-8.12.7-fix-check-task.patch 917 SHA256 e1adffbd59a418d5e14cbd51ae14d5c1f0364af759c77b6cb485079e0233e90f SHA512 226c3892768dc526dbc9f109aaecdee1eb27c0acb5060ba6db8222410c500336ebcf7184437228480da04ce5de149a14bbb5c1471aed853a280d7f371f271d88 WHIRLPOOL 3ec22dc4d12b5025bddfccdea27a816aca1f818d5138b3dc9a6362e56ec4cd14e5c38c76b64b468f3797e0d2718d38aad4f910abf3f3328a7983832babb7f231
AUX 05-gitlab-ce-8.12.7-replace-sys-filesystem.patch 2387 SHA256 dd0e9987ed4bb3a9c73c6aee1d89434afc51ff663fef2ee4ac93adf1b73b944a SHA512 afa82fb8c8d57633c99373f31678760fa6ecca5e459a9059f5b460b458d1dbf3230108a6b4f394780c26a697881c9b2319f15804cb8d04ad3139127e7c0f4ff8 WHIRLPOOL 90ce708f8cde0a4bcaef9fc002ca00b97a1211559bcabf5481ec71c608bc5b772ecd518ff07a8d626a27e4b21c0f0f51fa37a65503e79664ececd78d5f19e87b
AUX gitlab-8.10.6-sidekiq.service 1085 SHA256 de97287a5cb1d04dd4b6ac96e3569503cf797e605b325e13d4807d72cbcd7333 SHA512 9d5f3ee50f293ae0c9f353f7f9eeed00c57fd54e75a206bf7ec9b201453099222668e1d77dcfe6b35ee9a8722860551822897339c4741e0c612054a9423f132b WHIRLPOOL 5b5cb94db5c7a2c46b487821baba6fe31fa08ecc1cbae6f9b1655d32f95c57c7c8f1bede19d09a8c572512e40b0c8daf27d50ebfcbc8e4af449e21b01ad11441
AUX gitlab-8.13.0-sidekiq.init 1012 SHA256 3c4db0b6249036f880ec49c49601e9da4cabc3abfec79296da35df4c145180ef SHA512 7aba7a6a499b924e81528586919a9db1159df15fd91587553cc6d6f34ca273a6e7112a20bf7c6a53b2547d86d56869737f3e6701a834bf4f93916cf176a6edf9 WHIRLPOOL 01adef44f3faeede4ec8b48fb52adf4a72be320755ad9925209f187feb34d9c598fee55202473f060152c80b9932c1e3bb9442dad6400aef42e59e535cd1c8f0
AUX gitlab-8.13.0-sidekiq.service 990 SHA256 183ccbdb19a3dcc74cf1f1f865bf396466e06f7408ff7d3e92359b2a0e83f24c SHA512 c356baf65337739b08a0a4bfe24d3b68f557e9d6d95f479b39ec954ee6c2077e380f99d1e9e9390f5b038e093c0a46562f651512a6578dfa86977580159470a2 WHIRLPOOL 81d9ea9febf47d5fdb9c49a54bbc499bd796fc56bc1c16404fe4c74d00c4bb9fa9631e4cd4cf88d3c30a44c04b74b35a61cd4da9f2139a4abf61e758b4e5949a
AUX gitlab-8.13.0-unicorn.init 3141 SHA256 73fc750f671cff94a32218512be07f2f7a353b31fe91f6391a85cef00a863a53 SHA512 e728dc6e2453f5124f347359e6ad592cf171a07540a54ebca68bbc95cbf8ca8c211557156e3e5f0f67df0cfa58e65e1bc6589e99c86eb32706a8dbc9972ff9c4 WHIRLPOOL 3e4a1be447bafd4a609b1f0a786774182c2c2ae01bfd67d4c1c1faa718dab3ae7958f6b8604ba6efd70ca9e8203cdd0f35376afb3775a72c3cf78a1fea112684
AUX gitlab-8.13.3-sidekiq.init 1459 SHA256 fdf808f9c0a92d7a77ae8be27c8fc11cec571ec6b5b94e31639028eec19546f1 SHA512 ec2130483b603f2be423c288fd0d55615c831ce995a8a5509f0240f149b3464d8f0a75cade1c736d085fb5f898d109368af62d8fdfb280aa00c4df8c06abb1e9 WHIRLPOOL d3493ac268257386e22c677337c8f9b1050212fce4aa855119b2ccd5f56850a5288d0cdd74e3c2f34552f59f9431c9ab5080e372766b88de003cad5dab015100
AUX gitlab-8.13.3-unicorn.init 3562 SHA256 f4ae5b785d61fb2c463b2405533d5e9a2209bbff7a085106b463f59505123287 SHA512 4af87415da7e482725a6f97f5e2ffafe0d16784cdcf3f877c99b5f646832c14dd1b3e875ec00e57560060bf3c049dd7fd0aeb7452db1100740e6b17dc29fdfb6 WHIRLPOOL a63d236a76bcbbd6e39268c76a7fbb75f4b9e5488d0cbc0bb2973ae09753f11d1863e477fe88f6c652370c19c3a0f037f99cc681b91679eb4da992db5e2eff20
AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e74913bf364aa499368fc5f2e SHA512 f82c63a180add1103e2bd115e67826ad7362a844991ef16f1de7fc6c78bf1955155ecf278fc0d759e674ab85736f3ba2a6650d00e9b3ce683316875efd9efa3c WHIRLPOOL 683c67b12f9666d1c1df5ec61e0072acaecd3aff43d0ff475037e178bc58fd9036ae6d8cd45e922098c842abd057231afd4767ce229d4581356f153b48a06208
@ -16,20 +13,12 @@ AUX gitlab-unicorn.init 3127 SHA256 de2f5861bec58eaac284e74baabe25288a520bc4f7da
AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792
AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae
AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9
DIST gitlab-ce-8.12.7.tar.gz 27110532 SHA256 003e497e23f730f4990bdb4b431109f2956b5bbf1d202a4003f5af65424157d4 SHA512 7ad53f5fe0c88cfcf5688de5d55489964a4b5e8dd763fbf7d832c199432b9532f0a75e6d803f1d03387c86b3ba0b47b1b75b97e783f7661662b656c7f9aea216 WHIRLPOOL 026d11a8adcde5312b46d626bebc6ed33bfea344042deb1fab0a40a52cfd7deccfe78ef2a544293456f08bf7acbd917233533898b54c3b9dcee9121520607ff2
DIST gitlab-ce-8.13.0.tar.gz 27763918 SHA256 0c4736ec84fe371334a0b7feca34eb6a2a371242c2ed0ba356b201de5c5e4a46 SHA512 e08ce15b6b8658d12c20cb7b522607c6c54880c1e2737f48e4a80f5d3fd8efb10f680b3a4a8c975dbc5237eea2b0f5fef185286d1ea3a7786573fa2bbca4149c WHIRLPOOL 91e4dc8732f3df17ffa81d5fa9ec6b0be8a04c956021ac95c859819643da426b5cafef2d1811cbc3507688179f2645839ae64eac6bb1941fc17076977bdff960
DIST gitlab-ce-8.13.3.tar.gz 27773077 SHA256 040e43517e10782a0f11b3bfc9c349cec9e48e5c10cf8d46c7e468beb7677101 SHA512 3031798e0c56a7a028a544943304ac84e5a427e40d9db40fe75aba215192f493ee4508d6d99f0a5814ac11a52f8db673d03012cae052b3841c3407c6b9fb83a8 WHIRLPOOL 2a78824adda0aa4006facf0c791b6f0be930eb574a38dda6d58db3cd9331238f50caae4e2e6acb7442a3488b3b9c91239a488063377d6b34befc5a3375c94c7d
DIST gitlab-ce-8.13.5.tar.gz 27814361 SHA256 05749840b2cf9c39cc54dd88c58571195437811b133379506523df6757c26fec SHA512 9039b46adcff7e4d9ba8029d3b97cedf672179c54c9dc48a91693ed52b2a09b8cdf3dbdfd671e58c2d91f52741bcd4220d75dc896f62cfba798f4bb64931691e WHIRLPOOL 5c6e4db776d5f021aedef7e6a6e6315c7ba01da518b0571aa00037afcad5304ea75e3d130da77644e5ca824653a507c7224207581b440437505ceb0e0d34b628
DIST gitlab-ce-8.13.6.tar.gz 27816283 SHA256 48f29ab3c33123898502563c764fbbfcc3a3146bccc6793f7129656360f277a5 SHA512 b2928b22431eb974b679b464d0a7ec85d9325b584371f884b174678943a17f8ac8db34a3e1992f0f8cbc4cbf4d3000344aa7513edc2c683fb3a8940375a5ea5f WHIRLPOOL f5c7ea34fa4b659d7c0405983b3fc797c4c7641daf027f9f3d06b6d5b3f9bb9435f200456cace9813584ad6256d6d389fbbd08b7f28a9c29aacdabb5b7dc0c2e
DIST gitlab-ce-8.14.0.tar.gz 29710909 SHA256 817f4d5dbb5a59d204f71954d0549f99b91746563d190f73346427a0130051e8 SHA512 4428fd6cecadd613dee705107a69bdbc87db0a80a85b431b26575c6e00ad6802d5240bb3c4a7b67b75f7dcb6926a230a845f329004ae8c60d484dd96cb79ef1f WHIRLPOOL 7aaf718229ebb99f42a4f1462cdc5da4de1f23d90e28fee20f25d93e3f8959e21c5275d4116bba16ed41450609ea1d28dcf5c150c80313a5776ed00b47bee7fc
DIST gitlab-ce-8.14.0_rc4.tar.gz 30101713 SHA256 667cccc428d20d241a19bb554eb517673e447db85d163f8245f1d9969e233a4d SHA512 4389aa9139836ec2ab70036df1f1f4324e57edc3fd13c331179e3774c2f65f253c66eaae7699ab427248ef05d2b128ddfe425b59596f1e6070e1b2278a883c37 WHIRLPOOL 1fd35f86555f45003621dda41cb1a31892dac9b02982fc04873c65ba5f7b1960b75c4b4d6ac7fe0d13b5c11e516d997504f9184449fa48ab272e696579154529
EBUILD gitlab-ce-8.12.7.ebuild 12068 SHA256 5acdce0ee5f3c6cf20a120758ad0c60ec70574d38cc2ee56037b3789d812edfd SHA512 7daf877280f4a8242fa83e1b70d5cabe99aa8bd547d0b4f9a4921c60c44228f508e39a8a4f751b987078c4d680aaff374a055c8ca5882b12f110b232c0006f4e WHIRLPOOL be51f8c53ac45db3c13f179d447665b536df4848a4c63cf5619d2620fbca7bd2701b861f636235d7e746ee7f560eb084e949288f11dceaaef826c138be321625
EBUILD gitlab-ce-8.13.0.ebuild 11859 SHA256 b90393b330f1048ea73536071793f1897d62e14773bc170600abb9ab9dc0fcc0 SHA512 31c32936dbe355dc9dae68bb5b726822a9f5222796dd11dc95b8907fbb2e316930a95568061557328a9d87b5b5eded5867a1a8d552cd9041f10054140d461426 WHIRLPOOL 2ce6cf02c5b27fe70f00795c16fa3d20f369ba820f8583c90808ac5d6c1d838425d447caaad67b76ebc64e6a3f1b6866ac2e890566dc71504056c20103b8ad97
EBUILD gitlab-ce-8.13.3.ebuild 11979 SHA256 b5a243613dbca1645c70b0b76191172d823a1775372172054c653706261dd1e7 SHA512 9121a34bb8f071395f26d0dbb87fb8bae50f00b8b606c1ced4d43d7e9908c7937fc5bd3d15992b34545206bcbf138e2ab1a593df709904b409ad9041b6a62f9a WHIRLPOOL d7c84308560a28e0222da75acad82cda660770acff43b180d40b35e6395f46adc66afb40ce3ba8c73dd76251e89f72b9dff51bc602c82154a1ea974f693104fa
EBUILD gitlab-ce-8.13.5.ebuild 11979 SHA256 7b16a160712995d17004adbdfed92974f31e83bdbad745f0999e403c7db50090 SHA512 9bad09441979c9ef7bc764cddf3daf02b85b657b21b0b409dcd2257fcbae9691c3afef605ebe3f60eb11bdc61abb0ff6b22b344d41ef549dea7795576deba987 WHIRLPOOL 960d55ed74694e31dedd28307a45cfe6808fd94eb4e79c667d670f84d00a9f6bc72d702e1a59d9325087752e1a2f7ccbfcb290e573e31da0384ed3fa2ae91bae
EBUILD gitlab-ce-8.13.6.ebuild 11979 SHA256 761411082e2e68f432f913f5c5c969847832d335b1f7843575890ba125542539 SHA512 ab01af577da7a27cee3308c6766a042edbce7f1c472639b9a24b9bef3a7ce37389dd8e32b43cf62b9ce7c20399ccf17fd35f678ea63598b4b06890bfeabded50 WHIRLPOOL cc14b981521f0513108ab4320f2e3d4f210ec0da7373f0f99b35d975003b5e1ff5783c5db5c6b7f29739e795fc73d4744716f81056039eefaf445354bd7cb000
EBUILD gitlab-ce-8.14.0.ebuild 12058 SHA256 ef9893f42bf74b6864d5647c406afb69412cfa88ab89fa3bbc8a69d92f6eabe9 SHA512 182be258e2ede41a056d0ecc6c8691dc89af035474b711c74887b61105e1260fd0cc02556931e713cc256766a8879356ea07ce7bb9aa8f463eedf63925afe52e WHIRLPOOL 69c12e67507d5f27bf5491d06a1f0de7e0bc156b624008977f7150b623728e255ebdcecb100aa3133dc8063f7bdfb5586c0924fa3077c1141090719666d1cb76
EBUILD gitlab-ce-8.14.0_rc4.ebuild 11956 SHA256 d6e509c5e9de4c361f04a8c76d0e87b947c5416bc6222e716d368cd82cd55df3 SHA512 58d8862ccb1d09b05bc880fa36d6d3936d1d666537da395817e794b7410fba0df1afc136a6e2bebd6d29b2bf16ef8cd95ac3130e6f35b678c543f7e0e552810a WHIRLPOOL a348a04316fa46da98816ea6a51b641aae68b13b513cfd445b002d2a6180786cf0fd5fdfcf0420ceec8de7a090b01f4009334fe5618c47813b40f0baed8360da
EBUILD gitlab-ce-9999.ebuild 11913 SHA256 9f3f58ebf1fa7fa7c6b00374e83dda8476116057ee8c6a3ecb5779f0bc7e5254 SHA512 5f2a68f540e26129d9d57a5a72ee924503bc8f8cc89539545aa0ebedf70e42e6104be879eff8cfa65fcde151dad0b4e78523210aee0f9f26549e6279dc76246e WHIRLPOOL 9810dc5e8a1f87601448fae42c8f136e2a9d1ad892357c15590bf53f26b70d3022b383da7b801a51a4ad88ec1f7033f072d294bcc884f614f695e294cfa40e2b
MISC ChangeLog 10809 SHA256 eb1ab94ebfc08bd663293f67bf4b068943f9d30ac2503d500d96d612e2806dfd SHA512 5ec91df02f77d70fe20dc57c9e900de1cf17f9c35e62b71d70f08ff0eb4b4aaa4c10dcd55db5b80ee327edae70000e45bccb2e50c4c9e7240732cbbeaec5cc5c WHIRLPOOL 8b6fb0b9b9f30c1ebd0c03a6fe7ef9f8010e2975d6132baf85b8ef44d51120b6a3021ebf2af8a1ed24165c6f426732c7d8e55f5d8c69167614e2e2242484b3c0
EBUILD gitlab-ce-9999.ebuild 11913 SHA256 f6e02b9e122033339874bce07dd4b1663a8b3dee9ad86e5793a9dbf7517e78b6 SHA512 43943fc250c810f131bdcfef518373b12bb997b84c12d5ee50b3006ddc9a7df4541a08faf2ea35dcd56ad70a7fd3d5dfc17c529b30df99c426d6418c3e5ee051 WHIRLPOOL ff7cf1a2a82545f16e2c7804ace0a8b2d00acab24233afe293668ab7573131065e1b301979d87563dd235a9fb4bebd3156aa9bddcb547cfb1b837103273686f5
MISC ChangeLog 11146 SHA256 112155c6cbcb661aaf760957d39cd990374f5d3adfca20600c4a58b1fb6f176f SHA512 19cda6570b1b3dbd8a77e011e34e0c844968148f6338cb780572c7a00407f49ea799c640611bfa0f34c8b095bbd25deef18eed20345efec283ddcf067b64e6a7 WHIRLPOOL 4156bbdd85cbe9ee18cbe75e4d5a6fc43a0e765d9cdc05e325fcec6715d7f779f608fb98457d2d105712ee3ab3cd7e32f565162312b8d6e8581373b6da64e37f
MISC metadata.xml 559 SHA256 6c3f48d3ef57c97bf27790f33ee04bd8de8b01597caa8a2a7a473d6d0a3c5759 SHA512 5aa340b5429795d84cd106ee673fd55a42fd4b0d3299d6b95c6a3e3d50812a9620820a4de5c57d5048af0c3ecec7f575d5856d2f7fadc210aadcbdd4dd040fe1 WHIRLPOOL f3d7b8c0522e09f5156e6bb446bb74e4c75f5da4495ca2ece1eb78afce59307abe01bf3c5dd5344278fcac9e334300d912031c806f51b981591c01bc3588c6f3

View File

@ -1,27 +0,0 @@
#####################################################
#
# GitLab version : 5.x - 7.x
# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91, Stefan Tatschner (rumpelsepp)
# Downloaded from : https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/init/systemd
#
####################################################
[Unit]
Description=GitLab Sidekiq Worker
Requires=redis.service
Wants=mysqld.service postgresql.service
After=redis.service mysqld.service postgresql.service
[Service]
Type=forking
User=git
WorkingDirectory=/opt/gitlab
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-sidekiq
PIDFile=/run/gitlab/sidekiq.pid
ExecStart=/usr/bin/bundle exec "sidekiq -d -q archive_repo -q post_receive -q mailers -q system_hook -q incoming_email -q project_web_hook -q gitlab_shell -q common -q default -e production -P /run/gitlab/sidekiq.pid -d -L /var/log/gitlab/sidekiq.log >> /var/log/gitlab/sidekiq.log 2>&1"
ExecStop=/usr/bin/bundle exec "sidekiqctl stop /run/gitlab/sidekiq.pid >> /var/log/gitlab/sidekiq.log 2>&1"
[Install]
WantedBy=multi-user.target

View File

@ -1,43 +0,0 @@
#!/sbin/openrc-run
name="GitLab Sidekiq"
description="Sidekiq for GitLab"
: ${gitlab_user:=@USER@}
: ${gitlab_base:="@GITLAB_BASE@"}
: ${rails_env:=production}
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"}
sidekiq_command="/usr/bin/bundle"
sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
depend() {
need redis gitlab-workhorse
use net
}
start() {
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
ebegin "Starting ${name} - Sidekiq"
start-stop-daemon --start \
--background --quiet \
--chdir "${gitlab_base}" \
--user=${gitlab_user} \
--pidfile="${sidekiq_pidfile}" \
--env RAILS_ENV=${rails_env} \
--exec ${sidekiq_command} -- ${sidekiq_command_args}
eend $?
}
stop() {
ebegin "Stopping ${name} - Sidekiq"
start-stop-daemon --stop \
--pidfile=${sidekiq_pidfile} \
--exec ${sidekiq_command}
eend $?
}

View File

@ -1,122 +0,0 @@
#!/sbin/openrc-run
extra_started_commands="restartsidekiq"
name="GitLab"
description="GitLab on Unicorns"
description_restartsidekiq="Restarts Sidekiq only"
: ${gitlab_user:=@USER@}
: ${gitlab_base:="@GITLAB_BASE@"}
: ${rails_env:=production}
: ${server_pidfile:="/run/gitlab/unicorn.pid"}
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"}
: ${mail_room_pidfile:="/run/gitlab/mail_room.pid"}
: ${mail_room_logfile:="/var/log/gitlab/mail_room.log"}
: ${mail_room_config:="/etc/gitlab/mail_room.yml"}
server_command="/usr/bin/bundle"
server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D"
sidekiq_command="/usr/bin/bundle"
sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
mail_room_command="/usr/bin/bundle"
mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1"
depend() {
provide gitlab
need redis gitlab-workhorse
use net
}
start() {
ebegin "Starting ${name} - Unicorn servers"
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")"
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
start-stop-daemon --start \
--chdir "${gitlab_base}" \
--user=${gitlab_user} \
--pidfile="${server_pidfile}" \
--env RAILS_ENV=${rails_env} \
--exec ${server_command} -- ${server_command_args}
eend $?
ebegin "Starting ${name} - Sidekiq"
start-stop-daemon --start \
--background --quiet \
--chdir "${gitlab_base}" \
--user=${gitlab_user} \
--pidfile="${sidekiq_pidfile}" \
--env RAILS_ENV=${rails_env} \
--exec ${sidekiq_command} -- ${sidekiq_command_args}
eend $?
if [ -e /etc/default/gitlab ]; then
. /etc/default/gitlab
if [ "${mail_room_enabled}" == "true" ]; then
ebegin "Starting ${name} - mail_room"
start-stop-daemon --start \
--background --quiet \
--chdir "${gitlab_base}" \
--user=${gitlab_user} \
--pidfile="${mail_room_pidfile}" -m \
--env RAILS_ENV=${rails_env} \
--exec ${mail_room_command} -- ${mail_room_command_args}
eend $?
fi
fi
}
stop() {
ebegin "Stopping ${name} - mail_room"
start-stop-daemon --stop \
--signal QUIT \
--pidfile=${mail_room_pidfile} \
--exec ${mail_room_command}
eend $?
ebegin "Stopping ${name} - Sidekiq"
start-stop-daemon --stop \
--pidfile=${sidekiq_pidfile} \
--exec ${sidekiq_command}
eend $?
ebegin "Stopping ${name} - Unicorn servers"
start-stop-daemon --stop \
--signal QUIT \
--pidfile=${server_pidfile} \
--exec ${server_command}
eend $?
}
restartsidekiq() {
ebegin "Restarting ${name} - Sidekiq: Stopping"
start-stop-daemon --stop \
--pidfile=${sidekiq_pidfile} \
--exec ${sidekiq_command} \
--progress \
--retry 180
eend $?
ebegin "Starting ${name} - Sidekiq"
start-stop-daemon --start \
--background --quiet \
--chdir "${gitlab_base}" \
--user=${gitlab_user} \
--pidfile="${sidekiq_pidfile}" \
--env RAILS_ENV=${rails_env} \
--exec ${sidekiq_command} -- ${sidekiq_command_args}
eend $?
}

View File

@ -1,389 +0,0 @@
# Copyright 1999-2016 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="ruby21 ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="7429b21d3260edb25e9d3f98713d163f97b23e28"
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 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd 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
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-3.6.1
>=dev-vcs/git-2.7.4
~dev-vcs/gitlab-workhorse-0.8.2
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# 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}-8.11.0-fix-redis-config-path.patch"
"03-${P}-database.yml.patch"
"04-${P}-fix-check-task.patch"
"05-${P}-replace-sys-filesystem.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}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/${MY_PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailers,archive_repo,system_hook,project_web_hook,gitlab_shell,incoming_email,runner,common,default"
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.10.6-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-sidekiq.init
use unicorn && rcscript=gitlab-unicorn.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${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
}
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
# 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 "Cleaning old precompiled assets ..."
exec_rake 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
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View File

@ -1,386 +0,0 @@
# Copyright 1999-2016 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="ruby21 ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="053a0a2ccdc74c2fd2ae400fd73675d0e14b1aba"
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 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd 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
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-3.6.6
>=dev-vcs/git-2.7.4
~dev-vcs/gitlab-workhorse-0.8.5
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# 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}-8.11.0-fix-redis-config-path.patch"
"03-${PN}-8.12.7-database.yml.patch"
"04-${PN}-8.12.7-fix-check-task.patch"
"05-${PN}-8.12.7-replace-sys-filesystem.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.0-sidekiq.init
use unicorn && rcscript=gitlab-8.13.0-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
}
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 "Cleaning old precompiled assets ..."
exec_rake 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
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View File

@ -1,391 +0,0 @@
# Copyright 1999-2016 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="ruby21 ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="8d79ab3a090ee0a43659121b858692791be52cf8"
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 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd 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
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-3.6.6
>=dev-vcs/git-2.7.4
~dev-vcs/gitlab-workhorse-0.8.5
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# 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}-8.11.0-fix-redis-config-path.patch"
"03-${PN}-8.12.7-database.yml.patch"
"04-${PN}-8.12.7-fix-check-task.patch"
"05-${PN}-8.12.7-replace-sys-filesystem.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
}
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 "Cleaning old precompiled assets ..."
exec_rake 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
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View File

@ -1,391 +0,0 @@
# Copyright 1999-2016 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="ruby21 ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="09cedb5f68b5cdb1b2e2a08ccf4505a847e02155"
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 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd 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
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-3.6.6
>=dev-vcs/git-2.7.4
~dev-vcs/gitlab-workhorse-0.8.5
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# 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}-8.11.0-fix-redis-config-path.patch"
"03-${PN}-8.12.7-database.yml.patch"
"04-${PN}-8.12.7-fix-check-task.patch"
"05-${PN}-8.12.7-replace-sys-filesystem.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
}
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 "Cleaning old precompiled assets ..."
exec_rake 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
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View File

@ -78,7 +78,7 @@ ruby_add_bdepend "
RUBY_PATCHES=(
"01-${PN}-8.7.5-fix-sendmail-config.patch"
"02-${PN}-8.11.0-fix-redis-config-path.patch"
"03-${PN}-8.12.7-database.yml.patch"
"03-${PN}-8.14.0-database.yml.patch"
"04-${PN}-8.12.7-fix-check-task.patch"
"05-${PN}-8.12.7-replace-sys-filesystem.patch"
)