From de49812990871e1705b64051c35161d5e6400269 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 24 Dec 2018 14:11:38 +0000 Subject: gentoo resync : 24.12.2018 --- net-im/spectrum2/Manifest | 8 ++ .../spectrum2-2.0.9-remove_debug_cflags.patch | 13 +++ .../files/spectrum2-2.0.9-use_qt5_libcommuni.patch | 54 +++++++++ net-im/spectrum2/files/spectrum2.initd | 47 ++++++++ net-im/spectrum2/files/spectrum2.service | 12 ++ net-im/spectrum2/files/spectrum2.tmpfiles | 1 + net-im/spectrum2/metadata.xml | 30 +++++ net-im/spectrum2/spectrum2-2.0.9.ebuild | 125 +++++++++++++++++++++ 8 files changed, 290 insertions(+) create mode 100644 net-im/spectrum2/Manifest create mode 100644 net-im/spectrum2/files/spectrum2-2.0.9-remove_debug_cflags.patch create mode 100644 net-im/spectrum2/files/spectrum2-2.0.9-use_qt5_libcommuni.patch create mode 100644 net-im/spectrum2/files/spectrum2.initd create mode 100644 net-im/spectrum2/files/spectrum2.service create mode 100644 net-im/spectrum2/files/spectrum2.tmpfiles create mode 100644 net-im/spectrum2/metadata.xml create mode 100644 net-im/spectrum2/spectrum2-2.0.9.ebuild (limited to 'net-im/spectrum2') diff --git a/net-im/spectrum2/Manifest b/net-im/spectrum2/Manifest new file mode 100644 index 000000000000..c3c49e373f72 --- /dev/null +++ b/net-im/spectrum2/Manifest @@ -0,0 +1,8 @@ +AUX spectrum2-2.0.9-remove_debug_cflags.patch 376 BLAKE2B 21a4c230d57398d8ce5ff39cd1ad103fa1f7df332b88cf0024e2a505ecf9be7378da99eb83941122d5cf6a835bff9dfa7b9a10a2583299c91d8506dccc548c85 SHA512 3ec75a4ae915b7d2e2aa594fafcc559aa8b09b5cb8948931797088340d722bfb074ac8e0f77fea1258a7b2c3f0816d001aee63b4fd7cc334927a8431fb6a5611 +AUX spectrum2-2.0.9-use_qt5_libcommuni.patch 2428 BLAKE2B d6f377f9ac1d99d5af51a60d5b837bca6acd3d88c4b6cef9716f1f74198c3b5f2e3c4e153be9094c0af1b315f03b3e50c49fc9c93f262a76a0d137636e142b33 SHA512 fc08e37256782db97f7e067d6a3a51f1244c9f0610f69900711d706e6fa50591e200451432ee99691d899a2e6e95c987baa56d3708f2fd172524865dd07a51e5 +AUX spectrum2.initd 1332 BLAKE2B ee4a9f62ccb909bb824df485dc56c59fe935e77dcfc0354b94749a577b9121352bd56e5d0adbae161da1afc7c451d18b36689844429b46fe39b2e364ffd8c363 SHA512 d780066a00144f3ec20311b462fd29986a486af7ce5ae88e788113397d6cb6ab0800119a5d71077216ee1637ff49cd2307e9265545357b4de50bf907c80feb9c +AUX spectrum2.service 222 BLAKE2B 58227bb8d49dac2a43d41d9a1e16b9ad804fb540a1e37fc0ec58e23e7412c5a9e0a931fe41d37430be5b77d0bc33fc17870b885995185e29a7ccd2da73022dc8 SHA512 c50d83e6afadc798b90f4df5b2f473031dadb8e32dff0c1120dc2345a3fe37a86566d6d975d22d310e0dd6d2c602d674f6a17f4df2e730e71aaf484a30aa97c2 +AUX spectrum2.tmpfiles 44 BLAKE2B c0cef689f5b483d16461bf50edbe8a17c8269440a43a3ccf04c45e028704ad4861e7bd340b85b0daf11b5e41a51e19fd04f2dcd1f2446e00b9a6a3b1e08d2206 SHA512 b995bf8c97a98dc6c887d6d4bb4b53cfee85461cfe65770013d2a412729d164894201ad0e3b69868b94c159ecd524d7bd0eccfedbc27c81969c3ed640ae32785 +DIST spectrum2-2.0.9.tar.gz 842688 BLAKE2B 32cdb95c161aa97338895fb144200ac94d200aefb58300a8f55b03457b3aae1a0ef4a60311f0e2be8e3f3e331625d04ecd61a9583d07794c4398762e1348b939 SHA512 f111133d3d327619ebbeeaa8c329b09dbdbef9c66ec7bc06eb6eac8c54e144cbf2d81d2751699bf97ae1d1bf0a94581f3971394a7f06b9a4d69f6248f1497982 +EBUILD spectrum2-2.0.9.ebuild 2901 BLAKE2B c0dedfd2f7693469ce936daf90ce512546239343a387a453798e5c48e964b886df8355d0716c6e447a8bf378098994ca403f35b271a7e3a742b81ab15a44a844 SHA512 2f9c427748e3ccbeac88986e82b83ed785b6f950a04ba18fc6049309e494b9f4f9bd0d72df2eb7757eba80a07e6f3431479a3bce86bd00537f3ae734ef172f07 +MISC metadata.xml 1259 BLAKE2B e885a8348122a70994d3b04387d64fa88d2e02075554849d427f18b2b39b6ae1eeab543066cd587031f8eae9842f0d727f297d7b6cbe744c8d1424d9fb3640ce SHA512 be2129a4b76017ce3d84aa48589d54ac3863e1d9b7a1aa2a5d98341f962bda3f2e9507497056add0b4f280545ed0c511c8f50eff35d46cf9cadd2c6fba7b5ed6 diff --git a/net-im/spectrum2/files/spectrum2-2.0.9-remove_debug_cflags.patch b/net-im/spectrum2/files/spectrum2-2.0.9-remove_debug_cflags.patch new file mode 100644 index 000000000000..19e3b83d2300 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2-2.0.9-remove_debug_cflags.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt 2018-09-17 09:46:40.000000000 +0200 ++++ b/CMakeLists.txt 2018-09-20 21:04:29.000000000 +0200 +@@ -384,10 +384,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) diff --git a/net-im/spectrum2/files/spectrum2-2.0.9-use_qt5_libcommuni.patch b/net-im/spectrum2/files/spectrum2-2.0.9-use_qt5_libcommuni.patch new file mode 100644 index 000000000000..27e23db44848 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2-2.0.9-use_qt5_libcommuni.patch @@ -0,0 +1,54 @@ +--- a/CMakeLists.txt 2018-09-17 09:46:40.000000000 +0200 ++++ b/CMakeLists.txt 2018-09-20 20:57:35.000000000 +0200 +@@ -182,8 +182,7 @@ + if(ENABLE_IRC) + find_package(Communi) + +- INCLUDE(FindQt4) +- FIND_PACKAGE(Qt4 COMPONENTS QtCore QtNetwork) ++ FIND_PACKAGE(Qt5 COMPONENTS Core Network) + # ADD_DEFINITIONS(${SWIFTEN_CFLAGS}) + ADD_DEFINITIONS(-DSUPPORT_LEGACY_CAPS) + # ADD_DEFINITIONS(-DBOOST_FILESYSTEM_VERSION=2) +@@ -321,7 +320,6 @@ + message("IRC plugin : yes") + include_directories(${QT_QTNETWORK_INCLUDE_DIR}) + include_directories(${IRC_INCLUDE_DIR}) +- include(${QT_USE_FILE}) + else() + if(ENABLE_IRC) + message("IRC plugin : no (install libCommuni and libprotobuf-dev)") +--- a/backends/libcommuni/CMakeLists.txt 2018-09-17 09:46:40.000000000 +0200 ++++ b/backends/libcommuni/CMakeLists.txt 2018-09-20 20:59:31.000000000 +0200 +@@ -1,14 +1,14 @@ + cmake_minimum_required(VERSION 2.6) + FILE(GLOB SRC *.cpp) + FILE(GLOB HEADERS *.h) +-QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) +-add_definitions(-DQT_NO_KEYWORDS) ++QT5_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) + ADD_EXECUTABLE(spectrum2_libcommuni_backend ${SRC}) ++include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}) + + if (NOT WIN32) +- target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport pthread) ++ target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt5::Network Qt5::Core transport pthread) + else () +- target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport) ++ target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt5::Network Qt5::Core transport) + endif() + INSTALL(TARGETS spectrum2_libcommuni_backend RUNTIME DESTINATION bin) + +--- a/cmake_modules/FindCommuni.cmake 2018-09-17 09:46:40.000000000 +0200 ++++ b/cmake_modules/FindCommuni.cmake 2018-09-20 21:00:04.000000000 +0200 +@@ -1,8 +1,7 @@ +-find_package(Qt4) +-include( ${QT_USE_FILE} ) ++find_package(Qt5Network) + + FIND_LIBRARY(IRC_LIBRARY NAMES IrcCore PATHS ${QT_LIBRARY_DIR}) +-FIND_PATH(IRC_INCLUDE_DIR NAMES "IrcCore/ircglobal.h" PATHS ${QT_INCLUDE_DIR} PATH_SUFFIXES Communi) ++FIND_PATH(IRC_INCLUDE_DIR NAMES "IrcCore/ircglobal.h" PATHS ${Qt5Core_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS}"/.." PATH_SUFFIXES Communi) + + # message( STATUS ${IRC_LIBRARY}) + if( IRC_LIBRARY AND IRC_INCLUDE_DIR ) diff --git a/net-im/spectrum2/files/spectrum2.initd b/net-im/spectrum2/files/spectrum2.initd new file mode 100644 index 000000000000..8a35dbe75bc9 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2.initd @@ -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 (24 Nov 2018) +# Conrad Kostecki (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. diff --git a/net-im/spectrum2/files/spectrum2.service b/net-im/spectrum2/files/spectrum2.service new file mode 100644 index 000000000000..9d5b72315ef5 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2.service @@ -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 diff --git a/net-im/spectrum2/files/spectrum2.tmpfiles b/net-im/spectrum2/files/spectrum2.tmpfiles new file mode 100644 index 000000000000..4ce6f1c3ca75 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2.tmpfiles @@ -0,0 +1 @@ +d /run/spectrum2 0700 specturm spectrum - - diff --git a/net-im/spectrum2/metadata.xml b/net-im/spectrum2/metadata.xml new file mode 100644 index 000000000000..d7eb552115dc --- /dev/null +++ b/net-im/spectrum2/metadata.xml @@ -0,0 +1,30 @@ + + + + + ck+gentoo@bl4ckb0x.de + Conrad Kostecki + + + proxy-maint@gentoo.org + Proxy Maintainers + + + andrey_utkin@gentoo.org + Andrey Utkin + + + Spectrum is an open source instant messaging transport. + It allows users to chat together even when they are using + different IM networks. It acts as a transport layer between + the users as showed in the animation above. + + + Enables the Z-Engine backend. + Enables the IRC backend, based on net-im/libcommuni. + Enables the libpurple backend, based on net-im/pidgin. + Enables the SMS backend, based on app-mobilephone/smstools. + Enables the WhatsApp backend, based on net-im/transwhat. + Enables the Twitter backend. + + diff --git a/net-im/spectrum2/spectrum2-2.0.9.ebuild b/net-im/spectrum2/spectrum2-2.0.9.ebuild new file mode 100644 index 000000000000..5533572a03cf --- /dev/null +++ b/net-im/spectrum2/spectrum2-2.0.9.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2018 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 + +DESCRIPTION="An open source instant messaging transport" +HOMEPAGE="https://www.spectrum.im" +SRC_URI="https://github.com/SpectrumIM/spectrum2/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" +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}/${P}-remove_debug_cflags.patch" + "${FILESDIR}/${P}-use_qt5_libcommuni.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 + # Since Spectrum2 searches for a qt4 compiled libcommuni, + # it must be patched, to find the qt5 compiled libcommuni, + # See: https://github.com/SpectrumIM/spectrum2/pull/253 + 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 +} -- cgit v1.2.3