From aa79e02a06d5df5ca9d347bcc9809e046d8ef729 Mon Sep 17 00:00:00 2001 From: Stefan Briesenick Date: Tue, 23 Sep 2008 19:34:00 +0000 Subject: initial commit. (Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686) --- net-misc/termpkg/ChangeLog | 12 +++ net-misc/termpkg/Manifest | 11 +++ net-misc/termpkg/files/termnetd.confd | 14 ++++ net-misc/termpkg/files/termnetd.initd | 50 +++++++++++ net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff | 28 +++++++ net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff | 11 +++ net-misc/termpkg/files/ttyd.confd | 63 ++++++++++++++ net-misc/termpkg/files/ttyd.initd | 96 ++++++++++++++++++++++ net-misc/termpkg/metadata.xml | 21 +++++ net-misc/termpkg/termpkg-3.3.9.1.ebuild | 56 +++++++++++++ 10 files changed, 362 insertions(+) create mode 100644 net-misc/termpkg/ChangeLog create mode 100644 net-misc/termpkg/Manifest create mode 100644 net-misc/termpkg/files/termnetd.confd create mode 100644 net-misc/termpkg/files/termnetd.initd create mode 100644 net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff create mode 100644 net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff create mode 100644 net-misc/termpkg/files/ttyd.confd create mode 100644 net-misc/termpkg/files/ttyd.initd create mode 100644 net-misc/termpkg/metadata.xml create mode 100644 net-misc/termpkg/termpkg-3.3.9.1.ebuild (limited to 'net-misc/termpkg') diff --git a/net-misc/termpkg/ChangeLog b/net-misc/termpkg/ChangeLog new file mode 100644 index 000000000000..7a609c70b661 --- /dev/null +++ b/net-misc/termpkg/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for net-misc/termpkg +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/ChangeLog,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ + +*termpkg-3.3.9.1 (23 Sep 2008) + + 23 Sep 2008; Stefan Briesenick + +files/termpkg-3.3.9.1-gcc43.diff, +files/termpkg-3.3-ttydforfax.diff, + +files/termnetd.confd, +files/termnetd.initd, +files/ttyd.confd, + +files/ttyd.initd, +metadata.xml, +termpkg-3.3.9.1.ebuild: + initial commit. + diff --git a/net-misc/termpkg/Manifest b/net-misc/termpkg/Manifest new file mode 100644 index 000000000000..ab2974c8d256 --- /dev/null +++ b/net-misc/termpkg/Manifest @@ -0,0 +1,11 @@ +AUX termnetd.confd 347 RMD160 acc9e158577eca096d66f18a68efc77d6600b6cd SHA1 197adf956b438495bb833ea46b9885632db6546e SHA256 700809ffcaacb4debdaa4cf6b437a4284aee71a6ba383388ad8fdf49d412876a +AUX termnetd.initd 1324 RMD160 acffd42203df09183e945838e1a819b0e2ca546a SHA1 018dc85c036a67327eed05e444fcfe41de81dee0 SHA256 f7100a7b6b1087705e896370354a224e05d63fe533a6c2c7d52e55abb7696596 +AUX termpkg-3.3-ttydforfax.diff 1076 RMD160 b862002e3aa1c06fc3abf4f0ffc13074e97d467f SHA1 96a73ee7e9aa0b58c84fdf328adbc4af8c88f3b4 SHA256 33162e2c3ef11200e90fecdc21dbcf4daa472157e627bf30a2fab9a2d6f7b7b7 +AUX termpkg-3.3.9.1-gcc43.diff 379 RMD160 b11d8169e1992d654d7d62af4ea6c6f9cf75d890 SHA1 8d1aed9465210e2400e76d60838ea95808c737b0 SHA256 40d52ff971cd72e3062d33632d29a767810ee9aed529bb51897b39db9fd097dc +AUX ttyd.confd 1894 RMD160 9ea6aa5c3c2828eebcd133926f49ecbf77aaf454 SHA1 1f1bd4b03fbdd5703e738b0db8893a57c10213ce SHA256 5f93f41220aeff6510afc74b7d6afdf2bee22c92f9bc0e29ff206db10f5bfde6 +AUX ttyd.initd 2332 RMD160 5924190272478062ee9f2e43d7595fe5df52e16e SHA1 a62bb36edefeb1e2d93d49a6fca33a01475efba4 SHA256 0d6b84efbcdad0756f7a60b0c51760096fceeba02342c804e83900a6360bb82d +DIST termpkg_3.3-9.1.diff.gz 6759 RMD160 ea2b31a5e259977e9ca7c727d947c2682db858c4 SHA1 5a54bb850d6e964ef957e239cd0304bd0d34f323 SHA256 3ece3bc9ae469c45a8eba24ccd46c9460e2f03a215e4ec5f7c8fb0d41598b211 +DIST termpkg_3.3.orig.tar.gz 65807 RMD160 93e2a31586610ee935a9e4078eca9e9d8a103744 SHA1 f19befaee8409ca7234b9ed909fd61cd10bb67c3 SHA256 0497f30d3fdac114080b65476d2757211a21276ae32c269d91314e3d54b9eff0 +EBUILD termpkg-3.3.9.1.ebuild 1337 RMD160 3bcff6968ff22e18d8cf2171e0fa81a539f16843 SHA1 043703b34efe97b6a3c17ab2fd843dac2b3b41da SHA256 b583414f8bc85603e63046b10d1485a05e7c2decb3cafa5395f99c3ee5424235 +MISC ChangeLog 424 RMD160 fd06967eb13c333b2d67de2ae696327ee4e85008 SHA1 8513a7f3d69704739d8c5b03f74d0ac64da0be77 SHA256 895d0fb41603f4a4c37804e992582320365c1eb2cc4b5de14502227fd6be5793 +MISC metadata.xml 714 RMD160 c9975c91af2c69581e5847c93c61e1b8fcc40faf SHA1 d6ad74933b3d7cf17a63d4fc325d1068de104c7f SHA256 189a35e623327bcdb5ca7da3e7716e0950b876084fae4424380a032c91cc90fd diff --git a/net-misc/termpkg/files/termnetd.confd b/net-misc/termpkg/files/termnetd.confd new file mode 100644 index 000000000000..4eb95a989d41 --- /dev/null +++ b/net-misc/termpkg/files/termnetd.confd @@ -0,0 +1,14 @@ +# Config file for /etc/init.d/termnetd + +# Set the configuration file to one other than the default of /etc/termnetd.conf +# +#CONFIG_FILE="/etc/termnetd.conf" + +# Sets the IP port to listen to for the control port (default = none). +# +#CONTROL_PORT="" + +# see the termnetd(1) manual page for additional options you can configure here +# +#EXTRA_OPTS="" + diff --git a/net-misc/termpkg/files/termnetd.initd b/net-misc/termpkg/files/termnetd.initd new file mode 100644 index 000000000000..73d095c8717b --- /dev/null +++ b/net-misc/termpkg/files/termnetd.initd @@ -0,0 +1,50 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/files/termnetd.initd,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ + +description="Terminal Server daemon (${RC_SVCNAME#*.})" +description_reload="Reread configuration file and make the appropriate changes" +extra_started_commands="reload" +command="/usr/sbin/termnetd" +name="termnetd" + +depend() { + use logger + need net +} + +config_check() { + command_args="${EXTRA_OPTS}" + CONFIG_FILE_DEFAULT="/etc/termnetd.conf" + + [ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}" + [ -n "${CONTROL_PORT}" ] && command_args="${command_args} -s ${CONTROL_PORT}" + [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}" + + if [ ! -f "${CONFIG_FILE}" ]; then + eerror "Please create ${CONFIG_FILE}" + eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist" + return 1 + fi + return 0 +} + +start() { + config_check || return ${?} + ebegin "Starting ${description}" + start-stop-daemon --start --quiet --exec "${command}" -- ${command_args} + eend ${?} +} + +stop() { + ebegin "Stopping ${description}" + start-stop-daemon --stop --quiet --oknodo --exec "${command}" --name "${name}" + eend ${?} +} + +reload() { + ebegin "Reloading ${description}" + start-stop-daemon --stop --signal HUP --oknodo --exec "${command}" --name "${name}" + eend ${?} +} diff --git a/net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff b/net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff new file mode 100644 index 000000000000..0471fde13154 --- /dev/null +++ b/net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff @@ -0,0 +1,28 @@ +--- termpkg-3.3/termnet/ttyd.c.orig 2005-09-29 08:59:05.000000000 -1000 ++++ termpkg-3.3/termnet/ttyd.c 2005-09-29 08:51:33.000000000 -1000 +@@ -340,7 +340,10 @@ + char *cp; + int x; + for (cp = commbuf, x = 0; x < cnt; x++, cp++) ++if (isprint(*cp)) + syslog(LOG_DEBUG, "ttyd: Have net char 0x%x, |%c|", *cp, *cp); ++else ++syslog(LOG_DEBUG, "ttyd: Have net char 0x%x", *cp); + } + write(fd, commbuf, cnt); + } +@@ -366,9 +369,13 @@ + char *cp; + int x; + for (cp = commbuf, x = 0; x < cnt; x++, cp++) ++if (isprint(*cp)) + syslog(LOG_DEBUG, "ttyd: Have key char 0x%x, |%c|", *cp, *cp); ++else ++syslog(LOG_DEBUG, "ttyd: Have key char 0x%x", *cp); + } +- inputTerminal(commbuf, cnt); ++// inputTerminal(commbuf, cnt); ++write(fileno(tnlout), commbuf, cnt); + } + else + break; diff --git a/net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff b/net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff new file mode 100644 index 000000000000..8d17fc5dd8b9 --- /dev/null +++ b/net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff @@ -0,0 +1,11 @@ +diff -Naur termpkg-3.3.orig/libtn/SocketIO.c termpkg-3.3/libtn/SocketIO.c +--- termpkg-3.3.orig/libtn/SocketIO.c 2008-09-03 18:21:28.881220673 +0200 ++++ termpkg-3.3/libtn/SocketIO.c 2008-09-03 18:23:29.106343243 +0200 +@@ -25,6 +25,7 @@ + #endif + #include + #include ++#include + #include + #include + #include diff --git a/net-misc/termpkg/files/ttyd.confd b/net-misc/termpkg/files/ttyd.confd new file mode 100644 index 000000000000..5b0e2b8c0002 --- /dev/null +++ b/net-misc/termpkg/files/ttyd.confd @@ -0,0 +1,63 @@ +# Configfile for /etc/init.d/ttyd + +# HINT: if you only need one virtual TTY, then you can use this config. +# Otherwise you should use it as a template for specific configurations. +# Just copy /etc/conf.d/ttyd to /etc/conf.d/ttyd. and symlink +# /etc/init.d/ttyd to /etc/init.d/ttyd. + + +# Master pseudo tty device to open and wait for a connection on. +# For reference, in Linux the master pseudo tty devices are the +# devices /dev/pty[a-ep-z][0-9a-f] and the slave devices are +# /dev/tty[a-ep-z][0-9a-f]. +# +PTY="/dev/ptyp0" + +# The host and port parameters specify the host and IP port to +# connect to when the slave pseudo device is opened. +# +HOST="host.example.com" +PORT=3000 + +# The optional mode and user options specify the filesystem +# permissions of the slave pseudo device. We set them right +# after the ttyd daemon has started. After stopping, we reset +# them to the permissions of the master pseudo device. +# +#MODE=660 +#USER="root:uucp" + +# Sets the initial baud-rate of the device (optional). +# +#BAUDRATE=115200 + +# Optional port settings. Specified by a string of one of +# more of the following concatenated together with no +# intervening spaces: +# +# 8: 8 bits/character +# 7: 7 bits/character +# 6: 6 bits/character +# 5: 5 bits/character +# N: No parity +# E: Even parity +# O: Odd parity +# C0: No hardware flow control +# C1: Hardware flow control +# S0: No software flow control +# S1: Software flow control +# +#PORT_SETTINGS="8NC0" + +# You can create symlinks to the slave pseudo device, so you +# have an easy to remember name for your virtual device. You +# can add as many links as you want, if you blank-seperate the +# names. All links *must* be relative and beneath to /dev. +# +#SYMLINK="ttyd/modem ttyNET0" + +# Some odd programs just don't work with symlinks, so you +# can also create hardlinks (even in addition to symlinks). +# Same rules apply as for symlinks. +# +#HARDLINK="ttyS5" diff --git a/net-misc/termpkg/files/ttyd.initd b/net-misc/termpkg/files/ttyd.initd new file mode 100644 index 000000000000..3302ea37bc9b --- /dev/null +++ b/net-misc/termpkg/files/ttyd.initd @@ -0,0 +1,96 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/files/ttyd.initd,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ + +description="Remote Modem Utility (${RC_SVCNAME#*.})" +command="/usr/sbin/ttyd" + +depend() { + use logger + need net +} + +config_check() { + # sanitize PTY/TTY names + DEV_PTY="/dev/${PTY/\/dev\/}" + DEV_TTY="${DEV_PTY/\/pty//tty}" + + # create command args + command_args="-d ${DEV_PTY}" + [ -n "${BAUDRATE}" ] && command_args="${command_args} -b ${BAUDRATE}" + [ -n "${PORT_SETTINGS}" ] && command_args="${command_args} -p ${PORT_SETTINGS}" + command_args="${command_args} ${HOST} ${PORT}" +} + +device_check() { + if [ ! -e "${DEV_PTY}" ]; then + eerror "PTY doesn't exist: ${DEV_PTY}" + return 1 + fi + if [ ! -e "${DEV_TTY}" ]; then + eerror "TTY doesn't exist: ${DEV_TTY}" + return 1 + fi + return 0 +} + +linkrel() { # + local LINK="${1%/*}/${2/\/dev\/}" + echo "${LINK/\/dev\/}" | sed "s:[^/]\+/:../:g" +} + +setup_links() { + local LINK NODE + for LINK in ${SYMLINK}; do + NODE="/dev/${LINK/\/dev\/}" + mkdir -p -- "${NODE%/*}" && ln -snf -- $(linkrel "${NODE}" "${DEV_TTY}") "${NODE}" + done + for LINK in ${HARDLINK}; do + NODE="/dev/${LINK/\/dev\/}" + mkdir -p -- "${NODE%/*}" && ln -nf -- "${DEV_TTY}" "${NODE}" + done +} + +unset_links() { + local LINK LIST="" + for LINK in ${SYMLINK} ${HARDLINK}; do + LIST="${LIST} /dev/${LINK/\/dev\/}" + done + [ -n "${LIST}" ] && rm -f -- ${LIST} +} + +setup_perms() { + [ -n "${MODE}" ] && chmod "${MODE}" -- "${DEV_TTY}" + [ -n "${USER}" ] && chown "${USER}" -- "${DEV_TTY}" +} + +unset_perms() { + [ -n "${USER}" ] && chown --reference "${DEV_PTY}" -- "${DEV_TTY}" + [ -n "${MODE}" ] && chmod --reference "${DEV_PTY}" -- "${DEV_TTY}" +} + +start() { + config_check || return ${?} + device_check || return ${?} + ebegin "Starting ${description}" + start-stop-daemon --start --quiet --exec "${command}" -- ${command_args} + if eend ${?}; then + setup_perms + setup_links + return 0 # from here we never fail + fi +} + +stop() { + config_check || return ${?} + # we can't use start-stop-daemon, because we don't have a pidfile + # *and* multiple processes can run at the same time. So we use + # pkill to identify *our* process via commandline args. + ebegin "Stopping ${description}" + /usr/bin/pkill -f "^${command} -d ${DEV_PTY} " + eend ${?} + unset_links + unset_perms + return 0 # never fail +} diff --git a/net-misc/termpkg/metadata.xml b/net-misc/termpkg/metadata.xml new file mode 100644 index 000000000000..f9664df5c296 --- /dev/null +++ b/net-misc/termpkg/metadata.xml @@ -0,0 +1,21 @@ + + + + net-dialup + + sbriesen@gentoo.org + Stefan Briesenick + + + Termpkg is a terminal server daemon and simple telnet like client. + Allows access to one or more serial ports through the telnet protocol. + Can be configured to connect in a one to one relation of telnet ports + to serial ports or in a round-robin fashion where one telnet port + serves many serial ports. + + + + Adds support for uucp style device locking + + + diff --git a/net-misc/termpkg/termpkg-3.3.9.1.ebuild b/net-misc/termpkg/termpkg-3.3.9.1.ebuild new file mode 100644 index 000000000000..491a5eb562a4 --- /dev/null +++ b/net-misc/termpkg/termpkg-3.3.9.1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/termpkg-3.3.9.1.ebuild,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ + +inherit eutils versionator + +MY_PV=$(get_version_component_range 1-2) +MY_PF=$(replace_version_separator 2 '-') + +DESCRIPTION="Termpkg, the Poor Man's Terminal Server" +HOMEPAGE="http://www.linuxlots.com/~termpkg/" +SRC_URI="mirror://debian/pool/main/t/termpkg/${PN}_${MY_PV}.orig.tar.gz + mirror://debian/pool/main/t/termpkg/${PN}_${MY_PF}.diff.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="uucp" + +DEPEND="sys-devel/flex" +RDEPEND="sys-process/procps" + +S="${WORKDIR}/${PN}-${MY_PV}" + +src_unpack() { + unpack ${A} + cd "${S}" + + # apply debian patches + epatch "${WORKDIR}/${PN}_${MY_PF}.diff" + + # apply gentoo patches + epatch "${FILESDIR}/${P}-gcc43.diff" + + # apply iaxmodem patches + epatch "${FILESDIR}/${PN}-${MY_PV}-ttydforfax.diff" +} + +src_compile() { + ./configure LINUX $(use uucp && echo UUCP_LOCKING) + emake -C linux CC=$(tc-getCC) || die "emake failed" +} + +src_install() { + dobin linux/bin/termnet + dosbin linux/bin/{termnetd,ttyd} + dodoc CHANGES README termpkg.lsm + newdoc debian/changelog ChangeLog.debian + doman doc/*.1 + insinto /etc + newins debian/termnetd.conf termnetd.conf.dist + for X in termnetd ttyd; do + newinitd "${FILESDIR}/${X}.initd" "${X}" + newconfd "${FILESDIR}/${X}.confd" "${X}" + done +} -- cgit v1.2.3-65-gdbad