Merge branch 'master' into gitlab-8-11-0-rc1

This commit is contained in:
Manuel Friedli 2016-08-09 09:34:40 +02:00
commit 1badaf9cfc
13 changed files with 938 additions and 1 deletions

14
net-im/jabberd2/ChangeLog Normal file
View file

@ -0,0 +1,14 @@
*jabberd2-2.4.0 (07 Aug 2016)
07 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +jabberd2-2.4.0.ebuild:
net-im/jabberd2: added ebuild for jabberd2-2.4.0, as this version is not yet
in the official tree.
*jabberd2-2.3.6 (06 Aug 2016)
06 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +files/jabberd2-2.3.1.pamd,
+files/jabberd2-2.3.2.init, +files/jabberd2-2.3.2.logrotate,
+files/jabberd2-2.3.4-optimization.patch, +jabberd2-2.3.6.ebuild,
+metadata.xml:
net-im/jabberd2: added ebuild for version 2.3.6, which is missing in the
official tree

11
net-im/jabberd2/Manifest Normal file
View file

@ -0,0 +1,11 @@
AUX jabberd2-2.3.1.pamd 158 SHA256 eba4b5cc68b3dd327cfa1afdadbe5adf6d9383f4c79c7661169a4339e40b9a7b SHA512 a52bec9577f028f1141002d0ffaaf11615699a67a7b3677774d7e8aa6595c8291cb6ebcdc0f874e54f700e3b437ae05e05b8d7c8c717dee15cb7d908a954b979 WHIRLPOOL 2289538542300efe78a261285359c6e5ad9151cc01123e3c5579cc72393ce94308d713e38d73bc418c5bc9d7f7a200469568b7b3187b576b3efa8efa19dda919
AUX jabberd2-2.3.2.init 1897 SHA256 a04c000fb56506abadad9df488368c09d34743414336a37d2596b640381aeff6 SHA512 eb91268d9edcfcd3a5610bdd4b9b9abe93f1092bb2bc4a76f47bad29ec1c2afbc74b029115c5c111d8c9a4fbab139366b050a9bee78a870b4e12cbed8511b39b WHIRLPOOL 8695d980c2f2af483815ff8fb2c7c7dbff6cdfb06e31a52c2bc027aa6ef8553fcc513205b2fc7ce5e1cacaffb1a56320303e1dd2853d907e7ba5b41ba7c797df
AUX jabberd2-2.3.2.logrotate 197 SHA256 bca314e2555e113ee0916d33060c27332381cc3cd633e00e3d092b1f7b0bd149 SHA512 1e3d74612dd08df2014af2ae0f0681e78c9902644dfbf37100369591803f2cf757d27967f7e9c99d3503cff8480ace7ce4b14303028d25866ebbd4ecf882d7c0 WHIRLPOOL c74129c39e571b811212e7d08d94c461c327f58510d9efa7cd1c96888524730024330c1c46accaafa7888b75d4af98302a91c35a4543928d0fb5e7eacebe6f2b
AUX jabberd2-2.3.4-optimization.patch 627 SHA256 8a10c307846425d0ca8f987c8f46c1559f57d7fb4a448744a93637ece01577bd SHA512 2f38d9eb597f7bea21082a56eee1e28474cc66b56d5dd7de45853c98a5cdecbe7d1e5ff951b6b1395f7c27a9a2ec13c4552031b711d882fbd946338116b7d83e WHIRLPOOL aa67b5f0cbb50a81b789ced5efd0f22a2b199a4d51d1c242cde17f8317b1c2fe00d54ba0b73654bc0f7dd4fd027df83646afe5401a7f665d174faae163151be5
AUX jabberd2-2.3.6-configure.patch 593 SHA256 39d3cdbcf57ff2247c4ca21cc130f56173a7f0db9f37f71048cae4cd9a043e15 SHA512 15e12903af39209e94b2ee42b802f93d5dc9f5d5f6dc646b65402d4445e046df02fe8150be675024a2b7f4d8f21f2cd2af1976a28c81d429be2e91c3845a327a WHIRLPOOL ef49fd6dd2158804bbd7bb93994089d2f301878ba7dcfa2d93ad77e6c4cbaa52c26e61f6191013b911ca8852f6e3d64faea2fea248dc5ddbcf5f0808cd759faf
DIST jabberd-2.3.6.tar.xz 1503864 SHA256 33cbf58135f856f5e6e6a7769623fedfda21f0c5f88b3b687a22e04ad915c051 SHA512 c5efa443865028874e1c1f15937064edef4c1699afb14b55963e3cd86930a67dffed7830ab1ae77522cbf797ef9ab89d044ccb28ac65904ffa7e79dee155e8aa WHIRLPOOL 43f6c02d67c792fa1391cc87e7f4d60b6fe7089d8dc7796d54e0e25f1815ad29921eeb97aeb554b015261b7e5f83cd33d076abb61e60ff9fe9441971cb85bdcb
DIST jabberd-2.4.0.tar.xz 1507452 SHA256 1101571f4a94d7ec5a82839e9e2abee51f3983e3b9c416f1b7f2f738ebebdee1 SHA512 eb621d2d76806361f54db49d1d3b2be0e0b5559f8ec64bc8ce8cd10f1455e8f4b98395cf790f969cb8ef63f2fa83f5974c5b70aaa82bbe670e1aa15a3d5a0a0b WHIRLPOOL f6e64febfc72e0d18f2063027cc764361601ab379e41bdb27a7d01f35d472a35632203f0905de8d61ef5f633f53dfa950310c20e9d7d8b69b922ed641793721c
EBUILD jabberd2-2.3.6.ebuild 5270 SHA256 59d85fa7b59a21011e080f475ccb69bfdb0aed4b86120e64e746c03e870674db SHA512 091ed958d3e0b0e663965ae7200054f8dc3fcf8665b9232edf04c34b42081f81f80d3a13f18965d74da9ed578a96439f69468518f298fd5c555de8b5522c5274 WHIRLPOOL ddc22f6f4019a5759f8182e3524fdd14bf36083a0537bc7b3bee576845c0ccf92c424e85a806cdc85a7e3f5b5a01d9abd2e5cd26c1744044e231bf44797a8513
EBUILD jabberd2-2.4.0.ebuild 5228 SHA256 80927a0c19c7a97a3f81ba28141c90f5c0c110f661024da9c38b3244879ef865 SHA512 65ae3de033e178598a3401b585c7ba28b2e94ae55e86dc18d526f59f6800128c0ac608ff7723de85c66683a8db37a56ec74b0b2b9046038a96e6657e29462e86 WHIRLPOOL 004d08df2f8b3fdd28bc73628e1a17bbb914bdd8632285f97595b6cc6e2039e72fb8b303f1f88150e3300c6dc5b9cb9bd665706d9554c42c1ed79d764f93a5fa
MISC ChangeLog 561 SHA256 95bb8ede7a41f3fef819599d60791d20af556ffe359bddc402896a0559525151 SHA512 50503af9d2f237d1d0d8d7cbd9aaca46feb6437f8e9a578195753b417c70f75db09c62e9304cab3fe822aa641bb2fba8c8ac9c48ffc415de5b0a5bac177b9584 WHIRLPOOL 813520ed329a67e6f3829414ceb90960d24ecb6839215c41023e15401bcbc872da8a04c33653317bf5ea678993c3e813a42dca1d4fb76c5627ce8e46d3b0f60d
MISC metadata.xml 579 SHA256 70e01bf1f9b621d35d36cfd78ed7f99a214eadeca0dd5031adc86aff077b2023 SHA512 ebaf4fd332d1dede7f0e68e135e14c9e464b04ac22a11af32a43af91af2ec17836165d810e6fe4cab876ea33f120ef00fc9392da2c80b90813e7857c946abcda WHIRLPOOL 84043f101020e6bea68efe9be27c5d08fff6d0f06116c0643ce27b36a146068dadbb235aebe7a2d377dd9c269ece471ab4080fc1589263b315c04941c140dcf6

View file

@ -0,0 +1,6 @@
#%PAM-1.0
auth required pam_nologin.so
auth include system-auth
account include system-auth
session include system-auth

View file

@ -0,0 +1,97 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
extra_commands="reload"
depend() {
need net
use mysql postgresql slapd
provide jabber-server
}
stopJabberServices() {
eindent
for pidfile in /var/run/jabber/*.pid; do
if [ -f "${pidfile}" ]; then
service=$(basename ${pidfile} .pid)
ebegin "Stopping ${service}"
start-stop-daemon \
--stop \
--pidfile ${pidfile}
eend $?
fi
done
eoutdent
}
start_pre() {
checkpath -d -o jabber /var/run/jabber
}
start() {
einfo "Starting Jabber Server ..."
local services executable cfgfile pidfile
services=$(grep -v ^# /etc/jabber/jabberd.cfg | grep '..*' | awk '{print $1 ":" $2}')
eindent
for service in ${services}; do
cfgfile=$(echo ${service} | cut -d ':' -f 2)
service=$(echo ${service} | cut -d ':' -f 1)
if [ ! -f "${cfgfile}" ]; then
if [ -f "/etc/jabber/${service}.xml" ]; then
cfgfile="/etc/jabber/${service}.xml"
else
eerror "Can't find: ${cfgfile} or default /etc/jabber/${service}.xml"
stopJabberServices
return 1
fi
fi
executable=/usr/bin/${service}
if [ ! -f "${executable}" ]; then
eerror "Can't find executable: ${executable}"
stopJabberServices
return 1
fi
ebegin "Starting ${service} (${cfgfile})"
pidfile="$(grep -v ^# ${cfgfile} | grep '<pidfile>' | sed 's#<.\?pidfile>##g')"
start-stop-daemon \
--background \
--start \
--user jabber:jabber \
--exec /usr/bin/${service} \
--pid ${pidfile} \
-- -c ${cfgfile}
eend $?
done
eoutdent
}
reload() {
eindent
for pidfile in /var/run/jabber/*.pid; do
if [ -f "${pidfile}" ]; then
service=$(basename ${pidfile} .pid)
ebegin "Reloading ${service}"
kill -HUP $(cat ${pidfile})
eend $?
fi
done
eoutdent
}
stop() {
einfo "Stopping Jabber Server"
stopJabberServices
}

View file

@ -0,0 +1,8 @@
/var/log/jabber/c2s.log /var/log/jabber/s2s.log /var/log/jabber/sm.log /var/log/jabber/router.log {
su jabber jabber
sharedscripts
missingok
postrotate
/etc/init.d/jabberd reload
endscript
}

View file

@ -0,0 +1,21 @@
Re-allow the use of O3/Os, since it seems to have been an old compiler
bug.
See https://github.com/jabberd2/jabberd2/issues/34
--- configure.ac
+++ configure.ac
@@ -23,13 +23,6 @@
LIBS="$LIBS $lt_cv_dlopen_libs"
fi
-# check for optimisation level
-AC_MSG_CHECKING([CFLAGS optimization level])
-[if echo $CFLAGS | grep '.*-O[3s].*' >/dev/null 2>&1; then]
- AC_MSG_ERROR([maximum allowed optimization level is -O2])
-fi
-AC_MSG_RESULT([fine])
-
# extra paths
AC_ARG_WITH([extra_include_path], AC_HELP_STRING([--with-extra-include-path],
[use additional include paths]),

View file

@ -0,0 +1,15 @@
diff --git a/configure.ac b/configure.ac
index 4f52c86..d481583 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,10 +80,6 @@ if test "x-$want_mio_debug" = "x-yes" ; then
AC_DEFINE(MIO_DEBUG,1,[Define to 1 if you want to enable managed IO debug output.])
fi
-# Colorized build output
-AX_CHECK_COMPILE_FLAG([-fdiagnostics-color], [CFLAGS="${CFLAGS} -fdiagnostics-color"],
- [AX_CHECK_COMPILE_FLAG([-fcolor-diagnostics], [CFLAGS="${CFLAGS} -fcolor-diagnostics"])])
-
# Two-step header checking. First check for headers which don't
# require any other headers.
AC_HEADER_DIRENT

View file

@ -0,0 +1,181 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit autotools db-use eutils flag-o-matic pam
DESCRIPTION="Open Source Jabber Server"
HOMEPAGE="http://jabberd2.org"
SRC_URI="https://github.com/jabberd2/jabberd2/releases/download/jabberd-${PV}/jabberd-${PV}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
IUSE="berkdb debug experimental ldap libressl memdebug mysql pam postgres sqlite ssl test websocket zlib"
REQUIRED_USE="memdebug? ( debug )"
# broken
RESTRICT="test"
DEPEND="dev-libs/expat
net-libs/udns
net-dns/libidn
virtual/gsasl
berkdb? ( >=sys-libs/db-4.1.25:= )
ldap? ( net-nds/openldap )
mysql? (
virtual/libmysqlclient:=
virtual/mysql:=
)
pam? ( virtual/pam )
postgres? ( dev-db/postgresql:= )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0[-bindist] )
libressl? ( dev-libs/libressl:= )
)
sqlite? ( dev-db/sqlite:3 )
websocket? ( net-libs/http-parser:= )
zlib? ( sys-libs/zlib )"
RDEPEND="${DEPEND}
>=net-im/jabber-base-0.01"
DEPEND="${DEPEND}
app-arch/xz-utils
virtual/pkgconfig
test? ( dev-libs/check )"
DOCS=( AUTHORS README )
S=${WORKDIR}/jabberd-${PV}
pkg_pretend() {
if is-flagq '-O[3s]' ; then
ewarn "O3/Os compiler flags have been known to cause problems"
ewarn "with old gcc version. Be aware that this could break"
ewarn "port binding. Make sure to test this."
ewarn "See https://github.com/jabberd2/jabberd2/issues/34"
fi
}
src_prepare() {
# Fix some default directory locations
sed -i \
-e 's,@localstatedir@/@package@/pid/,/var/run/@package@/,g' \
-e 's,@localstatedir@/@package@/run/pbx,/var/run/@package@/pbx,g' \
-e 's,@localstatedir@/@package@/log/,/var/log/@package@/,g' \
-e 's,@localstatedir@/lib/jabberd2/fs,@localstatedir@/@package@/fs,g' \
-e 's,@localstatedir@,/var/spool,g' \
-e 's,@package@,jabber,g' \
etc/{sm,router,c2s,s2s}.xml.dist.in || die "fixing default directory locations failed!"
# If the package wasn't merged with sqlite then default to use berkdb
use sqlite ||
sed -i \
-e 's,<\(module\|driver\)>sqlite<\/\1>,<\1>db</\1>,g' \
etc/{c2s,sm}.xml.dist.in || die "setting berkdb as default failed!"
# avoid file collision with x11-misc/screen-message wrt #453994
sed -i \
-e 's/@jabberd_router_bin@/jabberd2-router/' \
-e 's/@jabberd_c2s_bin@/jabberd2-c2s/' \
-e 's/@jabberd_s2s_bin@/jabberd2-s2s/' \
-e 's/@jabberd_sm_bin@/jabberd2-sm/' \
etc/jabberd*.in || die "fixing file collisions failed!"
# rename pid files wrt #241472
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-c2s\.pid/' \
etc/c2s.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-router\.pid/' \
etc/router.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-s2s\.pid/' \
etc/s2s.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-sm\.pid/' \
etc/sm.xml.dist.in || die
epatch "${FILESDIR}"/${PN}-2.3.4-optimization.patch \
"${FILESDIR}"/${P}-configure.patch
eautoreconf
}
src_configure() {
# --enable-pool-debug is currently broken
econf \
--sysconfdir=/etc/jabber \
$(usex debug "--enable-debug" "") \
$(usex memdebug "--enable-nad-debug" "") \
$(use_enable ssl) \
$(use_enable mysql) \
$(use_enable postgres pgsql) \
$(use_enable sqlite) \
$(use_enable berkdb db) \
$(use_enable ldap) \
$(use_enable pam) \
--enable-pipe \
--enable-anon \
--enable-fs \
$(use_enable websocket) \
$(use_enable experimental) \
$(use_enable test tests) \
$(usex berkdb "--with-extra-include-path=$(db_includedir)" "") \
$(use_with zlib)
}
src_install() {
local i
default
prune_libtool_files --modules
keepdir /var/spool/jabber/{fs,db}
fowners jabber:jabber /usr/bin/{jabberd,router,sm,c2s,s2s} \
/var/spool/jabber/{fs,db}
fperms 770 /var/spool/jabber/{fs,db}
fperms 750 /usr/bin/{jabberd,router,sm,c2s,s2s}
# avoid file collision with x11-misc/screen-message wrt #453994
for i in router sm c2s s2s ; do
einfo "renaming /usr/bin/${i} to /usr/bin/jabberd2-${i}"
mv "${ED%/}"/usr/bin/${i} "${ED%/}"/usr/bin/jabberd2-${i} || die
done
newinitd "${FILESDIR}/${PN}-2.3.2.init" jabberd
newpamd "${FILESDIR}/${PN}-2.3.1.pamd" jabberd
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}-2.3.2.logrotate" jabberd
docompress -x /usr/share/doc/${PF}/tools
docinto tools
dodoc tools/db-setup{.mysql,.pgsql,.sqlite} \
tools/{migrate-jd14dir-2-sqlite.pl,pipe-auth.pl}
# remove useless upstart files wrt #498900
rm -rf "${ED%/}"/usr/etc
}
pkg_postinst() {
if use pam; then
echo
ewarn 'Jabberd-2 PAM authentication requires your unix usernames to'
ewarn 'be in the form of "contactname@jabberdomain". This behavior'
ewarn 'is likely to change in future versions of jabberd-2. It may'
ewarn 'be advisable to avoid PAM authentication for the time being.'
echo
fi
if use sqlite || use mysql || use postgres; then
echo
einfo "You will need to setup or update your database using the"
einfo "scripts in /usr/share/doc/${PF}/tools/"
echo
fi
ewarn 'If you are upgrading from <=jabberd2-2.2.17 then you might have'
ewarn 'to update /etc/jabber/jabberd.cfg via etc-update because'
ewarn 'the binaries have been renamed to avoid file collisions!'
}

View file

@ -0,0 +1,180 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit autotools db-use eutils flag-o-matic pam
DESCRIPTION="Open Source Jabber Server"
HOMEPAGE="http://jabberd2.org"
SRC_URI="https://github.com/jabberd2/jabberd2/releases/download/jabberd-${PV}/jabberd-${PV}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
IUSE="berkdb debug experimental ldap libressl memdebug mysql pam postgres sqlite ssl test websocket zlib"
REQUIRED_USE="memdebug? ( debug )"
# broken
RESTRICT="test"
DEPEND="dev-libs/expat
net-libs/udns
net-dns/libidn
virtual/gsasl
berkdb? ( >=sys-libs/db-4.1.25:= )
ldap? ( net-nds/openldap )
mysql? (
virtual/libmysqlclient:=
virtual/mysql:=
)
pam? ( virtual/pam )
postgres? ( dev-db/postgresql:= )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0[-bindist] )
libressl? ( dev-libs/libressl:= )
)
sqlite? ( dev-db/sqlite:3 )
websocket? ( net-libs/http-parser:= )
zlib? ( sys-libs/zlib )"
RDEPEND="${DEPEND}
>=net-im/jabber-base-0.01"
DEPEND="${DEPEND}
app-arch/xz-utils
virtual/pkgconfig
test? ( dev-libs/check )"
DOCS=( AUTHORS README )
S=${WORKDIR}/jabberd-${PV}
pkg_pretend() {
if is-flagq '-O[3s]' ; then
ewarn "O3/Os compiler flags have been known to cause problems"
ewarn "with old gcc version. Be aware that this could break"
ewarn "port binding. Make sure to test this."
ewarn "See https://github.com/jabberd2/jabberd2/issues/34"
fi
}
src_prepare() {
# Fix some default directory locations
sed -i \
-e 's,@localstatedir@/@package@/pid/,/var/run/@package@/,g' \
-e 's,@localstatedir@/@package@/run/pbx,/var/run/@package@/pbx,g' \
-e 's,@localstatedir@/@package@/log/,/var/log/@package@/,g' \
-e 's,@localstatedir@/lib/jabberd2/fs,@localstatedir@/@package@/fs,g' \
-e 's,@localstatedir@,/var/spool,g' \
-e 's,@package@,jabber,g' \
etc/{sm,router,c2s,s2s}.xml.dist.in || die "fixing default directory locations failed!"
# If the package wasn't merged with sqlite then default to use berkdb
use sqlite ||
sed -i \
-e 's,<\(module\|driver\)>sqlite<\/\1>,<\1>db</\1>,g' \
etc/{c2s,sm}.xml.dist.in || die "setting berkdb as default failed!"
# avoid file collision with x11-misc/screen-message wrt #453994
sed -i \
-e 's/@jabberd_router_bin@/jabberd2-router/' \
-e 's/@jabberd_c2s_bin@/jabberd2-c2s/' \
-e 's/@jabberd_s2s_bin@/jabberd2-s2s/' \
-e 's/@jabberd_sm_bin@/jabberd2-sm/' \
etc/jabberd*.in || die "fixing file collisions failed!"
# rename pid files wrt #241472
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-c2s\.pid/' \
etc/c2s.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-router\.pid/' \
etc/router.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-s2s\.pid/' \
etc/s2s.xml.dist.in || die
sed -i \
-e '/pidfile/s/${id}\.pid/jabberd2-sm\.pid/' \
etc/sm.xml.dist.in || die
epatch "${FILESDIR}"/${PN}-2.3.6-configure.patch
eautoreconf
}
src_configure() {
# --enable-pool-debug is currently broken
econf \
--sysconfdir=/etc/jabber \
$(usex debug "--enable-debug" "") \
$(usex memdebug "--enable-nad-debug" "") \
$(use_enable ssl) \
$(use_enable mysql) \
$(use_enable postgres pgsql) \
$(use_enable sqlite) \
$(use_enable berkdb db) \
$(use_enable ldap) \
$(use_enable pam) \
--enable-pipe \
--enable-anon \
--enable-fs \
$(use_enable websocket) \
$(use_enable experimental) \
$(use_enable test tests) \
$(usex berkdb "--with-extra-include-path=$(db_includedir)" "") \
$(use_with zlib)
}
src_install() {
local i
default
prune_libtool_files --modules
keepdir /var/spool/jabber/{fs,db}
fowners jabber:jabber /usr/bin/{jabberd,router,sm,c2s,s2s} \
/var/spool/jabber/{fs,db}
fperms 770 /var/spool/jabber/{fs,db}
fperms 750 /usr/bin/{jabberd,router,sm,c2s,s2s}
# avoid file collision with x11-misc/screen-message wrt #453994
for i in router sm c2s s2s ; do
einfo "renaming /usr/bin/${i} to /usr/bin/jabberd2-${i}"
mv "${ED%/}"/usr/bin/${i} "${ED%/}"/usr/bin/jabberd2-${i} || die
done
newinitd "${FILESDIR}/${PN}-2.3.2.init" jabberd
newpamd "${FILESDIR}/${PN}-2.3.1.pamd" jabberd
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}-2.3.2.logrotate" jabberd
docompress -x /usr/share/doc/${PF}/tools
docinto tools
dodoc tools/db-setup{.mysql,.pgsql,.sqlite} \
tools/{migrate-jd14dir-2-sqlite.pl,pipe-auth.pl}
# remove useless upstart files wrt #498900
rm -rf "${ED%/}"/usr/etc
}
pkg_postinst() {
if use pam; then
echo
ewarn 'Jabberd-2 PAM authentication requires your unix usernames to'
ewarn 'be in the form of "contactname@jabberdomain". This behavior'
ewarn 'is likely to change in future versions of jabberd-2. It may'
ewarn 'be advisable to avoid PAM authentication for the time being.'
echo
fi
if use sqlite || use mysql || use postgres; then
echo
einfo "You will need to setup or update your database using the"
einfo "scripts in /usr/share/doc/${PF}/tools/"
echo
fi
ewarn 'If you are upgrading from <=jabberd2-2.2.17 then you might have'
ewarn 'to update /etc/jabber/jabberd.cfg via etc-update because'
ewarn 'the binaries have been renamed to avoid file collisions!'
}

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>manuel@fritteli.ch</email>
<name>Manuel Friedli</name>
</maintainer>
<use>
<flag name="experimental">Enable experimental features such as TLS Everywhere.</flag>
<flag name="memdebug">Enable nad and pool debug. Requires USE="debug" to be set.</flag>
<flag name="websocket">Enable WebSocket support on C2S port.</flag>
</use>
<upstream>
<remote-id type="github">jabberd2/jabberd2</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,3 +1,8 @@
*gitlab-ce-8.10.4 (05 Aug 2016)
05 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.10.4.ebuild:
www-apps/gitlab-ce: added ebuild for version 8.10.4
*gitlab-ce-8.10.3 (02 Aug 2016) *gitlab-ce-8.10.3 (02 Aug 2016)
02 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.10.3.ebuild: 02 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.10.3.ebuild:

View file

@ -10,11 +10,13 @@ AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c1
DIST gitlab-ce-8.10.1.tar.gz 21035550 SHA256 8fe9c994b87f4ef819b14c8149b07a594a8f624285e6f80f888a63978b3c9ef8 SHA512 00d762c65d24cdebe05b3a31e9577500f437c0c64711c121b3967a9ebf3f711dc94cf08e8cc3fe1a3919236acce019e149ce1c64dd8ad0f43d9f298b9d76a167 WHIRLPOOL c3bfe435b8018c0488e760d115c6a290a13f8eaebd900201a807a386a62a0aeace04e4e7daa24f500347676b5aab760efbcbb1daf252aaefd6a73033b382a4fb DIST gitlab-ce-8.10.1.tar.gz 21035550 SHA256 8fe9c994b87f4ef819b14c8149b07a594a8f624285e6f80f888a63978b3c9ef8 SHA512 00d762c65d24cdebe05b3a31e9577500f437c0c64711c121b3967a9ebf3f711dc94cf08e8cc3fe1a3919236acce019e149ce1c64dd8ad0f43d9f298b9d76a167 WHIRLPOOL c3bfe435b8018c0488e760d115c6a290a13f8eaebd900201a807a386a62a0aeace04e4e7daa24f500347676b5aab760efbcbb1daf252aaefd6a73033b382a4fb
DIST gitlab-ce-8.10.2.tar.gz 21038115 SHA256 71cba117f895beb96278b81ec09d60d46189f71024cb2e1db14628206d64c26e SHA512 d9fccb2530357835e647ecbbd04e825154cb9b780c4d67210b3cd5598418e377af90046c10a1b192e8b4ea99b77ad0b6ac734e237360c4c179338003ce24463f WHIRLPOOL bfe3eb27576a31d5abcc1bb60824ce06feb78c1c15b0a94a514707ba536db0d37be00db0ebc3a6c83b0533b0bfb80d01e9bcd851545703ea4ac398a12e6fc866 DIST gitlab-ce-8.10.2.tar.gz 21038115 SHA256 71cba117f895beb96278b81ec09d60d46189f71024cb2e1db14628206d64c26e SHA512 d9fccb2530357835e647ecbbd04e825154cb9b780c4d67210b3cd5598418e377af90046c10a1b192e8b4ea99b77ad0b6ac734e237360c4c179338003ce24463f WHIRLPOOL bfe3eb27576a31d5abcc1bb60824ce06feb78c1c15b0a94a514707ba536db0d37be00db0ebc3a6c83b0533b0bfb80d01e9bcd851545703ea4ac398a12e6fc866
DIST gitlab-ce-8.10.3.tar.gz 21039284 SHA256 4d00eab29d24e03b36e61d74544cccda0eb3acccbe09efb91b9670d70116f74b SHA512 e66c5a5919352c78f8fbb983dc17d5ba5e39bed7e335b031d599eb827315c4253ee59d2955ba50df9c3923003595519ee4bfd4e67dfd0c6bd4d47c61ac576350 WHIRLPOOL 38cf4cdaf4c89529f345c5eb2723fbeb986012d5f3e8732d9d527c6497a1ddfb124806888759d9f256c57e13b1be843ef7d0a6f8725ab89bb4e5b45a9c080805 DIST gitlab-ce-8.10.3.tar.gz 21039284 SHA256 4d00eab29d24e03b36e61d74544cccda0eb3acccbe09efb91b9670d70116f74b SHA512 e66c5a5919352c78f8fbb983dc17d5ba5e39bed7e335b031d599eb827315c4253ee59d2955ba50df9c3923003595519ee4bfd4e67dfd0c6bd4d47c61ac576350 WHIRLPOOL 38cf4cdaf4c89529f345c5eb2723fbeb986012d5f3e8732d9d527c6497a1ddfb124806888759d9f256c57e13b1be843ef7d0a6f8725ab89bb4e5b45a9c080805
DIST gitlab-ce-8.10.4.tar.gz 21039911 SHA256 cce5d0cce05cacc260baeda3014bf192b931d897fb72588cc91c2eff15481db6 SHA512 d89aa1b91b7584b45c63aff6aea646b261415e15e95bcdbd3c3a9dd8ce127fa3a4fd22e15d9464d3b572bc2ba202f6ee518d1937515d8d69d435c5cb59835080 WHIRLPOOL 0929eb1703771c57292cbc5711091d84c22b4fe960cfaa5e8714f101622197bff65ee3f1d7a0619daa4a9acd2d1dc6ce3bf35153045a22c43623ed5b3413d661
DIST gitlab-ce-8.9.6.tar.gz 21555571 SHA256 1b357ed1157a2a20b647004f588b67d72416df805a385fa7b605905bafb26f55 SHA512 d4693cdc80fff44e2f2d2e640163337b153ee08fbd12cefd055c8a595e1487010f7c0db39a11056577d331d3a76cc7da9936139199aad324d9c324395f684f9a WHIRLPOOL 00474d385cd9b574bbef0847f80613253f4543c54b356ab654b0ca3e7233e056efbe995a9de3e418c68d482d4a2b9b0cf676941c7013755bd795bfe83c9766aa DIST gitlab-ce-8.9.6.tar.gz 21555571 SHA256 1b357ed1157a2a20b647004f588b67d72416df805a385fa7b605905bafb26f55 SHA512 d4693cdc80fff44e2f2d2e640163337b153ee08fbd12cefd055c8a595e1487010f7c0db39a11056577d331d3a76cc7da9936139199aad324d9c324395f684f9a WHIRLPOOL 00474d385cd9b574bbef0847f80613253f4543c54b356ab654b0ca3e7233e056efbe995a9de3e418c68d482d4a2b9b0cf676941c7013755bd795bfe83c9766aa
EBUILD gitlab-ce-8.10.1.ebuild 11676 SHA256 18467061975ce0212ddb08cb12b4d2d9f2da6f7999e9d42dd249d96891326318 SHA512 ee1538902ef35fe4f771211eacd0c7fb81aaa81c4b18049111eead6a5ada19318763165245e3e6d05fd41490e0ee4d30ab6fcc946b35e31e1a3f41b200cc46c9 WHIRLPOOL cfad8b037071a70bedf8095cd29cd27d2c703dc9470f4ee943860716e01e7347e78cd9a6612c44fd749a8cb06d6979376493606ab941266ce732e285dc7e3edc EBUILD gitlab-ce-8.10.1.ebuild 11676 SHA256 18467061975ce0212ddb08cb12b4d2d9f2da6f7999e9d42dd249d96891326318 SHA512 ee1538902ef35fe4f771211eacd0c7fb81aaa81c4b18049111eead6a5ada19318763165245e3e6d05fd41490e0ee4d30ab6fcc946b35e31e1a3f41b200cc46c9 WHIRLPOOL cfad8b037071a70bedf8095cd29cd27d2c703dc9470f4ee943860716e01e7347e78cd9a6612c44fd749a8cb06d6979376493606ab941266ce732e285dc7e3edc
EBUILD gitlab-ce-8.10.2.ebuild 11677 SHA256 d131e1f22e6ab5d5dfbeca80128ce0838631c82f71cb7f11dbf58d3aec9c2ed6 SHA512 e2530f1f2f2b31ebd4a6adcfacb512d4579baaf69aa2adfb7fd8fd9408966d5454cebdf4441ebc016ff89fa2dbe61ec19239f6e39844e0d3b0a44ec0f73d3cf4 WHIRLPOOL 30d1aa4d499013205953c70210edf6962a4da78ce3c1d11c98d2b048eb57e2d45991a4a2dda34c5c5269dc077ae67cbee76e4859b1c0897b6377673a6f451fb4 EBUILD gitlab-ce-8.10.2.ebuild 11677 SHA256 d131e1f22e6ab5d5dfbeca80128ce0838631c82f71cb7f11dbf58d3aec9c2ed6 SHA512 e2530f1f2f2b31ebd4a6adcfacb512d4579baaf69aa2adfb7fd8fd9408966d5454cebdf4441ebc016ff89fa2dbe61ec19239f6e39844e0d3b0a44ec0f73d3cf4 WHIRLPOOL 30d1aa4d499013205953c70210edf6962a4da78ce3c1d11c98d2b048eb57e2d45991a4a2dda34c5c5269dc077ae67cbee76e4859b1c0897b6377673a6f451fb4
EBUILD gitlab-ce-8.10.3.ebuild 11677 SHA256 1d2e22b1611203ad6d2fe3752a9cffceee7568a876c5b650cb52d12f089e4dbb SHA512 3784835943745d42c5f086b5183c2947c903fd67a19569a6fdd903a68f55fbc09fdd7d667e0fa0fca9871bd299587759f7bb133edba2135eb260e91f16ac6a59 WHIRLPOOL af68d6b67236e8bd683f070e97c4277997822ec9b8bcfa4ac0a4c54edfd470e5fff107d8a5ae2017b1f70f5a4f2c845f6bc40caf9387030540b823c380ff03f2 EBUILD gitlab-ce-8.10.3.ebuild 11677 SHA256 1d2e22b1611203ad6d2fe3752a9cffceee7568a876c5b650cb52d12f089e4dbb SHA512 3784835943745d42c5f086b5183c2947c903fd67a19569a6fdd903a68f55fbc09fdd7d667e0fa0fca9871bd299587759f7bb133edba2135eb260e91f16ac6a59 WHIRLPOOL af68d6b67236e8bd683f070e97c4277997822ec9b8bcfa4ac0a4c54edfd470e5fff107d8a5ae2017b1f70f5a4f2c845f6bc40caf9387030540b823c380ff03f2
EBUILD gitlab-ce-8.10.4.ebuild 11677 SHA256 d6ed052547aebde8708b4624c3a522ea66e86afdde950d2ec8704659c3bf2ce2 SHA512 ca3348dc51e1214f13746ce7d681fd8202dd46f742bb30a040970e467c589be132375fdcf57b5780e61b9179a244075f4f5537e49442025caee6e46c2a073dba WHIRLPOOL 5a2bd77a585a32103d699e3f4d99eef6f3659dc316217a80b7b2937d0ed93365784299724156546df09ff6aa7ee01c962359a4c89a22fe8e94aef8027b6839a9
EBUILD gitlab-ce-8.9.6.ebuild 12341 SHA256 a46bb7c78639ee411a8c0994847f4f90a89133f2d85e7eb71f76f9f6756e5c25 SHA512 19712bb3ece7873e9dc2a5d471512a553108b95338bd370dab8dfac6695da34ee713d4d106c62de1472eab7e3e953471ad6274f7d646900e7ef2c7521460211b WHIRLPOOL 1cdff895e32079e2bd85863d46a3c6c0f39590e454f7c77d058f7403341ab39adf477005a9c6c417ec7ca527bffedf0ec1ec3b3f64cb242c3b2d3404c41b6e8f EBUILD gitlab-ce-8.9.6.ebuild 12341 SHA256 a46bb7c78639ee411a8c0994847f4f90a89133f2d85e7eb71f76f9f6756e5c25 SHA512 19712bb3ece7873e9dc2a5d471512a553108b95338bd370dab8dfac6695da34ee713d4d106c62de1472eab7e3e953471ad6274f7d646900e7ef2c7521460211b WHIRLPOOL 1cdff895e32079e2bd85863d46a3c6c0f39590e454f7c77d058f7403341ab39adf477005a9c6c417ec7ca527bffedf0ec1ec3b3f64cb242c3b2d3404c41b6e8f
EBUILD gitlab-ce-9999.ebuild 12344 SHA256 cd17ceba505495a7633f8f106d2adc1ee81b74d2b09f8a83cccb0010600f8005 SHA512 c961866f01e626855cddc928c14c8f4a8aa4285dd04e87d1bc310b02c7617dce73c93e5b670650a86c075c4adcdd6b4c3489feb4c204d0474a8e993f3e000440 WHIRLPOOL 11159c64d381f201fa33941bbe7f549ca368a16ebc7e1087b286a8a375e687073e1c586e02411e4a2b50ca74835bf1e81ca069eedefaee483ac3deb20f51fa05 EBUILD gitlab-ce-9999.ebuild 12344 SHA256 cd17ceba505495a7633f8f106d2adc1ee81b74d2b09f8a83cccb0010600f8005 SHA512 c961866f01e626855cddc928c14c8f4a8aa4285dd04e87d1bc310b02c7617dce73c93e5b670650a86c075c4adcdd6b4c3489feb4c204d0474a8e993f3e000440 WHIRLPOOL 11159c64d381f201fa33941bbe7f549ca368a16ebc7e1087b286a8a375e687073e1c586e02411e4a2b50ca74835bf1e81ca069eedefaee483ac3deb20f51fa05
MISC ChangeLog 4090 SHA256 106927f5f5c0ffaa2ab86ea0b2421e32d8f22d7a0912f2d69471656b375a85b8 SHA512 534b6f45bfe2a2612b0af6e8d614717386091c7b8306e1538959d39c85ee60d4f4abb3512f3bbe3baa4bb8cedb05692cd1f7002194202917e5b0d0e5d62d26b7 WHIRLPOOL abc2d05705c514ba0196dce14af15ff0e4338bc317083bf9e45a6b486cc913811c4dfe3f650d400777a3151313fc6c758c9a871eb7a435299e6b0d2327e4c453 MISC ChangeLog 4256 SHA256 a479147a06e20424997924d628c409da666e605f0780ecbafd4bbd5b49a4757c SHA512 41ea9e9582644e2240e678b59b89dabc18d5bec3da6c3c9fe5d72ed93809a4908a5f1f49592cc58dd7113d23d607927fb454f80fd70c4f3321586f787bd204e2 WHIRLPOOL 9e4c601967578e89dd3fe4d2eef58b688751c55a8fe7b843ea9c8d12d1bf3c0c6d11856c22809756955b5446a62cdd697b13594eba51bd37ad4cc4cd3ad58036
MISC metadata.xml 545 SHA256 1b7fc44d811e1ab7638fe4a40253f49d5f1071872d3020c22c4f67662750cb2f SHA512 86f47d297892bccfefa087d93936296f5647993a9ec8e3f47907a6859cbf385e5bc6f00502d7836c9e8d9efef2b6725bf145b0150924c2082b2bd164469ef6ea WHIRLPOOL 6bfb8a55684d68c8bfa6e025a0be965f7b815394ee0896dd2a13cfb524e3cf3f3149acc9072897e30a1842060389576aac07ea8beb4a8b0bfc3e8eab3723f2a1 MISC metadata.xml 545 SHA256 1b7fc44d811e1ab7638fe4a40253f49d5f1071872d3020c22c4f67662750cb2f SHA512 86f47d297892bccfefa087d93936296f5647993a9ec8e3f47907a6859cbf385e5bc6f00502d7836c9e8d9efef2b6725bf145b0150924c2082b2bd164469ef6ea WHIRLPOOL 6bfb8a55684d68c8bfa6e025a0be965f7b815394ee0896dd2a13cfb524e3cf3f3149acc9072897e30a1842060389576aac07ea8beb4a8b0bfc3e8eab3723f2a1

View file

@ -0,0 +1,381 @@
# 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"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="942d997cf3c596e0b1fc8ac0b750d40afffa57e4"
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.2.1
>=dev-vcs/git-2.7.4
~dev-vcs/gitlab-workhorse-0.7.8
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=(
"${PN}-8.7.5-fix-sendmail-config.patch"
"${PN}-8.9.1-fix-redis-config-path.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
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/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
}
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
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
local update=false
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 $@"
}