From 9d430df08a9a4e32ba1e63f83307431485013d08 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Fri, 4 Sep 2020 19:51:33 +0200 Subject: [PATCH] net-im/matterircd: New package Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Alarig Le Lay --- net-im/matterircd/Manifest | 1 + net-im/matterircd/files/matterircd.confd | 11 ++++ net-im/matterircd/files/matterircd.initd | 23 ++++++++ net-im/matterircd/matterircd-0.20.0.ebuild | 64 ++++++++++++++++++++++ net-im/matterircd/metadata.xml | 8 +++ 5 files changed, 107 insertions(+) create mode 100644 net-im/matterircd/Manifest create mode 100644 net-im/matterircd/files/matterircd.confd create mode 100644 net-im/matterircd/files/matterircd.initd create mode 100644 net-im/matterircd/matterircd-0.20.0.ebuild create mode 100644 net-im/matterircd/metadata.xml diff --git a/net-im/matterircd/Manifest b/net-im/matterircd/Manifest new file mode 100644 index 0000000..183ce36 --- /dev/null +++ b/net-im/matterircd/Manifest @@ -0,0 +1 @@ +DIST matterircd-0.20.0.tar.gz 2575792 BLAKE2B f079a2dd3a756835589161e9b20d47c6b01f4bd815679e5a32b98804a5d80990c35eb952b8e1a5c3fee09d55c1be337a9ca3de5b16f4e116a04c1acec8114b1b SHA512 17fd5d9ccf3e2fb04ccbf82f0816e6a5e7217ab3e940a88a4518fae71e3a81081ebab7e611b3e4916d9daddbe0993ea717eb84deca9d6da1ea6cbb8b93c6ef8c diff --git a/net-im/matterircd/files/matterircd.confd b/net-im/matterircd/files/matterircd.confd new file mode 100644 index 0000000..8a31777 --- /dev/null +++ b/net-im/matterircd/files/matterircd.confd @@ -0,0 +1,11 @@ +# config file for /etc/init.d/matterircd + +MATTERIRCD_LOGDIR="/var/log/matterircd" +MATTERIRCD_CONFIG="/etc/matterircd/matterircd.toml" + +# Additional options (avoid -config use the variable above) +MATTERIRCD_OPTS="" + +# Logging +#output_log="${MATTERIRCD_LOGDIR}/matterircd.log" +#error_log="${MATTERIRCD_LOGDIR}/error.log" diff --git a/net-im/matterircd/files/matterircd.initd b/net-im/matterircd/files/matterircd.initd new file mode 100644 index 0000000..4d6bb6d --- /dev/null +++ b/net-im/matterircd/files/matterircd.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +output_log="${output_log:-/dev/null}" +error_log="${error_log:-${MATTERIRCD_LOGDIR}/error.log}" + +command="/usr/bin/matterircd" +command_args="-config ${MATTERIRCD_CONFIG} ${MATTERIRCD_OPTS}" +command_background=true +command_user="${command_user:-matterircd:matterircd}" +pidfile="/run/${RC_SVCNAME}.pid" +required_files="${MATTERIRCD_CONFIG}" +retry="${retry:-TERM/30/KILL/5}" +start_stop_daemon_args="${SSD_OPTS}" + +depend() { + need net +} + +start_pre() { + checkpath -d -m 0750 -o "${command_user}" "${MATTERIRCD_LOGDIR}" +} diff --git a/net-im/matterircd/matterircd-0.20.0.ebuild b/net-im/matterircd/matterircd-0.20.0.ebuild new file mode 100644 index 0000000..c5041b7 --- /dev/null +++ b/net-im/matterircd/matterircd-0.20.0.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +EGO_PN="github.com/42wim/${PN}" + +inherit golang-build golang-vcs-snapshot user + +DESCRIPTION="Connect to your Mattermost or Slack using your IRC-client of choice" +HOMEPAGE="https://github.com/42wim/matterircd" +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +RESTRICT="mirror" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug pie static" + +DOCS=( README.md ) +QA_PRESTRIPPED="usr/bin/.*" + +G="${WORKDIR}/${P}" +S="${G}/src/${EGO_PN}" + +pkg_setup() { + enewgroup matterircd + enewuser matterircd -1 -1 -1 matterircd +} + +src_compile() { + export GOPATH="${G}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + (use static && ! use pie) && export CGO_ENABLED=0 + (use static && use pie) && CGO_LDFLAGS+=" -static" + + local mygoargs=( + -v -work -x + -buildmode "$(usex pie pie exe)" + -asmflags "all=-trimpath=${S}" + -gcflags "all=-trimpath=${S}" + -ldflags "$(usex !debug '-s -w' '')" + -tags "$(usex static 'netgo' '')" + -installsuffix "$(usex static 'netgo' '')" + ) + + go build "${mygoargs[@]}" || die +} + +src_install() { + dobin matterircd + use debug && dostrip -x /usr/bin/matterircd + einstalldocs + + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + newconfd "${FILESDIR}/${PN}.confd" "${PN}" + + insinto /etc/matterircd + doins matterircd.toml.example + + diropts -o matterircd -g matterircd -m 0750 + keepdir /var/log/matterircd +} diff --git a/net-im/matterircd/metadata.xml b/net-im/matterircd/metadata.xml new file mode 100644 index 0000000..17361c3 --- /dev/null +++ b/net-im/matterircd/metadata.xml @@ -0,0 +1,8 @@ + + + + + alarig@swordarmor.fr + Alarig Le Lay + +