2015-01-25 21:10:38 +01:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2014-03-18 11:00:56 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-21 16:02:53 +02:00
|
|
|
# $Id$
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
EAPI="5"
|
|
|
|
|
2015-11-21 09:03:40 +01:00
|
|
|
inherit cmake-utils systemd versionator
|
2014-03-18 11:00:56 +01:00
|
|
|
|
2015-12-15 15:09:13 +01:00
|
|
|
MY_PN="spectrum2"
|
|
|
|
|
2014-03-18 11:00:56 +01:00
|
|
|
if [[ ${PV} = "9999" ]] ; then
|
2015-11-21 09:03:40 +01:00
|
|
|
EGIT_REPO_URI="git://github.com/hanzz/${MY_PN}.git"
|
2014-03-18 11:00:56 +01:00
|
|
|
inherit git-r3
|
|
|
|
KEYWORDS=""
|
|
|
|
else
|
|
|
|
RESTRICT="mirror"
|
|
|
|
MY_PV=$(replace_version_separator '_' '-')
|
|
|
|
MY_P="${MY_PN}-${MY_PV}"
|
2015-11-21 09:03:40 +01:00
|
|
|
SRC_URI="https://github.com/downloads/hanzz/${MY_PN}/${MY_P}.tar.gz"
|
2014-03-18 11:00:56 +01:00
|
|
|
S="${WORKDIR}/${MY_P}"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DESCRIPTION="Spectrum is a XMPP transport/gateway"
|
|
|
|
HOMEPAGE="http://spectrum.im"
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="2"
|
2015-11-11 09:39:06 +01:00
|
|
|
IUSE_PLUGINS="frotz irc jabber purple skype sms twitter"
|
2014-03-18 11:00:56 +01:00
|
|
|
IUSE="debug doc libev mysql postgres sqlite test ${IUSE_PLUGINS}"
|
|
|
|
|
|
|
|
RDEPEND="${RDEPEND}
|
2016-01-21 00:07:26 +01:00
|
|
|
=net-im/swift-9999[ssl]
|
2015-01-25 21:10:38 +01:00
|
|
|
dev-libs/boost:=
|
2014-03-18 11:00:56 +01:00
|
|
|
dev-libs/libev
|
|
|
|
dev-libs/log4cxx
|
|
|
|
dev-libs/openssl
|
|
|
|
dev-libs/popt
|
|
|
|
dev-libs/protobuf
|
|
|
|
mysql? ( virtual/mysql )
|
|
|
|
postgres? ( dev-libs/libpqxx )
|
|
|
|
sqlite? ( dev-db/sqlite:3 )
|
|
|
|
irc? ( net-im/communi )
|
|
|
|
purple? ( >=net-im/pidgin-2.6.0 )
|
|
|
|
skype? ( dev-libs/dbus-glib x11-base/xorg-server[xvfb] net-im/skype )
|
|
|
|
libev? ( dev-libs/libev )
|
|
|
|
"
|
|
|
|
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
dev-util/cmake
|
|
|
|
sys-devel/gettext
|
|
|
|
doc? ( app-doc/doxygen )
|
|
|
|
test? ( dev-util/cppunit )
|
|
|
|
"
|
|
|
|
|
|
|
|
REQUIRED_USE="|| ( sqlite mysql postgres )"
|
|
|
|
|
|
|
|
pkg_setup() {
|
|
|
|
CMAKE_IN_SOURCE_BUILD=1
|
|
|
|
use debug && CMAKE_BUILD_TYPE=Debug
|
|
|
|
MYCMAKEARGS="-DLIB_INSTALL_DIR=$(get_libdir)"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
mycmakeargs=(
|
|
|
|
$(cmake-utils_use_enable mysql MYSQL)
|
|
|
|
$(cmake-utils_use_enable postgres PQXX)
|
|
|
|
$(cmake-utils_use_enable sqlite SQLITE3)
|
|
|
|
$(cmake-utils_use_enable doc DOCS)
|
|
|
|
$(cmake-utils_use_enable frotz FROTZ)
|
|
|
|
$(cmake-utils_use_enable irc IRC)
|
|
|
|
$(cmake-utils_use_enable jabber SWIFTEN)
|
|
|
|
$(cmake-utils_use_enable purple PURPLE)
|
|
|
|
$(cmake-utils_use_enable skype SKYPE)
|
|
|
|
$(cmake-utils_use_enable sms SMSTOOLS3)
|
|
|
|
$(cmake-utils_use_enable twitter TWITTER)
|
|
|
|
)
|
|
|
|
|
|
|
|
cmake-utils_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
cmake-utils_src_install
|
|
|
|
|
|
|
|
newinitd "${FILESDIR}"/spectrum2.initd spectrum2
|
|
|
|
systemd_dotmpfilesd "${FILESDIR}"/systemd/spectrum2.conf
|
|
|
|
keepdir "${EPREFIX}"/var/lib/spectrum2
|
|
|
|
keepdir "${EPREFIX}"/var/log/spectrum2
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
chown jabber:jabber -R "/etc/spectrum2" || die
|
|
|
|
chown jabber:jabber -R "${EPREFIX}/var/lib/spectrum2" || die
|
|
|
|
chown jabber:jabber -R "${EPREFIX}/var/log/spectrum2" || die
|
|
|
|
chmod 750 "/etc/spectrum2" || die
|
|
|
|
chmod 750 "${EPREFIX}/var/lib/spectrum2" || die
|
|
|
|
chmod 750 "${EPREFIX}/var/log/spectrum2" || die
|
|
|
|
}
|