Difference between revisions of "Netplug"

From CBLFS
Jump to navigationJump to search
 
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
 +
|-
 
| http://www.red-bean.com/~bos/netplug/netplug-1.2.9.tar.bz2
 
| http://www.red-bean.com/~bos/netplug/netplug-1.2.9.tar.bz2
 
|-
 
|-
!Download Patches: (Currently in repo, will add links later)
+
!Download Patches (Currently in repo, will add links later):
 +
|-
 
| netplug-1.2.9-gcc4-1.patch
 
| netplug-1.2.9-gcc4-1.patch
 
|-
 
|-
Line 16: Line 18:
 
== Introduction to Netplug ==
 
== Introduction to Netplug ==
  
Netplug is a Linux daemon that brings up/down network interfaces in response to network cables being plugged in and out.  This application is mostly useful for a laptop or computer (used for lan parties?) that is often relocated to different LANs.
+
'''Netplug''' is a Linux daemon that brings up/down network interfaces in response to network cables being plugged in and out.  This application is mostly useful for a laptop or computer (used for lan parties?) that is often relocated to different LANs.
 +
 
 +
The netplugd script shared below does not yet replace the clfs-bootscripts network script, but works with it.  A later version of these instructions may include a netplugd script which DOES replace the clfs-bootscripts network script.
  
  
Line 28: Line 32:
 
== Configuration Information ==
 
== Configuration Information ==
  
This package does not use a configure script.   
+
This package does not use a configure script.  Any additional configuration must be made within the Makefile.
  
 
== Non-Multilib ==
 
== Non-Multilib ==
  
Compile the package:
+
Much of this, including the patches were ripped from the Gentoo ebuild.  These instructions did successfully install the application onto a pentium-m based x86 laptop.
  
./configure --prefix=/usr &&
+
Modify the Makefile:
make
 
  
Install the package
+
remove=" -ggdb3 "
 +
[[ " ${CFLAGS} " == *" -O"[0-9]" "* ]] && remove="${remove}-O3 "
 +
sed -i -e "s/${remove}/ /" Makefile
 +
sed -i '/bk_root/,$d' Makefile
  
make install
+
Apply patches:
  
== Multilib ==
+
patch -Np0 -i ../netplug-1.2.9-gcc4-1.patch
'''''This package does not provide any libraries so only one installation is needed.'''''
+
patch -Np1 -i ../netplug-1.2.9-remove-nest-1.patch
 +
patch -Np1 -i ../netplug-1.2.9-ignore-wireless-1.patch
  
=== 32Bit ===
+
Compile and install the package:
  
Compile the package:
 
 
CC="gcc ${BUILD32}" ./configure --prefix=/usr &&
 
 
  make
 
  make
 
Install the package
 
 
 
  make install
 
  make install
  
=== N32 ===
+
== Multilib ==
 +
'''''AFAICT this package does not provide any libraries so only one installation is needed.'''''
  
Compile the package:
+
=== 32Bit ===
  
CC="gcc ${BUILDN32}" ./configure --prefix=/usr \
+
'''''Must be tested and any instructions should be included by others'''''
    --libdir=/usr/lib32 &&
 
make
 
  
Install the package
+
=== N32 ===
  
make install
+
'''''Must be tested and any instructions should be included by others'''''
  
 
=== 64Bit ===
 
=== 64Bit ===
  
Compile the package:
+
'''''Must be tested and any instructions should be included by others'''''
  
CC="gcc ${BUILD64}" ./configure --prefix=/usr \
+
== Configuring ==
    --libdir=/usr/lib64 &&
 
make
 
  
Install the package
+
Create the netplugd script:
 
 
make install
 
 
 
== Configuring ==
 
  
This section should contain information about the post-installation configuration of a package, bootscript(s), other files, creating directories.
+
cat > /etc/rc.d/init.d/netplugd << "EOF
 +
#!/bin/sh
 +
########################################################################
 +
# Begin $rc_base/init.d/netplugd
 +
#
 +
# Description : Netplugd-1.2.9
 +
#
 +
# Authors    : Harvey Muller
 +
#
 +
# Version    : 00.01
 +
#
 +
# Notes      : Very berry beta
 +
#
 +
########################################################################
 +
 +
. /etc/sysconfig/rc
 +
. ${rc_functions}
 +
 +
[ -x /sbin/netplugd ] || exit 0
 +
 +
if [ -f /etc/sysconfig/netplugd ]; then
 +
    . /etc/sysconfig/netplugd
 +
fi
 +
 +
case "${1}" in
 +
start)
 +
boot_mesg "Starting network plug daemon..."
 +
loadproc /sbin/netplugd ${NETPLUGDARGS} -p /var/run/netplugd.pid
 +
                RETVAL=$?
 +
                echo
 +
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd
 +
;;
 +
 
 +
stop)
 +
boot_mesg "Stopping network plug daemon..."
 +
killproc netplugd
 +
                RETVAL=$?
 +
                echo
 +
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd
 +
;;
 +
 +
restart|reload)
 +
${0} stop
 +
${0} start
 +
;;
 +
 +
status)
 +
statusproc netplugd
 +
                RETVAL=$?
 +
;;
 +
 +
        condrestart)
 +
                [ -f /var/lock/subsys/netplugd ] && restart || :
 +
                ;;
 +
 +
*)
 +
echo "Usage: ${0} {start|stop|reload|restart|status|condrestart}"
 +
exit 1
 +
;;
 +
esac
 +
 +
exit $RETVAL
 +
 +
# End $rc_base/init.d/netplugd
 +
EOF
  
 
= Contents =
 
= Contents =

Revision as of 08:09, 26 December 2006

Download Source:
http://www.red-bean.com/~bos/netplug/netplug-1.2.9.tar.bz2
Download Patches (Currently in repo, will add links later):
netplug-1.2.9-gcc4-1.patch
netplug-1.2.9-ignore-wireless-1.patch
netplug-1.2.9-remove-nest-1.patch

Introduction to Netplug

Netplug is a Linux daemon that brings up/down network interfaces in response to network cables being plugged in and out. This application is mostly useful for a laptop or computer (used for lan parties?) that is often relocated to different LANs.

The netplugd script shared below does not yet replace the clfs-bootscripts network script, but works with it. A later version of these instructions may include a netplugd script which DOES replace the clfs-bootscripts network script.


Dependencies

Required

Configuration Information

This package does not use a configure script. Any additional configuration must be made within the Makefile.

Non-Multilib

Much of this, including the patches were ripped from the Gentoo ebuild. These instructions did successfully install the application onto a pentium-m based x86 laptop.

Modify the Makefile:

remove=" -ggdb3 "
[[ " ${CFLAGS} " == *" -O"[0-9]" "* ]] && remove="${remove}-O3 "
sed -i -e "s/${remove}/ /" Makefile
sed -i '/bk_root/,$d' Makefile

Apply patches:

patch -Np0 -i ../netplug-1.2.9-gcc4-1.patch
patch -Np1 -i ../netplug-1.2.9-remove-nest-1.patch
patch -Np1 -i ../netplug-1.2.9-ignore-wireless-1.patch

Compile and install the package:

make
make install

Multilib

AFAICT this package does not provide any libraries so only one installation is needed.

32Bit

Must be tested and any instructions should be included by others

N32

Must be tested and any instructions should be included by others

64Bit

Must be tested and any instructions should be included by others

Configuring

Create the netplugd script:

cat > /etc/rc.d/init.d/netplugd << "EOF
#!/bin/sh
########################################################################
# Begin $rc_base/init.d/netplugd
#
# Description : Netplugd-1.2.9
#
# Authors     : Harvey Muller
#
# Version     : 00.01
#
# Notes       : Very berry beta
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

[ -x /sbin/netplugd ] || exit 0

if [ -f /etc/sysconfig/netplugd ]; then
    . /etc/sysconfig/netplugd
fi

case "${1}" in
	start)
		boot_mesg "Starting network plug daemon..."
		loadproc /sbin/netplugd ${NETPLUGDARGS} -p /var/run/netplugd.pid
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd
		;;
 
	stop)
		boot_mesg "Stopping network plug daemon..."
		killproc netplugd
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd
		;;

	restart|reload)
		${0} stop
		${0} start
		;;

	status)
		statusproc netplugd
                RETVAL=$?
		;;

        condrestart)
                [ -f /var/lock/subsys/netplugd ] && restart || :
                ;;

	*)
		echo "Usage: ${0} {start|stop|reload|restart|status|condrestart}"
		exit 1
		;;
esac

exit $RETVAL

# End $rc_base/init.d/netplugd
EOF

Contents

Installed Programs: program1 program2

Installed Libraries: libone.so.1

Installed Directory: /usr/share/program

Short Descriptions

program1: a short description of the program

program2: a short description of the program

Retrieved from "?title=Netplug&oldid=6337"