blob: 9e88eacb8bfc41208bc8d2dd45a7282410ecbbb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
inherit cmake-utils ${VCS_ECLASS} git-2
DESCRIPTION="Spectrum is an XMPP transport/gateway"
HOMEPAGE="http://spectrum.im"
EGIT_REPO_URI="git://github.com/hanzz/libtransport.git"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE_PLUGINS="frotz irc purple skype smstools"
IUSE="debug doc libev libressl log mysql postgres sqlite staticport symlinks test tools ${IUSE_PLUGINS}"
RDEPEND="net-im/jabber-base
net-im/swiften
dev-libs/popt
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
log? ( dev-libs/log4cxx )
mysql? ( virtual/mysql )
postgres? ( dev-libs/libpqxx )
sqlite? ( dev-db/sqlite:3 )
frotz? ( dev-libs/protobuf )
irc? ( <net-im/libcommuni-3 dev-libs/protobuf )
purple? ( >=net-im/pidgin-2.6.0 dev-libs/protobuf )
skype? ( dev-libs/dbus-glib x11-base/xorg-server[xvfb] dev-libs/protobuf )
libev? ( dev-libs/libev dev-libs/protobuf )"
# TODO unlock libcommuni-3 when merged https://github.com/hanzz/libtransport/pull/50
DEPEND="${RDEPEND}
sys-devel/gettext
dev-util/cmake
doc? ( app-doc/doxygen )
test? ( dev-util/cppunit )
"
REQUIRED_USE="|| ( sqlite mysql postgres )"
PROTOCOL_LIST="aim facebook gg icq irc msn msn_pecan myspace qq simple sipe twitter xmpp yahoo"
pkg_setup() {
CMAKE_IN_SOURCE_BUILD=1
use debug && CMAKE_BUILD_TYPE=Debug
MYCMAKEARGS="-DLIB_INSTALL_DIR=$(get_libdir)"
}
src_prepare() {
use sqlite || { sed -i -e 's/find_package(sqlite3)/set(SQLITE3_FOUND FALSE)/' CMakeLists.txt || die; }
use mysql || { sed -i -e 's/find_package(mysql)/set(MYSQL_FOUND FALSE)/' CMakeLists.txt || die; }
use postgres || { sed -i -e 's/find_package(pqxx)/set(PQXX_FOUND FALSE)/' CMakeLists.txt || die; }
use test || { sed -i -e 's/find_package(cppunit)/set(CPPUNIT_FOUND FALSE)/' CMakeLists.txt || die; }
use doc || { sed -i -e 's/find_package(Doxygen)/set(DOXYGEN_FOUND FALSE)/' CMakeLists.txt || die; }
use purple || { sed -i -e '/find_package(purple)/d' CMakeLists.txt || die; }
use libev || { sed -i -e 's/find_package(event)/set(HAVE_EVENT FALSE)/' CMakeLists.txt || die; }
use irc || { sed -i -e 's/find_package(Communi)/set(IRC_FOUND, FALSE)/' CMakeLists.txt || die; }
use log || { sed -i -e 's/find_package(log4cxx)/set(LOG4CXX_FOUND, FALSE)/' CMakeLists.txt || die; }
cmake-utils_src_prepare
}
src_install() {
cmake-utils_src_install
cat "${FILESDIR}"/spectrum2.initd | sed "s:EPREFIX:${EPREFIX}:" > \
"${WORKDIR}/initd"
newinitd "${WORKDIR}/initd" spectrum
keepdir "${EPREFIX}"/var/lib/spectrum2
keepdir "${EPREFIX}"/var/log/spectrum2
}
pkg_postinst() {
# Set correct rights
chown jabber:jabber -R "/etc/spectrum2"
chown jabber:jabber "${EPREFIX}"/var/lib/spectrum2
chown jabber:jabber "${EPREFIX}"/var/log/spectrum2
}
|