summaryrefslogtreecommitdiffstats
path: root/ifplugd
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2006-11-07 23:20:54 +0000
committer Eric Hameleers <alien@slackware.com>2006-11-07 23:20:54 +0000
commit76d33871364ea0897d886c6c5652e020e6f5bfbd (patch)
treedca4146ac1b118539473468323f606090c4b1d62 /ifplugd
parent2fd57b663e815cda2362e4f2637bfa8fcb6bf0f4 (diff)
downloadasb-76d33871364ea0897d886c6c5652e020e6f5bfbd.tar.gz
asb-76d33871364ea0897d886c6c5652e020e6f5bfbd.tar.xz
Initial revision
Diffstat (limited to 'ifplugd')
-rwxr-xr-xifplugd/build/ifplugd.SlackBuild158
-rw-r--r--ifplugd/build/ifplugd.action.patch13
-rw-r--r--ifplugd/build/ifplugd.interface.patch14
-rw-r--r--ifplugd/build/ifplugd.slack-desc19
4 files changed, 204 insertions, 0 deletions
diff --git a/ifplugd/build/ifplugd.SlackBuild b/ifplugd/build/ifplugd.SlackBuild
new file mode 100755
index 00000000..d388eb0d
--- /dev/null
+++ b/ifplugd/build/ifplugd.SlackBuild
@@ -0,0 +1,158 @@
+#!/bin/sh
+# Copyright (c) 2006 Eric Hameleers <alien@sox.homeip.net>
+# Distributed under the terms of the GNU General Public License, Version 2
+# ------------------------------------------------------------------------------
+#
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: ifplugd
+# URL: http://0pointer.de/lennart/projects/ifplugd/
+# Needs: libdaemon
+# Changelog:
+# 0.23-1: 13/apr/2004 by Eric Hameleers
+# * Initial build
+# 0.28-1: 07/oct/2005 by Eric Hameleers
+# * Update.
+#
+# ------------------------------------------------------------------------------
+#
+# Run 'sh SlackBuild --cleanup' to build a Slackware package.
+# The package (.tgz) plus descriptive .txt file are created in /tmp .
+# Install using 'installpkg'.
+#
+# ------------------------------------------------------------------------------
+
+
+# --- INIT ---
+
+# Set initial variables:
+CWD=`pwd`
+if [ "$TMP" = "" ]; then
+ TMP=/tmp
+fi
+
+PRGNAM=ifplugd
+VERSION=0.28
+ARCH=i486
+BUILD=1
+
+PKG=$TMP/package-$PRGNAM
+
+if [ ! -d $TMP/tmp-$PRGNAM ]; then
+ mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+fi
+if [ ! -d $PKG ]; then
+ mkdir -p $PKG # place for the package to be built
+fi
+
+# Clean up left-overs
+rm -r $PKG/*
+
+# --- PACKAGE BUILDING ---
+
+# Explode the package framework:
+cd $PKG
+explodepkg $CWD/_$PRGNAM.tar.gz
+
+echo "+=================+"
+echo "| $PRGNAM-$VERSION |"
+echo "+=================+"
+
+cd $TMP/tmp-$PRGNAM
+
+echo "Extracting the source tarball..."
+tar xzvf $CWD/$PRGNAM-$VERSION.tar.gz
+
+cd $PRGNAM-$VERSION
+patch -p1 < $CWD/${PRGNAM}.action.patch
+patch -p0 < $CWD/${PRGNAM}.interface.patch
+chown -R root.root .
+
+./configure --with-initdir=/etc/rc.d \
+ --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+ | tee $CWD/config.log
+make | tee $CWD/make.log
+installwatch -o $CWD/install.log make DESTDIR=$PKG install
+
+mv $PKG/etc/rc.d/ifplugd $PKG/etc/rc.d/rc.ifplugd.new
+chmod -x $PKG/etc/rc.d/rc.ifplugd.new
+
+
+# --- POST-INSTALL SCRIPT ---
+#
+#
+# --- Fabricate the 'doinst.sh' script: ------
+
+mkdir -p $PKG/install
+
+cat <<_EOT_ >> $PKG/install/doinst.sh
+config() {
+ for infile in \$1; do
+ NEW="\$infile"
+ OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+ done
+}
+config etc/rc.d/rc.ifplugd.new
+
+# Update rc.local so that the ifplugd daemon will be started on boot
+if ! grep "rc.ifplugd" etc/rc.d/rc.local 1>/dev/null 2>&1 ; then
+ cat <<-_EOM_ >> etc/rc.d/rc.local
+ if [ -x /etc/rc.d/rc.ifplugd ]; then
+ # Start ifplugd
+ echo "Starting ifplugd: /etc/rc.d/rc.ifplugd start"
+ /etc/rc.d/rc.ifplugd start
+ fi
+ _EOM_
+fi
+_EOT_
+
+
+# --- DOCUMENTATION ---
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE \
+ doc/{NEWS,README.SuSE,README,README.html,style.css,SUPPORTED_DRIVERS} \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+chown root.root $PKG/usr/doc/$PRGNAM-$VERSION/*
+chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
+
+gzip -9f $PKG/usr/man/*/*
+
+
+# --- OWNERSHIP, RIGHTS ---
+
+chown -R root.root $PKG
+chown root.bin $PKG/usr/{bin,sbin}/*
+chmod -R o-w $PKG
+
+
+# --- PACKAGE DESCRIPTION ---
+
+mkdir -p $PKG/install 2>/dev/null
+cat $CWD/${PRGNAM}.slack-desc > $PKG/install/slack-desc
+
+
+# --- BUILDING ---
+
+# Build the package:
+cd $PKG
+makepkg --linkadd y --chown n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz
+(cd $TMP && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5)
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txt
+
+cd $CWD
+
+# Clean up the extra stuff:
+if [ "$1" = "--cleanup" ]; then
+ rm -rf $TMP/tmp-$PRGNAM
+ rm -rf $PKG
+fi
diff --git a/ifplugd/build/ifplugd.action.patch b/ifplugd/build/ifplugd.action.patch
new file mode 100644
index 00000000..662a1418
--- /dev/null
+++ b/ifplugd/build/ifplugd.action.patch
@@ -0,0 +1,13 @@
+diff -urN ifplugd-0.28.orig/conf/ifplugd.action ifplugd-0.28/conf/ifplugd.action
+--- ifplugd-0.28.orig/conf/ifplugd.action 2004-03-03 02:02:18.000000000 +0100
++++ ifplugd-0.28/conf/ifplugd.action 2005-10-07 11:34:50.000000000 +0200
+@@ -24,7 +24,7 @@
+ exit 1
+ fi
+
+-[ "$2" = "up" ] && exec /sbin/ifup $1
+-[ "$2" = "down" ] && exec /sbin/ifdown $1
++[ "$2" = "up" ] && exec /etc/rc.d/rc.inet1 ${1}_start
++[ "$2" = "down" ] && exec /etc/rc.d/rc.inet1 ${1}_stop
+
+ exit 1
diff --git a/ifplugd/build/ifplugd.interface.patch b/ifplugd/build/ifplugd.interface.patch
new file mode 100644
index 00000000..98dea99b
--- /dev/null
+++ b/ifplugd/build/ifplugd.interface.patch
@@ -0,0 +1,14 @@
+--- src/interface.c.org 2006-11-08 00:06:19.000000000 +0100
++++ src/interface.c 2006-11-08 00:04:27.000000000 +0100
+@@ -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>
+
diff --git a/ifplugd/build/ifplugd.slack-desc b/ifplugd/build/ifplugd.slack-desc
new file mode 100644
index 00000000..7fc72637
--- /dev/null
+++ b/ifplugd/build/ifplugd.slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+ |-----handy-ruler------------------------------------------------------|
+ifplugd: ifplugd (automatically configuration of ethernet interfaces)
+ifplugd:
+ifplugd: ifplugd is a Linux daemon which will automatically configure your
+ifplugd: ethernet device when a cable is plugged in and automatically
+ifplugd: unconfigure it if the cable is pulled. This is useful on laptops
+ifplugd: with onboard network adapters, since it will only configure the
+ifplugd: interface when a cable is really connected.
+ifplugd: ifplugd interfaces with your distribution's native network
+ifplugd: configuration utilities.
+ifplugd: Author:
+ifplugd: Lennart Poettering <mzqnrzba@0pointer.de>
+