[Frugalware-darcs] frugalware-current: ifplugd-0.28-1-i686

AlexExtreme alex at alex-smith.me.uk
Sat Jun 2 13:01:12 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=frugalware-current;a=darcs_commitdiff;h=20070602105808-46e39-eb5581a7f1e669fae7926dd4a99d76fe76b02681.gz;

[ifplugd-0.28-1-i686
AlexExtreme <alex at alex-smith.me.uk>**20070602105808
  * New package
] {
adddir ./source/network-extra/ifplugd
addfile ./source/network-extra/ifplugd/FrugalBuild
hunk ./source/network-extra/ifplugd/FrugalBuild 1
+# Compiling Time: 0.02 SBU
+# Maintainer: AlexExtreme <alex at alex-smith.me.uk>
+
+pkgname=ifplugd
+pkgver=0.28
+pkgrel=1
+pkgdesc="ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in"
+url="http://0pointer.de/lennart/projects/ifplugd/"
+depends=('libdaemon' 'bash')
+groups=('network-extra')
+backup=(etc/ifplugd/ifplugd.conf)
+archs=('i686')
+up2date="lynx -dump http://0pointer.de/lennart/projects/ifplugd/ | grep -i 'current release' | sed 's/.*[0-9]\]//'"
+source=($url/$pkgname-$pkgver.tar.gz iface-fix.patch rc.ifplugd ifplugd.action)
+sha1sums=('0f00e6b544c0b7ed6c66fc58cb74f038d3fba77a' \
+          'e1160bd73993b9f3056b6ae7a63842dcfa0db871' \
+          '0eb6bc0a8f8aae549b2728cb77139ed87a5e5ddb' \
+          '6ffa71577d8f89eb5edc7af2405f622155af322e')
+Fconfopts="$Fconfopts --with-initdir=/etc/rc.d"
+
+build() {
+	Fcd
+	Fbuild
+	Frm /etc/rc.d/ifplugd
+	Fexe /etc/ifplugd/ifplugd.action
+	Fsed "-fwI -u0 -d10" "-fwI -u2 -d2" $Fdestdir/etc/ifplugd/ifplugd.conf
+	Fsed "eth0" "auto" $Fdestdir/etc/ifplugd/ifplugd.conf
+}
+
+# optimization OK
addfile ./source/network-extra/ifplugd/iface-fix.patch
hunk ./source/network-extra/ifplugd/iface-fix.patch 1
+--- /trunk/src/interface.c	2005/11/28 16:17:38	132
++++ trunk/src/interface.c	2006/03/07 13:15:11	133
+@@ -22,9 +22,9 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/types.h>
+ #include <linux/sockios.h>
+ #include <linux/if_ether.h>
+-#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <linux/if.h>
addfile ./source/network-extra/ifplugd/ifplugd.action
hunk ./source/network-extra/ifplugd/ifplugd.action 1
+#!/bin/sh
+# $Id: ifplugd.action 99 2004-02-08 20:17:59Z lennart $
+
+# 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.
+
+# Ported to Frugalware Linux by Alex Smith <alex at alex-smith.me.uk>
+
+set -e
+
+if [ -z "$1" ] || [ -z "$2" ] ; then
+	logger -s -p local0.err -t ifplugd.action "Wrong arguments"
+	exit 1
+fi
+
+# Check whether a different profile was given on the kernel command line
+profile=$(grep network /proc/cmdline|sed 's/.*network=\([^ ]*\)\( .*\|$\)/\1/')
+
+if [ "$2" = "up" ]; then
+	# Bring up the interface
+	if [ -z "$profile" ]; then
+		exec netconfig start $1
+	else
+		exec netconfig $profile $1
+	fi
+elif [ "$2" = "down" ]; then
+	exec /sbin/netconfig stop $1
+fi
+
+exit 1
addfile ./source/network-extra/ifplugd/ifplugd.install
hunk ./source/network-extra/ifplugd/ifplugd.install 1
+post_install() {
+	if [ -e /usr/sbin/chkconfig ] && [ -x /usr/sbin/chkconfig ]; then
+		/usr/sbin/chkconfig --add rc.ifplugd
+	fi
+}
+
+post_upgrade() {
+	post_install $1
+}
+
+pre_remove() {
+	if [ -e /usr/sbin/chkconfig ] && [ -x /usr/sbin/chkconfig ]; then
+		/usr/sbin/chkconfig --del rc.ifplugd
+	fi
+}
+
+op=$1
+shift
+
+$op $*
addfile ./source/network-extra/ifplugd/rc.ifplugd
hunk ./source/network-extra/ifplugd/rc.ifplugd 1
+#!/bin/bash
+
+# Copyright (C) 2007 Alex Smith
+# rc.ifplugd for Frugalware
+# Distributed under the GPL license
+
+# chkconfig: 2345 10 89
+# description: Brings networks interfaces up and down automatically when \
+#              the cable is removed / inserted
+
+source /lib/initscripts/functions
+TEXTDOMAINDIR=/lib/initscripts/functions
+TEXTDOMAIN=ifplugd
+
+actions=(restart start stop status)
+daemon=$"Interface Plugging daemon"
+
+CFG=/etc/ifplugd/ifplugd.conf
+IFPLUGD=/usr/sbin/ifplugd
+
+test -x $IFPLUGD || exit 0
+
+if [ `id -u` != "0" ] && [ "$1" = "start" -o "$1" = "stop" ] ; then
+	echo "You must be root to start, stop or restart ifplugd."
+	exit 1
+fi
+
+[ -f $CFG ] && . $CFG
+[ "x$INTERFACES" = "xauto" ] && INTERFACES="`cat /proc/net/dev | awk '{ print $1 }' | egrep '^(eth|wlan)' | cut -d: -f1`"
+
+rc_start() {
+	ret=0
+	start_msg
+        for IF in $INTERFACES; do
+		A="`eval echo \$\{ARGS_${IF}\}`"
+		[ -z "$A" ] && A="$ARGS"
+		$IFPLUGD -i $IF $A
+		ret=$(($ret + $?))
+        done
+	ok $ret
+}
+
+rc_stop() {
+	ret=0
+	stop_msg
+        for IF in $INTERFACES; do 
+		$IFPLUGD -k -i $IF
+		ret=$(($ret + $?))
+        done
+	ok $ret
+}
+
+rc_status() {
+	for IF in $INTERFACES ; do
+		$IFPLUGD -c -i $IF
+	done
+}
+
+rc_exec $1
}


More information about the Frugalware-darcs mailing list