my private gentoo overlay
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo/net-im/spectrum/spectrum-9999.ebuild

94 lines
2.3 KiB

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
inherit cmake-utils systemd versionator
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/swiften-3.0
dev-libs/boost:=
dev-libs/log4cxx
dev-libs/openssl:0=
dev-libs/popt
dev-libs/protobuf:=
mysql? ( virtual/mysql )
postgres? ( dev-libs/libpqxx )
sqlite? ( dev-db/sqlite:3 )
irc? ( net-im/libcommuni[qt4] )
sms? ( app-mobilephone/smstools )
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_XMPP="$(usex jabber)"
-DENABLE_PURPLE="$(usex purple)"
-DENABLE_SMSTOOLS3="$(usex sms)"
-DENABLE_TWITTER="$(usex twitter)"
-DENABLE_TESTS="$(usex test)"
-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
}