aboutsummaryrefslogtreecommitdiffstats
path: root/main/ser2net
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2014-08-10 13:41:13 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2014-08-10 13:41:13 +0200
commit7816e4ece0d8bec8cc9a093f57c4f6e72634b13c (patch)
tree74361c487f4c69cce05fb353e05060befd1d1af5 /main/ser2net
parent3dcbed7944587029c51ff91e54967413b18e410a (diff)
downloadaports-7816e4ece0d8bec8cc9a093f57c4f6e72634b13c.tar.bz2
aports-7816e4ece0d8bec8cc9a093f57c4f6e72634b13c.tar.xz
testing/ser2net: move to main
Diffstat (limited to 'main/ser2net')
-rw-r--r--main/ser2net/APKBUILD65
-rw-r--r--main/ser2net/ser2net.confd27
-rw-r--r--main/ser2net/ser2net.initd55
3 files changed, 147 insertions, 0 deletions
diff --git a/main/ser2net/APKBUILD b/main/ser2net/APKBUILD
new file mode 100644
index 0000000000..7318d6eeb0
--- /dev/null
+++ b/main/ser2net/APKBUILD
@@ -0,0 +1,65 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=ser2net
+pkgver=2.9.1
+pkgrel=0
+pkgdesc="A proxy that allows telnet/tcp connections to be made to serial ports"
+url="http://sourceforge.net/projects/ser2net"
+arch="all"
+license="GPL"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://heanet.dl.sourceforge.net/project/ser2net/ser2net/ser2net-$pkgver.tar.gz
+ ${pkgname}.confd
+ ${pkgname}.initd"
+
+_builddir="$srcdir"/ser2net-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ update_config_sub || return 1
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ install -D -m755 "$srcdir"/ser2net.initd \
+ "$pkgdir"/etc/init.d/ser2net
+ install -D -m644 "$srcdir"/ser2net.confd \
+ "$pkgdir"/etc/conf.d/ser2net
+ install -D -m644 ser2net.conf \
+ "$pkgdir"/etc/ser2net.conf
+ rm -f "$pkgdir"/usr/lib/*.la
+}
+
+md5sums="80011ac0e60bbdcb65f1d7a86251e3f3 ser2net-2.9.1.tar.gz
+100fc9cc68a766afde182d14a26bfec0 ser2net.confd
+d57ce51bc3d70cf66d3837bdc0a7df7c ser2net.initd"
+sha256sums="fdee1e69903cf409bdc6f32403a566cbc6006aa9e2a4d6f8f12b90dfd5ca0d0e ser2net-2.9.1.tar.gz
+3058368970e77b8b7fcf6fca9f3530b683d9e9c27c431531f8566dde01dab849 ser2net.confd
+6993e7965e17d0498b50ac09be772da436447bb7ed07520818a70b82b3a6ef80 ser2net.initd"
+sha512sums="9fd0efc853993b70c0c632a7059df7a04c832f85491194c49dd8b384e1bb1a576ed9cfe28088cc181a2f7084c88dc6ef6dabbc4ead5ad9339a7becebaa6fb8e7 ser2net-2.9.1.tar.gz
+15054f7aa604f93bd5a54c2bb96c9a3168905be5ace50bcd2ebeeaf9dc9ae19426388e6118e9e4850125349090ee29542c24487e64c349593a76366be4a5e501 ser2net.confd
+a1dac24c0a379b8deaef66a3e53717c59a11c94e10048ed810d2c673d79cd382671d19364b33de9dd676d19c0275dd22d66e102be0c2e644d959654fd5dbeeea ser2net.initd"
diff --git a/main/ser2net/ser2net.confd b/main/ser2net/ser2net.confd
new file mode 100644
index 0000000000..c666851593
--- /dev/null
+++ b/main/ser2net/ser2net.confd
@@ -0,0 +1,27 @@
+# Config file for /etc/init.d/ser2net
+
+# Set the configuration file to one other than the default of /etc/ser2net.conf
+#
+#CONFIG_FILE="/etc/ser2net.conf"
+
+# Enables the control port and sets the TCP port to listen to for the control port.
+# A port number may be of the form [host,]port, such as 127.0.0.1,2000 or localhost,2000.
+# If this is specified, it will only bind to the IP address specified for the port.
+# Otherwise, it will bind to all the addresses on the machine.
+#
+#CONTROL_PORT=""
+
+# Cisco IOS uses a different mechanism for specifying the baud rates than the mechanism
+# described in RFC2217. This option sets the IOS version of setting the baud rates.
+# The default is RFC2217s.
+#
+#CISCO_IOS="yes"
+
+# Enable or disable UUCP locking (default=yes)
+#
+#UUCP_LOCKS="no"
+
+# see the ser2net(8) manual page for additional options you can configure here
+#
+#EXTRA_OPTS=""
+
diff --git a/main/ser2net/ser2net.initd b/main/ser2net/ser2net.initd
new file mode 100644
index 0000000000..1999c7eb06
--- /dev/null
+++ b/main/ser2net/ser2net.initd
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v 1.4 2012/07/17 19:44:24 sbriesen Exp $
+
+description="Serial to network proxy (${RC_SVCNAME#*.})"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+command="/usr/sbin/ser2net"
+name="${RC_SVCNAME}"
+
+extra_started_commands="reload"
+description_reload="Reread configuration file and make the appropriate changes"
+start_stop_daemon_args="--quiet --exec ${command} --name ${name} --pidfile ${pidfile}"
+
+depend() {
+ use logger
+ need net
+}
+
+config_check() {
+ command_args="${EXTRA_OPTS}"
+ CONFIG_FILE_DEFAULT="/etc/ser2net.conf"
+
+ yesno "${CISCO_IOS:-no}" && command_args="${SER2NET_OPTS} -b"
+ yesno "${UUCP_LOCKS:-yes}" || command_args="${command_args} -u"
+ [ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}"
+ [ -n "${CONTROL_PORT}" ] && command_args="${command_args} -p ${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 ${start_stop_daemon_args} -- ${command_args} -P "${pidfile}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping ${description}"
+ start-stop-daemon --stop ${start_stop_daemon_args}
+ eend ${?}
+}
+
+reload() {
+ ebegin "Reloading ${description}"
+ start-stop-daemon --signal HUP ${start_stop_daemon_args}
+ eend ${?}
+}