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

93 lines
2.2 KiB
Bash
Raw Normal View History

# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
2015-08-21 16:02:53 +02:00
# $Id$
EAPI="6"
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/hanzz/${MY_PN}/archive/${PV}.tar.gz -> ${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="0"
IUSE_PLUGINS="frotz irc jabber purple sms twitter"
IUSE="debug doc libev mysql postgres sqlite test ${IUSE_PLUGINS}"
RDEPEND="${RDEPEND}
>=net-im/swift-3.0
2015-01-25 21:10:38 +01:00
dev-libs/boost:=
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 )
libev? ( dev-libs/libev )
"
DEPEND="${RDEPEND}
sys-devel/gettext
doc? ( app-doc/doxygen )
test? ( dev-util/cppunit )
"
REQUIRED_USE="|| ( sqlite mysql postgres )"
CMAKE_IN_SOURCE_BUILD=1
src_configure() {
local mycmakeargs=(
$(cmake-utils_use_find_package libev event)
-DENABLE_MYSQL="$(usex mysql)"
-DENABLE_PQXX="$(usex postgres)"
-DENABLE_SQLITE3="$(usex sqlite)"
-DENABLE_DOCS="$(usex doc)"
-DENABLE_FROTZ="$(usex frotz)"
-DENABLE_IRC="$(usex irc)"
-DENABLE_SWIFTEN="$(usex jabber)"
-DENABLE_PURPLE="$(usex purple)"
-DENABLE_SMSTOOLS3="$(usex sms)"
-DENABLE_TWITTER="$(usex twitter)"
-DLIB_INSTALL_DIR=$(get_libdir)
)
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
}