2017-12-21 14:45:35 +01:00
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
2014-03-18 11:00:56 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2016-02-11 11:17:28 +01:00
|
|
|
EAPI="6"
|
2014-03-18 11:00:56 +01:00
|
|
|
|
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}"
|
2016-04-04 11:51:05 +02:00
|
|
|
SRC_URI="https://github.com/hanzz/${MY_PN}/archive/${PV}.tar.gz -> ${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"
|
2016-02-11 11:17:28 +01:00
|
|
|
SLOT="0"
|
2016-02-08 15:14:45 +01:00
|
|
|
IUSE_PLUGINS="frotz irc jabber purple sms twitter"
|
2016-07-20 21:28:26 +02:00
|
|
|
IUSE="debug doc libev mysql postgres sqlite test ${IUSE_PLUGINS}"
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
RDEPEND="${RDEPEND}
|
2017-12-21 14:45:35 +01:00
|
|
|
>=net-im/swiften-3.0
|
2015-01-25 21:10:38 +01:00
|
|
|
dev-libs/boost:=
|
2014-03-18 11:00:56 +01:00
|
|
|
dev-libs/log4cxx
|
2016-12-09 18:14:23 +01:00
|
|
|
dev-libs/openssl:0=
|
2014-03-18 11:00:56 +01:00
|
|
|
dev-libs/popt
|
2016-12-09 18:14:23 +01:00
|
|
|
dev-libs/protobuf:=
|
2014-03-18 11:00:56 +01:00
|
|
|
mysql? ( virtual/mysql )
|
|
|
|
postgres? ( dev-libs/libpqxx )
|
|
|
|
sqlite? ( dev-db/sqlite:3 )
|
2017-12-21 14:45:35 +01:00
|
|
|
irc? ( net-im/libcommuni[qt4] )
|
|
|
|
sms? ( app-mobilephone/smstools )
|
2016-07-20 21:28:26 +02:00
|
|
|
purple? (
|
|
|
|
>=net-im/pidgin-2.6.0
|
|
|
|
libev? ( dev-libs/libev )
|
|
|
|
)"
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
sys-devel/gettext
|
|
|
|
doc? ( app-doc/doxygen )
|
|
|
|
test? ( dev-util/cppunit )
|
|
|
|
"
|
|
|
|
|
|
|
|
REQUIRED_USE="|| ( sqlite mysql postgres )"
|
|
|
|
|
2016-02-08 15:14:45 +01:00
|
|
|
CMAKE_IN_SOURCE_BUILD=1
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
src_configure() {
|
2016-02-08 15:14:45 +01:00
|
|
|
local mycmakeargs=(
|
2016-07-20 21:28:26 +02:00
|
|
|
$(cmake-utils_use_find_package libev event)
|
2016-02-11 12:41:21 +01:00
|
|
|
-DENABLE_MYSQL="$(usex mysql)"
|
|
|
|
-DENABLE_PQXX="$(usex postgres)"
|
|
|
|
-DENABLE_SQLITE3="$(usex sqlite)"
|
|
|
|
-DENABLE_DOCS="$(usex doc)"
|
|
|
|
-DENABLE_FROTZ="$(usex frotz)"
|
|
|
|
-DENABLE_IRC="$(usex irc)"
|
2017-06-10 13:22:14 +02:00
|
|
|
-DENABLE_XMPP="$(usex jabber)"
|
2016-02-11 12:41:21 +01:00
|
|
|
-DENABLE_PURPLE="$(usex purple)"
|
|
|
|
-DENABLE_SMSTOOLS3="$(usex sms)"
|
|
|
|
-DENABLE_TWITTER="$(usex twitter)"
|
2017-12-21 14:45:35 +01:00
|
|
|
-DENABLE_TESTS="$(usex test)"
|
2016-02-08 15:14:45 +01:00
|
|
|
-DLIB_INSTALL_DIR=$(get_libdir)
|
2014-03-18 11:00:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|