[net-im/spectrum2] rename to match with tree
This commit is contained in:
13
net-im/spectrum2/files/remove_debug_cflags.patch
Normal file
13
net-im/spectrum2/files/remove_debug_cflags.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
--- a/CMakeLists.txt 2018-04-27 12:27:02.000000000 +0200
|
||||
+++ b/CMakeLists.txt 2018-04-29 18:17:42.157170288 +0200
|
||||
@@ -399,10 +399,6 @@
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
- if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
- ADD_DEFINITIONS(-O0)
|
||||
- ADD_DEFINITIONS(-ggdb)
|
||||
- endif()
|
||||
ADD_DEFINITIONS(-DDEBUG)
|
||||
message("Debug : yes")
|
||||
else(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
47
net-im/spectrum2/files/spectrum2.initd
Normal file
47
net-im/spectrum2/files/spectrum2.initd
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/bin/spectrum2_manager"
|
||||
command_group="spectrum"
|
||||
command_user="spectrum"
|
||||
name="Spectrum2 Transport"
|
||||
shell="/bin/sh"
|
||||
su="/bin/su"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting ${name}"
|
||||
"${su}" "${command_user}" -c "${command} start" -s "${shell}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
# Ensure /run/spectrum2 dir is owned by spectrum user.
|
||||
# spectrum2_manager stores pidfiles of individual services here.
|
||||
# See security related comment at the bottom.
|
||||
checkpath -d -o "${command_user}:${command_group}" -q "/run/spectrum2"
|
||||
}
|
||||
|
||||
status() {
|
||||
ebegin "Status ${name}"
|
||||
"${su}" "${command_user}" -c "${command} status" -s "${shell}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${name}"
|
||||
"${su}" "${command_user}" -c "${command} stop" -s "${shell}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
# Andrey Utkin <andrey_utkin@gentoo.org> (24 Nov 2018)
|
||||
# Conrad Kostecki <conrad@kostecki.com> (24 Nov 2018)
|
||||
# We are aware of many security issues caused by careless chowning, see
|
||||
# http://michael.orlitzky.com/articles/end_root_chowning_now_(make_etc-init.d_great_again).xhtml
|
||||
# We believe none of these issues apply.
|
||||
# These pidfiles are not read by any privileged process.
|
||||
# checkpath here chowns only the dir itself and doesn't act recursively.
|
||||
12
net-im/spectrum2/files/spectrum2.service
Normal file
12
net-im/spectrum2/files/spectrum2.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Spectrum2 Transport
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/spectrum2_manager start
|
||||
ExecStop=/usr/bin/spectrum2_manager stop
|
||||
User=spectrum
|
||||
Group=spectrum
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1
net-im/spectrum2/files/spectrum2.tmpfiles
Normal file
1
net-im/spectrum2/files/spectrum2.tmpfiles
Normal file
@@ -0,0 +1 @@
|
||||
d /run/spectrum2 0700 specturm spectrum - -
|
||||
130
net-im/spectrum2/spectrum2-9999.ebuild
Normal file
130
net-im/spectrum2/spectrum2-9999.ebuild
Normal file
@@ -0,0 +1,130 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 )
|
||||
|
||||
inherit cmake-utils python-single-r1 systemd user
|
||||
|
||||
if [[ ${PV} = "9999" ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/SpectrumIM/${PN}.git"
|
||||
inherit git-r3
|
||||
KEYWORDS=""
|
||||
else
|
||||
RESTRICT="mirror"
|
||||
SRC_URI="https://github.com/SpectrumIM/spectrum2/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
fi
|
||||
|
||||
DESCRIPTION="An open source instant messaging transport"
|
||||
HOMEPAGE="https://www.spectrum.im"
|
||||
|
||||
LICENSE="GPL-2+"
|
||||
SLOT="0"
|
||||
IUSE="debug doc frotz irc mysql postgres purple sms +sqlite test twitter whatsapp xmpp"
|
||||
REQUIRED_USE="|| ( mysql postgres sqlite )"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/boost:=
|
||||
dev-libs/expat
|
||||
dev-libs/libev:=
|
||||
dev-libs/log4cxx
|
||||
dev-libs/jsoncpp:=
|
||||
dev-libs/openssl:0=
|
||||
dev-libs/popt
|
||||
dev-libs/protobuf:=
|
||||
net-dns/libidn:0=
|
||||
net-im/swift:=
|
||||
net-misc/curl
|
||||
sys-libs/zlib:=
|
||||
frotz? ( !games-engines/frotz )
|
||||
irc? ( net-im/libcommuni )
|
||||
mysql? (
|
||||
|| (
|
||||
dev-db/mariadb-connector-c
|
||||
dev-db/mysql-connector-c
|
||||
)
|
||||
)
|
||||
postgres? ( dev-libs/libpqxx:= )
|
||||
purple? (
|
||||
dev-libs/glib
|
||||
net-im/pidgin:=
|
||||
)
|
||||
sms? ( app-mobilephone/smstools )
|
||||
sqlite? ( dev-db/sqlite:3 )
|
||||
twitter? ( net-misc/curl )
|
||||
whatsapp? ( net-im/transwhat )"
|
||||
|
||||
DEPEND="
|
||||
${PYTHON_DEPS}
|
||||
${RDEPEND}
|
||||
doc? ( app-doc/doxygen )
|
||||
test? (
|
||||
dev-python/sleekxmpp[${PYTHON_USEDEP}]
|
||||
dev-util/cppunit
|
||||
net-irc/ngircd
|
||||
)
|
||||
"
|
||||
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/remove_debug_cflags.patch"
|
||||
)
|
||||
|
||||
# Tests are currently restricted, as they do completly fail
|
||||
RESTRICT="test"
|
||||
|
||||
pkg_setup() {
|
||||
enewgroup spectrum
|
||||
enewuser spectrum -1 -1 /var/lib/spectrum2 spectrum
|
||||
|
||||
use test && python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# Respect users LDFLAGS
|
||||
sed -i -e "s/-Wl,-export-dynamic/& ${LDFLAGS}/" spectrum/src/CMakeLists.txt || die
|
||||
|
||||
# Respect users CFLAGS, when compiling for debug mode
|
||||
cmake-utils_src_prepare
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use debug && CMAKE_BUILD_TYPE="Debug"
|
||||
|
||||
local mycmakeargs=(
|
||||
-DENABLE_DOCS="$(usex doc)"
|
||||
-DENABLE_FROTZ="$(usex frotz)"
|
||||
-DENABLE_IRC="$(usex irc)"
|
||||
-DENABLE_MYSQL="$(usex mysql)"
|
||||
-DENABLE_PQXX="$(usex postgres)"
|
||||
-DENABLE_PURPLE="$(usex purple)"
|
||||
-DENABLE_SMSTOOLS3="$(usex sms)"
|
||||
-DENABLE_SQLITE3="$(usex sqlite)"
|
||||
-DENABLE_TESTS="$(usex test)"
|
||||
-DENABLE_TWITTER="$(usex twitter)"
|
||||
-DENABLE_XMPP="$(usex xmpp)"
|
||||
-DLIB_INSTALL_DIR="$(get_libdir)"
|
||||
)
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_test() {
|
||||
cd tests/libtransport && "${EPYTHON}" ../start.py || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
|
||||
diropts -o spectrum -g spectrum
|
||||
keepdir /var/log/spectrum2 /var/lib/spectrum2
|
||||
diropts
|
||||
|
||||
newinitd "${FILESDIR}"/spectrum2.initd spectrum2
|
||||
systemd_newunit "${FILESDIR}"/spectrum2.service spectrum2.service
|
||||
systemd_newtmpfilesd "${FILESDIR}"/spectrum2.tmpfiles spectrum2.conf
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
Reference in New Issue
Block a user