commit: 2ec6fd631f8da14a37462d3585fb3f65d9bee762 Author: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> AuthorDate: Mon Sep 11 18:06:18 2017 +0000 Commit: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> CommitDate: Mon Sep 11 18:06:18 2017 +0000 URL: https://gitweb.gentoo.org/repo/user/ssnb.git/commit/?id=2ec6fd63
remove gitlab version not conformed with gentoo check and latest version of rubymine dev-util/rubymine/Manifest | 2 + dev-util/rubymine/rubymine-2017.2.3.ebuild | 35 +++ www-apps/gitlabhq/Manifest | 1 - www-apps/gitlabhq/gitlabhq-8.16.6.ebuild | 463 ----------------------------- 4 files changed, 37 insertions(+), 464 deletions(-) diff --git a/dev-util/rubymine/Manifest b/dev-util/rubymine/Manifest index fedc0b2..02fcac7 100644 --- a/dev-util/rubymine/Manifest +++ b/dev-util/rubymine/Manifest @@ -14,6 +14,7 @@ DIST RubyMine-2017.1.5.tar.gz 254315188 SHA256 198eb3d7914529ce3a6857e038167e194 DIST RubyMine-2017.1.tar.gz 251442732 SHA256 6c27f43ddc385ffba2cb2f011b80ab46d9b128d0fccf3b4ea43272fe36401a3a SHA512 567f84910848351d88d420d6d510c98f778d437c09112d6ee0ee27e501752933df2d8c1b817c5a81788dc9d5e22ab2816d475e2f9f81c22dcf6319634b8a8949 WHIRLPOOL 2c895fc4896e2bb91ba2cddb88cb4bc631341bab233be5c7ce299eb882fbd78e75f228b4fefe927181c948b336b47e0d3129a9a24ce309751451ea92b3161d62 DIST RubyMine-2017.2.1.tar.gz 279661517 SHA256 3190d8924d32b96bbbf0d513bca12551ec0bb1fddb7139960717c392d4f99bf6 SHA512 892b733b6076a7e83a28d37945b66a65a02b44acdd3eb2d7bc5d6a49845de61bc02b2c8ff0d588170bf68711c9412928cf4693a06a619ed63e4b311d4901a841 WHIRLPOOL ca2c4fc281843b5f0933fbe2c6bb02858164e117a58effdb9c24fec2abf1baa0aced007fdf7ab5537a93a96d762e45e23401c522bb6097bf4c15d6b3061a2c48 DIST RubyMine-2017.2.2.tar.gz 279746643 SHA256 f47926b2a34f80339540a89a5d0e237155b005e120af4ee91efd284dcbd7e2e5 SHA512 7b266c1e292452b7f119b77b9fa1641dce26c8632fa829784059dfa7b1f65adc5b4953ec23ee114794db8f5ecd41b4b03bcc59602d30a15a3e0ae2ae09fa380e WHIRLPOOL 636034f02e6e2459cfc5680709eb86d2eed9a9aeea35af89182aa09230887a509de170704be1e7713ff34766e0e30c005ccc50dafdc9cc9682191f45e6f93266 +DIST RubyMine-2017.2.3.tar.gz 276887375 SHA256 abb7cf5d4d4b13c9031c54b129c0461e4925cacd3ef9c810ea1dffe7f51cf0df SHA512 867890e9e45d91f7eb1498b513a18ff8767c2f0e2436e7a79c50526445dd9e69a049753a4ad0ce425a64468ff5a3a10315bd2d0eeefb681af5fdee7f25ec34a8 WHIRLPOOL b4c6286e8937191e2eea6d5b9f3837359879eb198dfcbb522626b5b1d0571d036c1a7ccf7ceb64c8a51ea393e0523cc8f5505032c742735556374d5259649720 DIST RubyMine-2017.2.tar.gz 278756309 SHA256 df5ae53fc2d921c934b3a80dcbeabccfc79cc91a8b512c27ff50e813a9f42ba1 SHA512 080ad2a4e2b696c750613a1b06a5d523886924cf014920fe67831d318db53dfe1b7764ddd34d64aa4f02b6b389cfe197cd058e37ec402fb0e98793a4118a9bf7 WHIRLPOOL 4cbd0f1c252c54d59bac6825683991692022aa169f8f2fe7c0bb6bb1b6c9e03b1c5f16985d2175da3809d0bbaa1a8fb2717b02345ccabdda7852756d8b7df84b EBUILD rubymine-2016.2.1.ebuild 899 SHA256 1153010ef081c739c0e06f8e14dc998be313ca1f73659efce70a13b5ddbffc47 SHA512 3db2e836977aa149d66a1b163900a8a568eb068b1482a117925315328caddc9a62b743db9559bcbfb38350d74ae0a129467fcb982ea01ec36fdb9f808dfa7212 WHIRLPOOL 3429740eed08690f898e3a5322a2a30379843f5c72062c3009f61911bd0baabe154b372c8b19f885f3add4998c7cfa1a59409ff7b3eb6d0b3c008592a2bac9ac EBUILD rubymine-2016.2.3.ebuild 899 SHA256 1153010ef081c739c0e06f8e14dc998be313ca1f73659efce70a13b5ddbffc47 SHA512 3db2e836977aa149d66a1b163900a8a568eb068b1482a117925315328caddc9a62b743db9559bcbfb38350d74ae0a129467fcb982ea01ec36fdb9f808dfa7212 WHIRLPOOL 3429740eed08690f898e3a5322a2a30379843f5c72062c3009f61911bd0baabe154b372c8b19f885f3add4998c7cfa1a59409ff7b3eb6d0b3c008592a2bac9ac @@ -32,4 +33,5 @@ EBUILD rubymine-2017.1.5.ebuild 951 SHA256 6ac4044571fb176de50bbb0b47a91692fa382 EBUILD rubymine-2017.2.0.ebuild 951 SHA256 0f647a9f9461761b178c54be39f9043986b4c32496b7fc386b889ff997cda7f4 SHA512 3fe5c7aa706f61cf75773e605e59b1e4dcb002cf1ffd23dc6446895f597719c678f789656c05dd4defbe017548ffb6395928f10af022d4a31becf685ca05d5e7 WHIRLPOOL 4b6a3958fc8c46c912f0560327f64da0339a7394a7c237a89b2e628c3b0a46459065254f42270de1040a5b4f3744788826b5f431b6c5f09f565e79c5d516e761 EBUILD rubymine-2017.2.1.ebuild 951 SHA256 6ac4044571fb176de50bbb0b47a91692fa382682fd079058283c5398547d34d5 SHA512 87b73952544303351b2b171832e96a2bb62e70641478eb3fc1d7b23b7070cb00572ad82ec89b8285be044124385a2b2e033e6f55d43ea71888cd0a8b43561956 WHIRLPOOL ee1be39277349cee78ff938a803c97218ab7e3d96e44bdbc7ba9fd45cf4be3fd11e67d87fd593d59fffb81cb30fcfe969c8ab8dd2966676a29318ae9376b3f17 EBUILD rubymine-2017.2.2.ebuild 951 SHA256 6ac4044571fb176de50bbb0b47a91692fa382682fd079058283c5398547d34d5 SHA512 87b73952544303351b2b171832e96a2bb62e70641478eb3fc1d7b23b7070cb00572ad82ec89b8285be044124385a2b2e033e6f55d43ea71888cd0a8b43561956 WHIRLPOOL ee1be39277349cee78ff938a803c97218ab7e3d96e44bdbc7ba9fd45cf4be3fd11e67d87fd593d59fffb81cb30fcfe969c8ab8dd2966676a29318ae9376b3f17 +EBUILD rubymine-2017.2.3.ebuild 951 SHA256 6ac4044571fb176de50bbb0b47a91692fa382682fd079058283c5398547d34d5 SHA512 87b73952544303351b2b171832e96a2bb62e70641478eb3fc1d7b23b7070cb00572ad82ec89b8285be044124385a2b2e033e6f55d43ea71888cd0a8b43561956 WHIRLPOOL ee1be39277349cee78ff938a803c97218ab7e3d96e44bdbc7ba9fd45cf4be3fd11e67d87fd593d59fffb81cb30fcfe969c8ab8dd2966676a29318ae9376b3f17 MISC metadata.xml 246 SHA256 31de89a294c6ff90d5a88948104aa27a86ea35792c466f20db64ab434c682537 SHA512 cd6648a75839e6059cf877aa79a84600be0a63de66f59efd217ad91bac55a7ed4afd5ce88c90a262b4dd044734403fb90a049b8f19a42289ec3ef1d827b66d77 WHIRLPOOL 7f436435371f655a72f4564d4a14b1fdb1be0a130ca0e130804b17104fe9e2c6da44a3ddef859e41ba4eccadff8dfefddbb04dade3e4200fcc557c2fd7af703e diff --git a/dev-util/rubymine/rubymine-2017.2.3.ebuild b/dev-util/rubymine/rubymine-2017.2.3.ebuild new file mode 100644 index 0000000..a6a68b2 --- /dev/null +++ b/dev-util/rubymine/rubymine-2017.2.3.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +inherit eutils versionator + +SLOT="$(get_major_version)" +RDEPEND=">=virtual/jdk-1.7" + +MY_PN="RubyMine" +MY_PV="$(get_version_component_range 1-3)" +RESTRICT="strip" +QA_TEXTRELS="opt/${P}/bin/libbreakgen.so" + +DESCRIPTION="The most intelligent Ruby and Rails IDE" +HOMEPAGE="http://jetbrains.com/ruby/" +SRC_URI="http://download.jetbrains.com/ruby/${MY_PN}-${MY_PV}.tar.gz" +LICENSE="all-rights-reserved" +IUSE="" +KEYWORDS="~amd64 ~x86" +S=${WORKDIR}/${MY_PN}-${MY_PV} + +src_install() { + local dir="/opt/${P}" + local exe="${PN}-${SLOT}" + + insinto "${dir}" + doins -r * + fperms 755 "${dir}/bin/${PN}.sh" "${dir}/bin/rinspect.sh" "${dir}/bin/fsnotifier" "${dir}/bin/fsnotifier64" + + newicon "bin/${PN}.png" "${exe}.png" + make_wrapper "${exe}" "/opt/${P}/bin/${PN}.sh" + make_desktop_entry ${exe} "RubyMine ${MY_PV}" "${exe}" "Development;IDE" +} diff --git a/www-apps/gitlabhq/Manifest b/www-apps/gitlabhq/Manifest index 97d642a..16f0762 100644 --- a/www-apps/gitlabhq/Manifest +++ b/www-apps/gitlabhq/Manifest @@ -9,4 +9,3 @@ AUX gitlabhq-8.15.init 2987 SHA256 f72b2d23034a29c958d661feb9f608e138ab65e70a629 AUX gitlabhq-8.16-fix-checks-gentoo.patch 390 SHA256 60324945dfff6d236faf7959a75089a782018b048ba1cb846b91e14109673236 SHA512 0ac979616639fdd9b9534c9e7c0ad3263f39fa10e6858a6c8cf401a3234d5ef20201fd97e2a5a39071dcf98fb7ca7a48b41d18db7689103e996baf65ae9f00ea WHIRLPOOL 98c46a4b4bafeb870425f437506b202c0c836b4df8763a3716d2cf21da73b04ffd0c31a6222317cf22e550a7676b463771038b595c1b2f9d491955dd0a82885a AUX gitlabhq-8.16-fix-sendmail-param.patch 617 SHA256 c0b6db990f5b0fd0c588f2e35eb3aac54ce54d9b41b350e7bcd54336cdc19462 SHA512 4234563b2d8eb5814fd8d9910a50fb867e444052639feebb192bb105471eae9038a076a5288b14e3fbb997311824853bea9d9c4833b4854b7f0252b826f22358 WHIRLPOOL 06f19a23028a6b83dd6ff2f9ec406af5e5f5e2c0a5879ab66585ce7b3d070170e29407c2ab9915c4afb75a23038e178295213db99ac514d865f4c1db57b22774 AUX gitlabhq-8.16.init 2987 SHA256 d8788979fec8a05c241fc692d586537e4715c7894b5d70fd471a701913f19166 SHA512 16922aa485c99c4e30def0fed80ce883ac2786b9714070f84b09c019314deb513b8bfba8906ff67548738c0a039996e000a730bc6ad682fac5b979ebf0132c31 WHIRLPOOL dae5bfa2c77df41afe8b60634f91661dcd48ea7bbcce81fce361d7b4e8117011008f995393a8c6401ba9601c18ba94bd0a60fe5d5ad5a7d5d45b317ca8bf5ab3 -EBUILD gitlabhq-8.16.6.ebuild 15497 SHA256 92801b05ce964ed35348357e6d3c49b58615e26bc405acb2ca5724412689b771 SHA512 dfcc9d3e76e75270097e77371eed66f77cbdf0f09348a288dd86c4e39e91d2e67ae91975343181794cbaa3128593a30eed7e178406b7046a66058f36cd8aecfc WHIRLPOOL d326973d684cf9a63588266a1248f29712b08dbe0a294133bd11b9d1ebcc5745064a72622fc0a49e98b4ed9d52d808b6c916829c7c0df56347febd39ab6c11b4 diff --git a/www-apps/gitlabhq/gitlabhq-8.16.6.ebuild b/www-apps/gitlabhq/gitlabhq-8.16.6.ebuild deleted file mode 100644 index 70a06c4..0000000 --- a/www-apps/gitlabhq/gitlabhq-8.16.6.ebuild +++ /dev/null @@ -1,463 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="5" - -# Mainteiner 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 ruby22" -PYTHON_COMPAT=( python2_7 ) - -EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitlab-ce.git" -EGIT_COMMIT="v${PV}" - -inherit eutils git-2 python-r1 ruby-ng versionator user linux-info - -DESCRIPTION="GitLab is a free project and repository management application" -HOMEPAGE="https://about.gitlab.com/gitlab-ci/" - -LICENSE="MIT" -SLOT=$(get_version_component_range 1-2) -KEYWORDS="~amd64 ~x86 ~arm" -IUSE="memcached mysql +postgres +unicorn" - -## Gems dependencies: -# charlock_holmes dev-libs/icu -# grape, capybara dev-libs/libxml2, dev-libs/libxslt -# json dev-util/ragel -# yajl-ruby dev-libs/yajl -# pygments.rb python 2.5+ -# execjs net-libs/nodejs, or any other JS runtime -# pg dev-db/postgresql-base -# mysql virtual/mysql -# rugged net-libs/http-parser dev-libs/libgit2 -# -GEMS_DEPEND=" - dev-libs/icu - dev-libs/libxml2 - dev-libs/libxslt - dev-util/ragel - dev-libs/yajl - net-libs/nodejs - postgres? ( dev-db/postgresql ) - mysql? ( virtual/mysql ) - memcached? ( net-misc/memcached ) - net-libs/http-parser" -DEPEND="${GEMS_DEPEND} - >=dev-lang/ruby-2.1[readline,ssl] - >dev-vcs/git-2.2.1 - >=dev-vcs/gitlab-shell-4.1.1 - >=www-servers/gitlab-workhorse-1.3.0 - net-misc/curl - virtual/ssh" -RDEPEND="${DEPEND} - >=dev-db/redis-2.8.0 - virtual/mta - virtual/krb5" -ruby_add_bdepend " - virtual/rubygems - >=dev-ruby/bundler-1.0" - -RUBY_PATCHES=( - "${PN}-${SLOT}-fix-checks-gentoo.patch" - "${PN}-${SLOT}-fix-sendmail-param.patch" -) - -GIT_USER="git" -GIT_GROUP="git" -GIT_HOME=$(getent passwd $GIT_USER | cut -d: -f6) -DEST_DIR="/opt/${PN}-${SLOT}" -CONF_DIR="/etc/${PN}-${SLOT}" - -GIT_REPOS="${GIT_HOME}/repositories" -GIT_SATELLITES="${GIT_HOME}/gitlab-satellites" -GITLAB_SHELL="/var/lib/gitlab-shell" -GITLAB_SHELL_HOOKS="${GITLAB_SHELL}/hooks" - -RAILS_ENV=${RAILS_ENV:-production} -RUBY=${RUBY:-ruby21} -BUNDLE="${RUBY} /usr/bin/bundle" - -pkg_setup() { - enewgroup ${GIT_GROUP} - enewuser ${GIT_USER} -1 -1 ${DEST_DIR} "${GIT_GROUP}" -} - -all_ruby_unpack() { - git-2_src_unpack -} - -each_ruby_prepare() { - - # fix path to repo and gitlab-shell hooks - test -d "${GITLAB_SHELL_HOOKS}" || die "Gitlab Shell hooks directory not found: \"${GITLAB_SHELL_HOOKS}. Have you properly installed dev-vcs/gitlab-shell"? - - sed -i \ - -e "s|\(\s*path:\s\)/.*/gitlab-shell/|\1 ${GITLAB_SHELL}/|" \ - -e "s|\(\s*repos_path:\s\)/.*|\1 ${GIT_REPOS}/|" \ - -e "s|\(\s*hooks_path:\s\)/.*|\1 ${GITLAB_SHELL_HOOKS}/|" \ - -e "s|\(\s*path:\s\)/.*/gitlab-satellites/|\1 ${GIT_SATELLITES}/|" \ - -e "s|\(\s*GITLAB_SHELL:\s*\)|\1\n\tpath: \"${GITLAB_SHELL}\"|" \ - config/gitlab.yml.example || die "failed to filter gitlab.yml.example" - - # modify database settings - sed -i \ - -e 's|\(username:\) postgres.*|\1 gitlab|' \ - -e 's|\(password:\).*|\1 gitlab|' \ - -e 's|\(socket:\).*|/run/postgresql/.s.PGSQL.5432|' \ - config/database.yml.postgresql \ - || die "failed to filter database.yml.postgresql" - - # replace "secret" token with random one - local randpw=$(echo ${RANDOM}|sha512sum|cut -c 1-128) - sed -i -e "/secret_token =/ s/=.*/= '${randpw}'/" \ - config/initializers/secret_token.rb \ - || die "failed to filter secret_token.rb" - - # remove needless files - rm .foreman .gitignore Procfile - use unicorn || rm config/unicorn.rb.example - use postgres || rm config/database.yml.postgresql - use mysql || rm config/database.yml.mysql - - # change cache_store - if use memcached; then - sed -i \ - -e "/\w*config.cache_store / s/=.*/= :dalli_store, { namespace: 'gitlab' }/" \ - config/environments/production.rb \ - || die "failed to modify production.rb" - fi - - # Update pathes for unicorn - if use unicorn; then - sed -i \ - -e "s#/home/git/gitlab#${DEST_DIR}#" \ - config/unicorn.rb.example \ - || die "failed to modify unicorn.rb.example" - fi -} - -each_ruby_install() { - local dest="${DEST_DIR}" - local conf="/etc/${PN}-${SLOT}" - local temp="/var/tmp/${PN}-${SLOT}" - local logs="/var/log/${PN}-${SLOT}" - local uploads="${DEST_DIR}/public/uploads" - - ## Prepare directories ## - - diropts -m750 - keepdir "${logs}" - dodir "${temp}" - - diropts -m755 - dodir "${dest}" - dodir "${uploads}" - - dosym "${temp}" "${dest}/tmp" - dosym "${logs}" "${dest}/log" - - ## Link gitlab-shell into git home - dosym "${GITLAB_SHELL}" "${GIT_HOME}/gitlab-shell" - - ## Install configs ## - - # Note that we cannot install the config to /etc and symlink - # it to ${dest} since require_relative in config/application.rb - # seems to get confused by symlinks. So let's install the config - # to ${dest} and create a smylink to /etc/gitlabhq-<VERSION> - dosym "${dest}/config" "${conf}" - - insinto "${dest}/.ssh" - newins "${FILESDIR}/config.ssh" config - - echo "export RAILS_ENV=production" > "${D}/${dest}/.profile" - - ## Install all others ## - - # remove needless dirs - rm -Rf tmp log - - insinto "${dest}" - doins -r ./ - - ## Install logrotate config ## - - dodir /etc/logrotate.d - sed -e "s|@LOG_DIR@|${logs}|" \ - "${FILESDIR}"/gitlab.logrotate > "${D}"/etc/logrotate.d/${PN}-${SLOT} \ - || die "failed to filter gitlab.logrotate" - - ## Install gems via bundler ## - - cd "${D}/${dest}" - - local without="development test thin" - local flag; for flag in memcached mysql postgres unicorn; do - without+="$(use $flag || echo ' '$flag)" - done - local bundle_args="--deployment ${without:+--without ${without}}" - - # Use systemlibs for nokogiri as suggested - ${BUNDLE} config build.nokogiri --use-system-libraries - - # Fix invalid ldflags for charlock_holmes, - # see https://github.com/brianmario/charlock_holmes/issues/32 - ${BUNDLE} config build.charlock_holmes --with-ldflags='-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined -lz -licuuc' - - einfo "Running bundle install ${bundle_args} ..." - ${BUNDLE} install ${bundle_args} || die "bundler failed" - - ## Clean ## - - local gemsdir=vendor/bundle/ruby/$(ruby_rbconfig_value 'ruby_version') - - # remove gems cache - rm -Rf ${gemsdir}/cache - - # fix permissions - fowners -R ${GIT_USER}:${GIT_GROUP} "${dest}" "${conf}" "${temp}" "${logs}" - fperms o+Xr "${temp}" # Let nginx access the unicorn socket - - ## RC scripts ## - local rcscript=${PN}-${SLOT}.init - - cp "${FILESDIR}/${rcscript}" "${T}" || die - sed -i \ - -e "s|@GIT_USER@|${GIT_USER}|" \ - -e "s|@GIT_GROUP@|${GIT_USER}|" \ - -e "s|@SLOT@|${SLOT}|" \ - -e "s|@DEST_DIR@|${dest}|" \ - -e "s|@LOG_DIR@|${logs}|" \ - -e "s|@RESQUE_QUEUE@|${resque_queue}|" \ - "${T}/${rcscript}" \ - || die "failed to filter ${rcscript}" - - if use memcached; then - sed -i -e '/^depend/,// {/need / s/$/ memcached/}' \ - "${T}/${rcscript}" || die "failed to filter ${rcscript}" - fi - - newinitd "${T}/${rcscript}" "${PN}-${SLOT}" -} - -pkg_preinst() { - diropts -m "0750" -o "${GIT_USER}" -g "${GIT_GROUP}" - dodir "${GIT_SATELLITES}" -} - -pkg_postinst() { - if [ ! -e "${GIT_HOME}/.ssh/id_rsa" ]; then - einfo "Generating SSH key for git user" - su -l ${GIT_USER} -s /bin/sh -c " - ssh-keygen -q -N '' -t rsa -f ${GIT_HOME}/.ssh/id_rsa" \ - || die "failed to generate SSH key" - fi - if [ ! -e "${GIT_HOME}/.gitconfig" ]; then - einfo "Setting git user in ${GIT_HOME}/.gitconfig, feel free to " - einfo "modify this file according to your needs!" - su -l ${GIT_USER} -s /bin/sh -c " - git config --global core.autocrlf 'input'; - git config --global gc.auto 0; - git config --global user.email 'gitlab@localhost'; - git config --global user.name 'GitLab'" \ - || die "failed to setup git configuration" - fi - - elog "If this is a new installation, proceed with the following steps:" - elog - elog " 1. Copy ${CONF_DIR}/gitlab.yml.example to ${CONF_DIR}/gitlab.yml" - elog " and edit this file in order to configure your GitLab settings." - elog - elog " 2. Copy ${CONF_DIR}/database.yml.* to ${CONF_DIR}/database.yml" - elog " and edit this file in order to configure your database settings" - elog " for \"production\" environment." - elog - elog " 3. Copy ${CONF_DIR}/initializers/rack_attack.rb.example" - elog " to ${CONF_DIR}/initializers/rack_attack.rb" - elog - elog " 4. Copy ${CONF_DIR}/resque.yml.example to ${CONF_DIR}/resque.yml" - elog " and edit this file in order to configure your Redis settings" - elog " for \"production\" environment." - elog - - if use unicorn; then - elog " 4a. Copy ${CONF_DIR}/unicorn.rb.example to ${CONF_DIR}/unicorn.rb" - elog - fi - - elog " 5. If this is a new installation, create a database for your GitLab instance." - 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 gitlab_production" - elog " Note: You should change your password to something more random..." - elog - elog " GitLab uses polymorphic associations which are not SQL-standard friendly." - elog " To get it work you must use this ugly workaround:" - elog " psql -U postgres -d gitlab" - elog " CREATE CAST (integer AS text) WITH INOUT AS IMPLICIT;" - elog - fi - elog " 6. Execute the following command to finalize your setup:" - elog " emerge --config \"=${CATEGORY}/${PF}\"" - elog " Note: Do not forget to start Redis server." - elog - elog "To update an existing instance, run the following command and choose upgrading when prompted:" - elog " emerge --config \"=${CATEGORY}/${PF}\"" - elog - elog "Important: Do not remove the earlier version prior migration!" - - if linux_config_exists; then - if linux_chkconfig_present PAX ; then - ewarn "Warning: PaX support is enabled, you must disable mprotect for ruby. Otherwise " - ewarn "FFI will trigger mprotect errors that are hard to trace. Please run: " - ewarn " paxctl -m $(which ${RUBY})" - fi - else - einfo "Important: Cannot find a linux kernel configuration, so cannot check for PaX support." - einfo " If CONFIG_PAX is set, you should disable mprotect for ruby since FFI may trigger" - einfo " mprotect errors." - fi -} - -pkg_config() { - - # Ask user whether this is the first installation - einfo "Do you want to upgrade an existing installation? [Y|n] " - do_upgrade="" - while true - do - read -r do_upgrade - if [[ $do_upgrade == "n" || $do_upgrade == "N" ]] ; then do_upgrade="" && break - elif [[ $do_upgrade == "y" || $do_upgrade == "Y" || $do_upgrade == "" ]] ; then do_upgrade=1 && break - else eerror "Please type either \"Y\" or \"N\" ... " ; fi - done - - if [[ $do_upgrade ]] ; then - - LATEST_DEST=$(test -n "${LATEST_DEST}" && echo ${LATEST_DEST} || \ - find /opt -maxdepth 1 -iname 'gitlabhq-*' -and -type d -and -not -iname "gitlabhq-${SLOT}" | \ - sort -r | head -n1) - - if [[ -z "${LATEST_DEST}" || ! -d "${LATEST_DEST}" ]] ; then - einfo "Please enter the path to your latest Gitlab instance:" - while true - do - read -r LATEST_DEST - test -d ${LATEST_DEST} && break ||\ - eerror "Please specify a valid path to your Gitlab instance!" - done - else - einfo "Found your latest Gitlab instance at \"${LATEST_DEST}\"." - fi - - einfo "Please make sure that you've created a backup and stopped your running Gitlab instance: " - elog "\$ cd \"${LATEST_DEST}\" && sudo -u ${GIT_USER} ${BUNDLE} exec rake gitlab:backup:create RAILS_ENV=production" - elog "\$ /etc/init.d/${LATEST_DEST#*/opt/} stop" - elog "" - - einfo "Press ENTER to continue, STRG-C to cancel" - read - - if [[ ${LATEST_DEST} != ${DEST_DIR} ]] ; - then - einfo "Found major update, migrate data from \"$LATEST_DEST\":" - einfo "Migrating uploads ..." - einfo "This will move your uploads from \"$LATEST_DEST\" to \"${DEST_DIR}\", continue? [Y|n] " - migrate_uploads="" - while true - do - read -r migrate_uploads - if [[ $migrate_uploads == "n" || $migrate_uploads == "N" ]] ; then migrate_uploads="" && break - elif [[ $migrate_uploads == "y" || $migrate_uploads == "Y" || $migrate_uploads == "" ]] ; then migrate_uploads=1 && break - else eerror "Please type either \"Y\" or \"N\" ... " ; fi - done - if [[ $migrate_uploads ]] ; then - su -l ${GIT_USER} -s /bin/sh -c " - rm -rf ${DEST_DIR}/public/uploads && \ - mv ${LATEST_DEST}/public/uploads ${DEST_DIR}/public/uploads" \ - || die "failed to migrate uploads." - - # Fix permissions - find "${DEST_DIR}/public/uploads/" -type d -exec chmod 0700 {} \; - fi - - for conf in database.yml gitlab.yml resque.yml unicorn.rb secrets.yml ; do - einfo "Migration config file \"$conf\" ..." - cp -p "${LATEST_DEST}/config/${conf}" "${DEST_DIR}/config/" - sed -s "s#$(basename $LATEST_DEST)#${PN}-${SLOT}#g" -i "${DEST_DIR}/config/$conf" - - example="${DEST_DIR}/config/${conf}.example" - test -f "${example}" && mv "${example}" "${DEST_DIR}/config/._cfg0000_${conf}" - done - CONFIG_PROTECT="${DEST_DIR}" dispatch-conf || die "failed to automatically migrate config, run \"CONFIG_PROTECT=${DEST_DIR} dispatch-conf\" by hand, re-run this routine and skip config migration to proceed." - fi - - einfo "Migrating database ..." - su -l ${GIT_USER} -s /bin/sh -c " - export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 - cd ${DEST_DIR} - ${BUNDLE} exec rake db:migrate RAILS_ENV=production" \ - || die "failed to migrate database." - - einfo "Clear redis cache ..." - su -l ${GIT_USER} -s /bin/sh -c " - export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 - cd ${DEST_DIR} - ${BUNDLE} exec rake cache:clear RAILS_ENV=production" \ - || die "failed to run cache:clear" - - einfo "Clear and precompile assets ..." - su -l ${GIT_USER} -s /bin/sh -c " - export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 - cd ${DEST_DIR} - ${BUNDLE} exec rake assets:clean RAILS_ENV=production - ${BUNDLE} exec rake assets:precompile RAILS_ENV=production" \ - || die "failed to run assets:clean and assets:precompile" - - else - - ## Check config files existence ## - einfo "Checking configuration files ..." - - if [ ! -r "${CONF_DIR}/database.yml" ] ; then - eerror "Copy \"${CONF_DIR}/database.yml.*\" to \"${CONF_DIR}/database.yml\"" - eerror "and edit this file in order to configure your database settings for" - eerror "\"production\" environment." - die - fi - if [ ! -r "${CONF_DIR}/gitlab.yml" ]; then - eerror "Copy \"${CONF_DIR}/gitlab.yml.example\" to \"${CONF_DIR}/gitlab.yml\"" - eerror "and edit this file in order to configure your GitLab settings" - eerror "for \"production\" environment." - die - fi - - einfo "Initializing database ..." - su -l ${GIT_USER} -s /bin/sh -c " - export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 - cd ${DEST_DIR} - ${BUNDLE} exec rake gitlab:setup RAILS_ENV=${RAILS_ENV}" \ - || die "failed to run rake gitlab:setup" - fi - - ## (Re-)Link gitlab-shell-secret into gitlab-shell - if test -L "${GITLAB_SHELL}/.gitlab_shell_secret" - then - rm "${GITLAB_SHELL}/.gitlab_shell_secret" - ln -s "${DEST_DIR}/.gitlab_shell_secret" "${GITLAB_SHELL}/.gitlab_shell_secret" - fi - - einfo "You might want to run the following in order to check your application status:" - einfo "# cd ${DEST_DIR} && sudo -u ${GIT_USER} ${BUNDLE} exec rake gitlab:check RAILS_ENV=production" - einfo "" - einfo "GitLab is prepared, now you should configure your web server." -}