[net-im/spectrum] sync with PR (i have to rename this package at some point)

This commit is contained in:
Robert Förster 2018-11-12 03:04:42 +01:00
parent a644fb10f6
commit 38f8861377
2 changed files with 46 additions and 42 deletions

View File

@ -1,35 +1,31 @@
#!/sbin/openrc-run #!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation # Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
SPECTRUM2_GROUP="spectrum" command="/usr/bin/${RC_SVCNAME}_manager"
SPECTRUM2_MANAGER="/usr/bin/spectrum2_manager" command_args="start"
SPECTRUM2_USER="spectrum" command_background="true"
command_group="spectrum"
command_user="spectrum"
name="Spectrum2 Transport"
pidfile="/run/${RC_SVCNAME}/${RC_SVCNAME}_manager.pid"
depend() { depend() {
need net need net
} }
start() {
ebegin "Starting Spectrum2 Transport"
start-stop-daemon --start --group ${SPECTRUM2_GROUP} --user ${SPECTRUM2_USER} \
--exec ${SPECTRUM2_MANAGER} start
eend $?
}
start_pre() { start_pre() {
checkpath -d -o ${SPECTRUM2_USER}:${SPECTRUM2_GROUP} -q /run/spectrum2 checkpath -d -o "${command_user}:${command_group}" -q "/run/${RC_SVCNAME}"
} }
status() { status() {
ebegin "Status Spectrum2 Transport" ebegin "Status Spectrum2 Transport"
${SPECTRUM2_MANAGER} status ${command} status
eend $? eend $?
} }
stop() { stop() {
ebegin "Stopping Spectrum2 Transport" ebegin "Stopping Spectrum2 Transport"
start-stop-daemon --start --group ${SPECTRUM2_GROUP} --user ${SPECTRUM2_USER} \ ${command} stop
--exec ${SPECTRUM2_MANAGER} stop
eend $? eend $?
} }

View File

@ -1,7 +1,7 @@
# Copyright 1999-2018 Gentoo Foundation # Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI="6" EAPI=6
inherit cmake-utils user inherit cmake-utils user
@ -20,36 +20,45 @@ HOMEPAGE="https://www.spectrum.im"
LICENSE="GPL-2+" LICENSE="GPL-2+"
SLOT="0" SLOT="0"
IUSE="debug doc frotz irc mysql postgres purple sms +sqlite test twitter xmpp" IUSE="debug doc frotz irc mysql postgres purple sms +sqlite test twitter whatsapp xmpp"
REQUIRED_USE="|| ( mysql postgres sqlite )" REQUIRED_USE="|| ( mysql postgres sqlite )"
DEPEND="dev-libs/boost:= DEPEND_RDEPEND="
dev-libs/boost:=
dev-libs/expat dev-libs/expat
dev-libs/log4cxx dev-libs/log4cxx
dev-libs/jsoncpp:= dev-libs/jsoncpp:=
dev-libs/openssl:0= dev-libs/openssl:0=
dev-libs/popt dev-libs/popt
dev-libs/protobuf:= dev-libs/protobuf:=
net-dns/libidn net-dns/libidn:0=
net-misc/curl net-misc/curl
sys-libs/zlib sys-libs/zlib:=
doc? ( app-doc/doxygen )
frotz? ( !games-engines/frotz ) frotz? ( !games-engines/frotz )
irc? ( net-im/libcommuni ) irc? ( net-im/libcommuni )
mysql? ( || ( dev-db/mariadb-connector-c dev-db/mysql-connector-c ) ) mysql? ( || ( dev-db/mariadb-connector-c dev-db/mysql-connector-c ) )
postgres? ( dev-db/postgresql:= ) postgres? ( dev-db/postgresql:= )
purple? ( dev-libs/glib purple? ( dev-libs/glib
dev-libs/libev dev-libs/libev:=
net-im/pidgin ) net-im/pidgin:= )
sms? ( app-mobilephone/smstools ) sms? ( app-mobilephone/smstools )
sqlite? ( dev-db/sqlite:3 ) sqlite? ( dev-db/sqlite:3 )
test? ( dev-util/cppunit )
twitter? ( net-misc/curl ) twitter? ( net-misc/curl )
xmpp? ( net-im/swift:=[ft] )" whatsapp? ( net-im/transwhat )
xmpp? ( net-im/swift:= )"
RDEPEND="${DEPEND}" DEPEND="
${DEPEND_RDEPEND}
doc? ( app-doc/doxygen )
test? ( dev-util/cppunit )
"
PATCHES=( "${FILESDIR}/remove_debug_cflags.patch" "${FILESDIR}/use_qt5_libcommuni.patch" ) RDEPEND="${DEPEND_BOTH}"
PATCHES=(
"${FILESDIR}/remove_debug_cflags.patch"
"${FILESDIR}/use_qt5_libcommuni.patch"
)
pkg_setup() { pkg_setup() {
enewgroup spectrum enewgroup spectrum
@ -68,22 +77,20 @@ src_prepare() {
} }
src_configure() { src_configure() {
if use debug; then use debug && CMAKE_BUILD_TYPE="Debug"
CMAKE_BUILD_TYPE="Debug"
fi
local mycmakeargs=( local mycmakeargs=(
-DENABLE_DOCS="$(usex doc)" \ -DENABLE_DOCS="$(usex doc)"
-DENABLE_FROTZ="$(usex frotz)" \ -DENABLE_FROTZ="$(usex frotz)"
-DENABLE_IRC="$(usex irc)" \ -DENABLE_IRC="$(usex irc)"
-DENABLE_MYSQL="$(usex mysql)" \ -DENABLE_MYSQL="$(usex mysql)"
-DENABLE_PQXX="$(usex postgres)" \ -DENABLE_PQXX="$(usex postgres)"
-DENABLE_PURPLE="$(usex purple)" \ -DENABLE_PURPLE="$(usex purple)"
-DENABLE_SMSTOOLS3="$(usex sms)" \ -DENABLE_SMSTOOLS3="$(usex sms)"
-DENABLE_SQLITE3="$(usex sqlite)" \ -DENABLE_SQLITE3="$(usex sqlite)"
-DENABLE_TESTS="$(usex test)" \ -DENABLE_TESTS="$(usex test)"
-DENABLE_TWITTER="$(usex twitter)" \ -DENABLE_TWITTER="$(usex twitter)"
-DENABLE_XMPP="$(usex xmpp)" \ -DENABLE_XMPP="$(usex xmpp)"
-DLIB_INSTALL_DIR="$(get_libdir)" -DLIB_INSTALL_DIR="$(get_libdir)"
) )
@ -97,6 +104,7 @@ src_install() {
diropts -o spectrum -g spectrum diropts -o spectrum -g spectrum
keepdir /var/log/spectrum2 /var/lib/spectrum2 keepdir /var/log/spectrum2 /var/lib/spectrum2
diropts
newinitd "${FILESDIR}"/spectrum2.initd spectrum2 newinitd "${FILESDIR}"/spectrum2.initd spectrum2
} }