gentoo/net-im/spectrum/spectrum-9999.ebuild

99 lines
2.4 KiB
Bash
Raw Normal View History

2015-01-25 21:10:38 +01:00
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
2015-08-21 16:02:53 +02:00
# $Id$
EAPI="5"
inherit cmake-utils systemd versionator
2015-12-15 15:09:13 +01:00
MY_PN="spectrum2"
if [[ ${PV} = "9999" ]] ; then
EGIT_REPO_URI="git://github.com/hanzz/${MY_PN}.git"
inherit git-r3
KEYWORDS=""
else
RESTRICT="mirror"
MY_PV=$(replace_version_separator '_' '-')
MY_P="${MY_PN}-${MY_PV}"
SRC_URI="https://github.com/downloads/hanzz/${MY_PN}/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"
KEYWORDS="~amd64 ~x86"
fi
DESCRIPTION="Spectrum is a XMPP transport/gateway"
HOMEPAGE="http://spectrum.im"
LICENSE="GPL-2"
SLOT="2"
IUSE_PLUGINS="frotz irc jabber purple skype sms twitter"
IUSE="debug doc libev mysql postgres sqlite test ${IUSE_PLUGINS}"
RDEPEND="${RDEPEND}
<net-im/swift-9999[ssl]
2015-01-25 21:10:38 +01:00
dev-libs/boost:=
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
}