summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWout Mertens <wmertens@gentoo.org>2003-11-15 16:48:03 +0000
committerWout Mertens <wmertens@gentoo.org>2003-11-15 16:48:03 +0000
commit4bf523e2968be7b0102e1182e7308691c7eba73b (patch)
tree62c63b8e955c98fdda174166bfa65faaabf6b58d /sys-apps/ifplugd
parentVersion bump (diff)
downloadhistorical-4bf523e2968be7b0102e1182e7308691c7eba73b.tar.gz
historical-4bf523e2968be7b0102e1182e7308691c7eba73b.tar.bz2
historical-4bf523e2968be7b0102e1182e7308691c7eba73b.zip
Version bump
Diffstat (limited to 'sys-apps/ifplugd')
-rw-r--r--sys-apps/ifplugd/Manifest8
-rw-r--r--sys-apps/ifplugd/files/digest-ifplugd-0.201
-rw-r--r--sys-apps/ifplugd/files/gentoo-ifplugd-conf-v362
-rw-r--r--sys-apps/ifplugd/files/gentoo-ifplugd-init-v3108
-rw-r--r--sys-apps/ifplugd/ifplugd-0.20.ebuild66
5 files changed, 241 insertions, 4 deletions
diff --git a/sys-apps/ifplugd/Manifest b/sys-apps/ifplugd/Manifest
index 2ce956c6c17f..a63446a5128a 100644
--- a/sys-apps/ifplugd/Manifest
+++ b/sys-apps/ifplugd/Manifest
@@ -1,13 +1,13 @@
-MD5 42994021a7ec7b2a49fe5a61b31d343a ChangeLog 1181
+MD5 5123f93d3892bb9160fd271d0dfaa569 ChangeLog 1181
MD5 d2b50c4b0ce08a5fec4c6cd6bd570499 ifplugd-0.13-r1.ebuild 984
MD5 0e80a26e96e867fec18b253fc01b9220 ifplugd-0.15.ebuild 1493
-MD5 59bac0550edc52dadfc966c57de948db ifplugd-0.20.ebuild 1683
+MD5 cb57e9a04ef7e9d7cc689bc86df52f92 ifplugd-0.20.ebuild 1683
MD5 d6c3df70619631dd1f9b148e297a3037 files/ifplugd 901
MD5 1b861d571aed96fc06f363f318fa7f98 files/digest-ifplugd-0.13-r1 63
MD5 ed84e9ddf90cec9fd2bba39a6aca4652 files/digest-ifplugd-0.15 64
-MD5 bbe82ba950e88940e0db21b44e7118d4 files/gentoo-ifplugd-init-v3 2670
+MD5 de7bbd638b2ad2e71fb89a9cfcf158af files/gentoo-ifplugd-init-v3 2670
MD5 e77f99a584be6f9891bfde03da108eca files/gentoo-ifplugd-init-v2 1327
-MD5 b155b9251254341c79a7e11289877658 files/gentoo-ifplugd-conf-v3 2233
+MD5 46b7e993f02c5071a712a6a137de977a files/gentoo-ifplugd-conf-v3 2250
MD5 23e46b48e4a4a09e71dcd97b1261558a files/gentoo-ifplugd.action-v2 712
MD5 085ed0911e79c8f6a2f03c4d02602ee8 files/digest-ifplugd-0.20 64
MD5 037a872cd311cdb8b2a9c25e6abda3db files/ifplugd.action 592
diff --git a/sys-apps/ifplugd/files/digest-ifplugd-0.20 b/sys-apps/ifplugd/files/digest-ifplugd-0.20
new file mode 100644
index 000000000000..c45cfd6edb4a
--- /dev/null
+++ b/sys-apps/ifplugd/files/digest-ifplugd-0.20
@@ -0,0 +1 @@
+MD5 7d259502c75f5ea9aebcd57c1a3d0739 ifplugd-0.20.tar.gz 128798
diff --git a/sys-apps/ifplugd/files/gentoo-ifplugd-conf-v3 b/sys-apps/ifplugd/files/gentoo-ifplugd-conf-v3
new file mode 100644
index 000000000000..3b4f0c9a0670
--- /dev/null
+++ b/sys-apps/ifplugd/files/gentoo-ifplugd-conf-v3
@@ -0,0 +1,62 @@
+# -*-sh-*-
+# $Id: gentoo-ifplugd-conf-v3,v 1.1 2003/11/15 16:47:58 wmertens Exp $
+
+# This file is part of ifplugd.
+#
+# ifplugd is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# ifplugd is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ifplugd; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+# ifplugd configuration file
+
+# Please note that this is a bourne shell fragment sourced by the
+# init script of ifplugd.
+
+# Specify the interfaces to control here, separated by spaces.
+# Ifplugd processes will be started for each of these interfaces when
+# the ifplugd init script is called with the "start" argument. You may
+# use the magic string "auto" to make the init script start or stop
+# ifplugd processes for ALL eth and wlan interfaces that are available
+# according to /proc/net/dev. Note that the list of interfaces
+# appearing in /proc/net/dev may depend on which kernel modules you
+# have loaded.
+INTERFACES="eth0"
+
+# Additional parameters for ifplugd.
+# See manual page ifplugd.8 for details.
+# If you set AUTO to yes, you have to read http://bugs.gentoo.org/show_bug.cgi?id=28362
+# I recommend a delay of 0, both ways, since then, you can swap ethernet
+# cables on different networks and get a new ip address.
+# None of the programs I tested had a problem with the interface being
+# gone in the mean time.
+AUTO="no"
+BEEP="yes"
+IGNORE_FAIL="yes"
+IGNORE_FAIL_POSITIVE="no"
+IGNORE_RETVAL="yes"
+POLL_TIME="1"
+DELAY_UP="0"
+DELAY_DOWN="0"
+API_MODE="auto"
+SHUTDOWN="yes"
+WAIT_ON_FORK="no"
+MONITOR="no"
+ARGS=""
+
+# Additional parameters for ifplugd for the specified interface. Note that
+# the global variable is ignored, when a variable like this is set for an
+# interface
+# MONITOR_wlan0="yes"
+# DELAY_UP_wlan0="5"
+# DELAY_DOWN_wlan0="5"
+
diff --git a/sys-apps/ifplugd/files/gentoo-ifplugd-init-v3 b/sys-apps/ifplugd/files/gentoo-ifplugd-init-v3
new file mode 100644
index 000000000000..75161744755a
--- /dev/null
+++ b/sys-apps/ifplugd/files/gentoo-ifplugd-init-v3
@@ -0,0 +1,108 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/files/gentoo-ifplugd-init-v3,v 1.1 2003/11/15 16:47:58 wmertens Exp $
+
+#NB: Config is in /etc/conf.d/ifplugd
+
+opts="stop start status suspend resume"
+
+IFPLUGD=/usr/sbin/ifplugd
+
+[ -z "$INTERFACES" ] && INTERFACES="eth0"
+[ "$INTERFACES" = "auto" ] && INTERFACES=$(sed -ne 's/.*\<\(eth[0-9]*\):.*/\1/p' /proc/net/dev)
+
+# Check if an option is set for a given interface.
+# $1 is interface, $2 is option name, $3 is preset
+is_set() {
+ [ "$(get_opt "$@")" = "yes" ]
+}
+
+# Expand an option value for a given interface.
+# $1 is interface, $2 is option name, $3 is preset
+get_opt() {
+ local iface=$1 option=$2 preset=$3
+ eval preset=\${${option}:=${preset}}
+ eval echo \${${option}_${iface}:=${preset}}
+}
+
+check_success() {
+ local iface=$1 action=$2 status=$3
+
+ if [ "${action}" = "start" ] && is_set ${iface} WAIT_ON_FORK yes; then
+ [ ${status} -le 2 ]
+ else
+ [ ${status} ]
+ fi
+}
+
+# Handle starting for all interfaces
+# $1 is deamon args, $2 is action name
+do_all_if() {
+ local dargs=$1 action=$2 IF args status
+
+ for IF in ${INTERFACES}; do
+ iargs=
+
+ is_set ${IF} AUTO yes || iargs="${iargs}a"
+ is_set ${IF} BEEP yes || iargs="${iargs}b"
+ is_set ${IF} IGNORE_FAIL yes && iargs="${iargs}f"
+ is_set ${IF} IGNORE_FAIL_POSITIVE no && iargs="${iargs}F"
+ is_set ${IF} IGNORE_RETVAL yes && iargs="${iargs}I"
+ is_set ${IF} SHUTDOWN yes || iargs="${iargs}q"
+ is_set ${IF} WAIT_ON_FORK yes && iargs="${iargs}w"
+ is_set ${IF} MONITOR no && iargs="${iargs}M"
+
+ [ -n "${iargs}" ] && iargs="-${iargs}"
+
+ iargs="${iargs} -t$(get_opt ${IF} POLL_TIME 1)"
+ iargs="${iargs} -u$(get_opt ${IF} DELAY_UP 0)"
+ iargs="${iargs} -d$(get_opt ${IF} DELAY_DOWN 5)"
+ iargs="${iargs} -m$(get_opt ${IF} API_MODE auto)"
+ iargs="${iargs} $(get_opt ${IF} ARGS '')"
+
+ echo -n "${IF} "
+ ${IFPLUGD} ${dargs} --iface=${IF} ${iargs}
+ check_success ${IF} ${action} $?
+ status=$?
+
+ [ $status ] || break
+ done
+
+ echo
+ eend $status "Couldn't ${action} ifplugd for ${IF}"
+}
+
+start() {
+ einfon "Starting ifplugd: "
+ do_all_if "" start
+}
+
+stop() {
+ einfon "Stopping ifplugd: "
+ do_all_if -k stop
+ # Now we have to wait until it's actually down
+ local i=10
+ while [ $i -gt 0 ] && status | grep -q "running as"; do
+ i=$(( $i - 1 ))
+ sleep 1
+ done
+ if [ $i -eq 0 ]; then
+ eend 1 "Timeout exceeded, ifplugd won't die!"
+ fi
+}
+
+status() {
+ do_all_if -c "get status from"
+}
+
+suspend() {
+ einfon "Suspending ifplugd: "
+ do_all_if -S suspend
+}
+
+resume() {
+ einfon "Resuming ifplugd: "
+ do_all_if -R resume
+}
+# vim:ts=4
diff --git a/sys-apps/ifplugd/ifplugd-0.20.ebuild b/sys-apps/ifplugd/ifplugd-0.20.ebuild
new file mode 100644
index 000000000000..d15b435a49fc
--- /dev/null
+++ b/sys-apps/ifplugd/ifplugd-0.20.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/ifplugd-0.20.ebuild,v 1.1 2003/11/15 16:47:58 wmertens Exp $
+
+DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
+HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
+SRC_URI="${HOMEPAGE}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="doc"
+DEPEND=">=dev-libs/libdaemon-0.3
+ doc? ( app-doc/doxygen net-www/lynx )"
+
+S=${WORKDIR}/${P}
+
+# Gentoo-provided scripts. Version is for the scripts, not ifplugd.
+INITSCRIPT=${FILESDIR}/gentoo-ifplugd-init-v3
+ACTIONSCRIPT=${FILESDIR}/gentoo-ifplugd.action-v2
+CONFFILE=${FILESDIR}/gentoo-ifplugd-conf-v3
+
+src_unpack() {
+ unpack ${A}
+
+ cp ${INITSCRIPT} ${T}/ifplugd
+ cp ${ACTIONSCRIPT} ${T}/ifplugd.action
+
+ # This moves the default location for the script that handles
+ # calling the distro network scripts to /usr/sbin. The reason
+ # is that the user very probably shouldn't mess with it.
+ cd ${S}
+ sed -i~ 's:SYSCONFDIR"/ifplugd/:"/usr/sbin/:' src/ifplugd.c
+}
+
+src_compile() {
+ local myconf
+
+ # These are not needed for building
+ myconf="--disable-xmltoman --disable-subversion"
+
+ use doc \
+ && myconf="${myconf} --enable-doxygen --enable-lynx" \
+ || myconf="${myconf} --disable-doxygen --disable-lynx"
+
+ econf ${myconf} || die
+ emake || die
+}
+
+src_install() {
+ einstall || die
+
+ # Fix init.d configuration
+ cd ${D}/etc
+ rm -rf ifplugd/
+ rm -f init.d/ifplugd
+
+ use doc && dohtml doc/*.html doc/*.css
+
+ dodir /etc/conf.d
+ cp ${CONFFILE} conf.d/ifplugd
+
+ dosbin ${T}/ifplugd.action
+
+ exeinto /etc/init.d
+ doexe ${T}/ifplugd
+}