diff --git a/net-im/biboumi/biboumi-8.3.ebuild b/net-im/biboumi/biboumi-8.3.ebuild new file mode 100644 index 0000000..5bff430 --- /dev/null +++ b/net-im/biboumi/biboumi-8.3.ebuild @@ -0,0 +1,67 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Biboumi is an XMPP <-> IRC gateway" +HOMEPAGE="https://lab.louiz.org/louiz/biboumi" +EGIT_REPO_URI="https://lab.louiz.org/louiz/biboumi.git" + +if [[ "$PV" != "9999" ]] ; then + EGIT_COMMIT="$PV" + PATCHES=( + "${FILESDIR}/001-CMAKE-empty-string.patch" + ) +fi + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="" +IUSE="postgres sqlite ssl" + +DEPEND=" +dev-libs/expat +net-dns/c-ares +net-dns/libidn:0 +net-im/jabber-base +net-libs/udns +virtual/libiconv +ssl? ( dev-libs/botan:2 ) +postgres? ( dev-db/postgresql:* ) +sqlite? ( dev-db/sqlite ) +" +RDEPEND="${DEPEND}" + +inherit git-r3 cmake-utils + +DIRS="/var/log/biboumi /var/lib/biboumi" + +src_configure() { + local mycmakeargs=( + -DWITH_POSTGRESQL="$(usex postgres)" + -DWITHOUT_POSTGRESQL="$(usex !postgres)" + -DWITH_SQLITE3="$(usex sqlite)" + -DWITHOUT_SQLITE3="$(usex !sqlite)" + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + newinitd "${FILESDIR}/${PN}".initd "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}".logrotate "${PN}" + for dir in $DIRS + do + keepdir $dir + done +} + +pkg_postinst() { + for dir in $DIRS + do + chown jabber:jabber $dir + chmod u=rwx,g=rx,o= $dir + done +} diff --git a/net-im/biboumi/biboumi-9999.ebuild b/net-im/biboumi/biboumi-9999.ebuild new file mode 100644 index 0000000..5bff430 --- /dev/null +++ b/net-im/biboumi/biboumi-9999.ebuild @@ -0,0 +1,67 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Biboumi is an XMPP <-> IRC gateway" +HOMEPAGE="https://lab.louiz.org/louiz/biboumi" +EGIT_REPO_URI="https://lab.louiz.org/louiz/biboumi.git" + +if [[ "$PV" != "9999" ]] ; then + EGIT_COMMIT="$PV" + PATCHES=( + "${FILESDIR}/001-CMAKE-empty-string.patch" + ) +fi + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="" +IUSE="postgres sqlite ssl" + +DEPEND=" +dev-libs/expat +net-dns/c-ares +net-dns/libidn:0 +net-im/jabber-base +net-libs/udns +virtual/libiconv +ssl? ( dev-libs/botan:2 ) +postgres? ( dev-db/postgresql:* ) +sqlite? ( dev-db/sqlite ) +" +RDEPEND="${DEPEND}" + +inherit git-r3 cmake-utils + +DIRS="/var/log/biboumi /var/lib/biboumi" + +src_configure() { + local mycmakeargs=( + -DWITH_POSTGRESQL="$(usex postgres)" + -DWITHOUT_POSTGRESQL="$(usex !postgres)" + -DWITH_SQLITE3="$(usex sqlite)" + -DWITHOUT_SQLITE3="$(usex !sqlite)" + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + newinitd "${FILESDIR}/${PN}".initd "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}".logrotate "${PN}" + for dir in $DIRS + do + keepdir $dir + done +} + +pkg_postinst() { + for dir in $DIRS + do + chown jabber:jabber $dir + chmod u=rwx,g=rx,o= $dir + done +} diff --git a/net-im/biboumi/files/001-CMAKE-empty-string.patch b/net-im/biboumi/files/001-CMAKE-empty-string.patch new file mode 100644 index 0000000..577773d --- /dev/null +++ b/net-im/biboumi/files/001-CMAKE-empty-string.patch @@ -0,0 +1,55 @@ +From e3730c5a40a9d4a098ae9fb9a3bd867803007da1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?louiz=E2=80=99?= +Date: Fri, 8 Jun 2018 19:13:00 +0200 +Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20add=5Flibrary(database)=20with?= + =?UTF-8?q?=20an=20empty=20string,=20that=E2=80=99s=20not=20portable?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Instead, don’t create the library at all if not needed. +--- + CMakeLists.txt | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1d57a0b..7539886 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -218,8 +218,6 @@ if(SQLITE3_FOUND OR PQ_FOUND) + include_directories(database ${PQ_INCLUDE_DIRS}) + endif() + set(USE_DATABASE TRUE) +-else() +- add_library(database OBJECT "") + endif() + + # +@@ -235,8 +233,7 @@ add_executable(${PROJECT_NAME} src/main.cpp + $ + $ + $ +- $ +- $) ++ $) + + ## test_suite + file(GLOB source_tests +@@ -249,9 +246,12 @@ add_executable(test_suite ${source_tests} + $ + $ + $ +- $ +- $) ++ $) + set_target_properties(test_suite PROPERTIES EXCLUDE_FROM_ALL TRUE) ++if(USE_DATABASE) ++ target_link_libraries(${PROJECT_NAME} $) ++ target_link_libraries(test_suite $) ++endif() + + # + ## Link the executables with their libraries +-- +2.14.5 + diff --git a/net-im/biboumi/files/biboumi.initd b/net-im/biboumi/files/biboumi.initd new file mode 100755 index 0000000..46ac11a --- /dev/null +++ b/net-im/biboumi/files/biboumi.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +pidfile="/var/run/biboumi.pid" +command="/usr/bin/biboumi" +command_args="${BIBOUMI_CONFIG:-/etc/biboumi/biboumi.cfg}" +command_user="${BIBOUMI_USER:-jabber}" +command_background="true" +extra_commands="reload" + +depend() { + use net + use jabber-server +} + +reload() { + ebegin "Reloading configuration of Biboumi" + start-stop-daemon -p ${pidfile} -s USR1 + eend $? +} diff --git a/net-im/biboumi/files/biboumi.logrotate b/net-im/biboumi/files/biboumi.logrotate new file mode 100644 index 0000000..67de5fc --- /dev/null +++ b/net-im/biboumi/files/biboumi.logrotate @@ -0,0 +1,11 @@ +/var/log/biboumi/biboumi.log { + daily + rotate 14 + compress + create 640 jabber adm + postrotate + rc-service biboumi reload > /dev/null + endscript + sharedscripts + missingok +} diff --git a/net-im/biboumi/metadata.xml b/net-im/biboumi/metadata.xml new file mode 100644 index 0000000..080cff0 --- /dev/null +++ b/net-im/biboumi/metadata.xml @@ -0,0 +1,14 @@ + + + + + gentoo@meskal.net + Tobias Klaus + Ebuild author + + +Biboumi is an XMPP gateway that connects to IRC servers and +translates between the two protocols. It can be used to access IRC channels +using any XMPP client as if these channels were XMPP MUCs. + +