summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/conmux')
-rw-r--r--app-misc/conmux/Manifest1
-rw-r--r--app-misc/conmux/conmux-0.15.1-r3.ebuild64
-rw-r--r--app-misc/conmux/files/conmux-registry.confd4
-rwxr-xr-xapp-misc/conmux/files/conmux-registry.initd31
-rw-r--r--app-misc/conmux/files/conmux.confd14
-rwxr-xr-xapp-misc/conmux/files/conmux.initd39
-rw-r--r--app-misc/conmux/metadata.xml17
7 files changed, 170 insertions, 0 deletions
diff --git a/app-misc/conmux/Manifest b/app-misc/conmux/Manifest
new file mode 100644
index 000000000000..18eef58c120a
--- /dev/null
+++ b/app-misc/conmux/Manifest
@@ -0,0 +1 @@
+DIST conmux-0.15.1.tar.gz 50713 SHA256 52e0e8d8ae2ad679e498f2a8c0a01ec536738e9daf09d88f9e256c349c5e9cb7 SHA512 8138d6d10b4382709828277503d1c23c52fd43109ebad79073be9003c39a9e62c2b7d9d6e78a9e81797c22871985e50a58df0d538ff63e3f580c9a229b520107 WHIRLPOOL 0d6ea7183063d5a3dee4e884ad4de9d694fa0c8116e94f8bee9ed80f26e5ed009a8ec889365b90efe34ffbb2e3f9c3c28a408924fb8b9c68a8c63ecfa0e5325b
diff --git a/app-misc/conmux/conmux-0.15.1-r3.ebuild b/app-misc/conmux/conmux-0.15.1-r3.ebuild
new file mode 100644
index 000000000000..bc847e39b87e
--- /dev/null
+++ b/app-misc/conmux/conmux-0.15.1-r3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit perl-module
+
+DESCRIPTION="A console multiplexor"
+HOMEPAGE="https://github.com/autotest/autotest"
+SRC_URI="http://dev.gentoo.org/~hwoarang/distfiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE=""
+
+RDEPEND="dev-perl/IO-Multiplex
+ dev-perl/URI"
+DEPEND=""
+
+src_prepare() {
+ # manual installation of drivers and helpers
+ sed -i -e "/include/d" Makefile || die "Failed to fix Makefile"
+}
+
+src_install() {
+ perl_set_version
+ emake BASE="${D}/usr" install
+ # helpers and drivers have been removed in src_prepare
+ insinto /usr/share/${PN}/
+ doins -r drivers/ helpers/
+ fperms -R 0750 /usr/share/${PN}/{drivers,helpers}/
+ dodir /etc/${PN}
+ # no need to have the init script in /sbin
+ rm "${D}"/usr/sbin/start || die "failed to remove init script"
+ # console is too generic. Make it conmux-console instead
+ mv "${D}"/usr/bin/console "${D}"/usr/bin/${PN}-console || \
+ die "failed to rename console to conmux-console"
+ # Fix up directory for the module
+ perl_set_version
+ dodir ${VENDOR_LIB}/${PN}
+ mv "${D}"/usr/lib/Conmux.pm "${D}"/${VENDOR_LIB}/. || \
+ die "failed to move the Conmux.pm module"
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newinitd "${FILESDIR}"/${PN}-registry.initd ${PN}-registry
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ newconfd "${FILESDIR}"/${PN}-registry.confd ${PN}-registry
+ dodoc README
+}
+
+pkg_postinst() {
+ elog ""
+ elog "If you have more than one serial ports and you want to use all"
+ elog "of them with conmux, copy and paste the 'conmux' init.d and conf.d"
+ elog "files as many times as you want, pointing each conf.d file to the"
+ elog "device's configuration file."
+ elog ""
+ elog "See /etc/conf.d/conmux and"
+ elog "https://github.com/autotest/autotest/wiki/Conmux-OriginalDocumentation"
+ elog "https://github.com/autotest/autotest/wiki/Conmux-Howto"
+ elog "for more information"
+ elog ""
+}
diff --git a/app-misc/conmux/files/conmux-registry.confd b/app-misc/conmux/files/conmux-registry.confd
new file mode 100644
index 000000000000..ac7bd8c20d5e
--- /dev/null
+++ b/app-misc/conmux/files/conmux-registry.confd
@@ -0,0 +1,4 @@
+# Port for Registry listener
+CONMAX_REGISTRY_PORT="63000"
+# Log file
+CONMAX_REGISTRY_LOG="/var/log/conmux-registry.log"
diff --git a/app-misc/conmux/files/conmux-registry.initd b/app-misc/conmux/files/conmux-registry.initd
new file mode 100755
index 000000000000..5af904210bbe
--- /dev/null
+++ b/app-misc/conmux/files/conmux-registry.initd
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+checkconfig() {
+ # Set sane defaults
+ if [ -z ${CONMUX_REGISTRY_PORT} ]; then
+ CONMUX_REGISTRY_PORT="63000"
+ fi
+ if [ -z ${CONMUX_REGISTRY_LOG} ]; then
+ CONMUX_REGISTRY_LOG="/var/log/conmux-registry.log"
+ fi
+}
+
+start() {
+ checkconfig
+ # Make sure conmux finds everything
+ export PATH="${PATH}:/usr/share/conmux/drivers:/usr/share/conmux/helpers"
+ ebegin "Starting conmux registry daemon"
+ [ -e ${CONMUX_REGISTRY_LOG} ] && rm ${CONMUX_REGISTRY_LOG}
+ touch ${CONMUX_REGISTRY_LOG}
+ start-stop-daemon -b -m --start -p /run/conmux-registry.pid \
+ --exec /usr/sbin/conmux-registry -- ${CONMUX_REGISTRY_PORT} \
+ ${CONMUX_REGISTRY_LOG}
+}
+
+stop() {
+ ebegin "Stopping conmux registry daemon"
+ start-stop-daemon --stop --pidfile /run/conmux-registry.pid
+ eend $?
+}
diff --git a/app-misc/conmux/files/conmux.confd b/app-misc/conmux/files/conmux.confd
new file mode 100644
index 000000000000..7f983c9ac409
--- /dev/null
+++ b/app-misc/conmux/files/conmux.confd
@@ -0,0 +1,14 @@
+# Configuration file
+# It should point to a valid device configuration file
+# eg CONMUX_CONFIG="/etc/conmux/deviceA.cf
+#
+# See https://github.com/autotest/autotest/wiki/Conmux-Howto
+# and https://github.com/autotest/autotest/wiki/Conmux-OriginalDocumentation
+# for examples
+#
+# Default value is empty so the init script will fail and force you
+# to create a new config
+#
+CONMUX_CONFIG=""
+# Log file
+CONMUX_LOG="/var/log/conmux.log"
diff --git a/app-misc/conmux/files/conmux.initd b/app-misc/conmux/files/conmux.initd
new file mode 100755
index 000000000000..d78db20bb9b7
--- /dev/null
+++ b/app-misc/conmux/files/conmux.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use net
+ need conmux-registry
+}
+
+checkconfig() {
+ if [ ! -f ${CONMUX_CONFIG} ]; then
+ eerror ""
+ eerror "No conmux configuration file was found!"
+ eerror "Please read the conmux README file."
+ eerror ""
+ return 1
+ fi
+ # Sane default
+ if [ -z ${CONMUX_LOG} ]; then
+ CONMUX_LOG="/var/log/conmux.log"
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || exit 1
+ # Make sure conmux finds everything
+ export PATH="${PATH}:/usr/share/conmux/drivers:/usr/share/conmux/helpers"
+ ebegin "Starting conmux daemon"
+ start-stop-daemon -m -b --start -1 ${CONMUX_LOG} \
+ -2 ${CONMUX_LOG} -p /run/${SVCNAME}.pid \
+ --exec /usr/sbin/conmux -- ${CONMUX_CONFIG}
+}
+
+stop() {
+ ebegin "Stopping conmux daemon"
+ start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid
+ eend $?
+}
diff --git a/app-misc/conmux/metadata.xml b/app-misc/conmux/metadata.xml
new file mode 100644
index 000000000000..d21360dfe630
--- /dev/null
+++ b/app-misc/conmux/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+CONMUX is a console abstractor. Presenting any console with a
+consistent location, naming and semantic. Access to the console,
+and hardreset of the machine is the same regardless of the underlying
+access methodology.
+</longdescription>
+ <upstream>
+ <remote-id type="github">autotest/autotest</remote-id>
+ </upstream>
+</pkgmetadata>