mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-20 19:41:34 +01:00
network/quagga: Added (IP routing daemons)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
parent
ae22224689
commit
a5d362da51
12 changed files with 331 additions and 0 deletions
BIN
network/quagga/Makefile.am.diff.gz
Normal file
BIN
network/quagga/Makefile.am.diff.gz
Normal file
Binary file not shown.
6
network/quagga/README
Normal file
6
network/quagga/README
Normal file
|
@ -0,0 +1,6 @@
|
|||
Quagga is a routing software suite, providing implementations of OSPFv2,
|
||||
OSPFv3, RIP v1 and v2, RIPng and BGP-4 for Unix platforms, particularly
|
||||
FreeBSD, Linux, Solaris and NetBSD. Quagga is a fork of GNU Zebra which
|
||||
was developed by Kunihiro Ishiguro. The Quagga tree aims to build a more
|
||||
involved community around Quagga than the current centralised model of
|
||||
GNU Zebra.
|
34
network/quagga/doinst.sh
Normal file
34
network/quagga/doinst.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
config() {
|
||||
NEW="$1"
|
||||
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...
|
||||
}
|
||||
|
||||
preserve_perms() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
if [ -e $OLD ]; then
|
||||
cp -a $OLD ${NEW}.incoming
|
||||
cat $NEW > ${NEW}.incoming
|
||||
mv ${NEW}.incoming $NEW
|
||||
fi
|
||||
config $NEW
|
||||
}
|
||||
|
||||
preserve_perms etc/rc.d/rc.quagga.new
|
||||
preserve_perms etc/rc.d/rc.watchquagga.new
|
||||
|
||||
config etc/logrotate.d/quagga.new
|
||||
|
||||
# Install the info files for this package
|
||||
if [ -x usr/bin/install-info ]; then
|
||||
usr/bin/install-info --info-dir=/usr/info /usr/info/quagga.info.gz 2>/dev/null
|
||||
fi
|
||||
|
BIN
network/quagga/ospf6_area.c.diff.gz
Normal file
BIN
network/quagga/ospf6_area.c.diff.gz
Normal file
Binary file not shown.
166
network/quagga/quagga.SlackBuild
Normal file
166
network/quagga/quagga.SlackBuild
Normal file
|
@ -0,0 +1,166 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for Quagga routing suite
|
||||
# Written by zhilla2_at_gm@il.kkom (spamprotected, figure domain out)
|
||||
# This script is in the public domain
|
||||
|
||||
# Don't forget to set USE_PAM if you use it.
|
||||
|
||||
PRGNAM=quagga
|
||||
VERSION=${VERSION:-0.99.17}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) export ARCH=i486 ;;
|
||||
arm*) export ARCH=arm ;;
|
||||
*) export ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "s390" ]; then
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Bail if user or group isn't valid on your system
|
||||
if ! grep ^quagga: /etc/passwd 2>&1 > /dev/null; then
|
||||
|
||||
cat << EOF
|
||||
|
||||
You must have a quagga user and group to run this script
|
||||
|
||||
# groupadd -g 245 quagga
|
||||
# useradd -g quagga -u 245 -s /bin/false -c "Quagga routing suite" -d /var/run/quagga/ quagga
|
||||
|
||||
EOF
|
||||
|
||||
exit
|
||||
elif ! grep ^quaggavt: /etc/group 2>&1 > /dev/null; then
|
||||
|
||||
cat << EOF
|
||||
|
||||
You must have a quaggavt group to run this script
|
||||
|
||||
# groupadd -g 246 quaggavt
|
||||
|
||||
EOF
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar zxvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
||||
-exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
||||
-exec chmod 644 {} \;
|
||||
|
||||
# use libpam for PAM support in vtysh
|
||||
USE_PAM=${USE_PAM:-NO}
|
||||
|
||||
if [ "$USE_PAM" == 'YES' ]; then
|
||||
DO_PAM="--with-libpam"
|
||||
zcat $CWD/vtysh_user.c.diff.gz | patch -p1
|
||||
mkdir -p $PKG/etc/pam.d
|
||||
cat $CWD/quagga.pam > $PKG/etc/pam.d/quagga
|
||||
else
|
||||
DO_PAM="--without-libpam"
|
||||
fi
|
||||
|
||||
zcat $CWD/Makefile.am.diff.gz | patch -p1
|
||||
zcat $CWD/ospf6_area.c.diff.gz | patch -p1
|
||||
|
||||
#./bootstrap.sh
|
||||
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/quagga \
|
||||
--localstatedir=/var/run/quagga \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--mandir=/usr/man \
|
||||
--infodir=/usr/info \
|
||||
--enable-vtysh \
|
||||
--enable-opaque-lsa \
|
||||
--enable-ospf-te \
|
||||
--enable-dependency-tracking \
|
||||
--enable-user=quagga \
|
||||
--enable-group=quagga \
|
||||
--enable-vty-group=quaggavt \
|
||||
--enable-rtadv \
|
||||
${DO_PAM}
|
||||
# Some options useful for troubleshooting compiling
|
||||
# problems
|
||||
# --disable-capabilities \
|
||||
# --disable-ipv6 \
|
||||
|
||||
sed -i -e "s#/lib#/lib${LIBDIRSUFFIX}#" Makefile
|
||||
|
||||
make
|
||||
make install DESTDIR=$PKG
|
||||
|
||||
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
||||
chown -R root.root $PKG/usr/sbin
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
rm -f $PKG/usr/info/dir
|
||||
gzip -9 $PKG/usr/info/*
|
||||
|
||||
mv $TMP/$PRGNAM-$VERSION/*/*.sample $PKG/etc/quagga
|
||||
chown root.quagga $PKG/etc/quagga ; chmod 750 $PKG/etc/quagga
|
||||
chown -R root.quagga $PKG/etc/quagga/* ; chmod 640 $PKG/etc/quagga/*.sample
|
||||
|
||||
mkdir -p $PKG/var/run/quagga $PKG/var/log/quagga
|
||||
chown quagga.quagga $PKG/var/run/quagga ; chmod 770 $PKG/var/run/quagga
|
||||
chown quagga.quagga $PKG/var/log/quagga ; chmod 770 $PKG/var/log/quagga
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a \
|
||||
AUTHORS ChangeLog COPYING* README INSTALL REPORTING-BUGS TODO SERVICES \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
mkdir -p $PKG/etc/rc.d
|
||||
cat $CWD/rc.quagga > $PKG/etc/rc.d/rc.quagga.new
|
||||
cat $CWD/rc.watchquagga > $PKG/etc/rc.d/rc.watchquagga.new
|
||||
|
||||
mkdir -p $PKG/etc/logrotate.d
|
||||
cat $CWD/quagga.logrotate > $PKG/etc/logrotate.d/quagga.new
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
10
network/quagga/quagga.info
Normal file
10
network/quagga/quagga.info
Normal file
|
@ -0,0 +1,10 @@
|
|||
PRGNAM="quagga"
|
||||
VERSION="0.99.17"
|
||||
HOMEPAGE="http://www.quagga.net/"
|
||||
DOWNLOAD="http://www.quagga.net/download/quagga-0.99.17.tar.gz"
|
||||
MD5SUM="37b9022adca04b03863d2d79787e643f"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
MAINTAINER="Marin Glibic"
|
||||
EMAIL="zhilla2@gmail.com"
|
||||
APPROVED="Niels Horn"
|
17
network/quagga/quagga.logrotate
Normal file
17
network/quagga/quagga.logrotate
Normal file
|
@ -0,0 +1,17 @@
|
|||
/var/log/quagga/*.log {
|
||||
daily
|
||||
sharedscripts
|
||||
missingok
|
||||
compress
|
||||
rotate 14
|
||||
create 640 quagga quagga
|
||||
|
||||
postrotate
|
||||
for i in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
|
||||
if [ -e /var/run/quagga/$i.pid ] ; then
|
||||
kill -USR1 $(cat /var/run/quagga/$i.pid)
|
||||
fi
|
||||
|
||||
done
|
||||
endscript
|
||||
}
|
3
network/quagga/quagga.pam
Normal file
3
network/quagga/quagga.pam
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Any user may call vtysh but only those belonging to the group quaggavty can
|
||||
# actually connect to the socket and use the program.
|
||||
auth sufficient pam_permit.so
|
43
network/quagga/rc.quagga
Normal file
43
network/quagga/rc.quagga
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
|
||||
# rc.quagga will try to start any service that has configured a config file in /etc/quagga
|
||||
|
||||
start() {
|
||||
|
||||
for SERVICE in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
|
||||
if [ -r /etc/quagga/$SERVICE.conf ] ; then
|
||||
echo -n "Starting ${SERVICE}: " && /usr/sbin/${SERVICE} -d && echo "done"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
for SERVICE in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
|
||||
echo -n "Stopping ${SERVICE}: "
|
||||
killall $SERVICE 2>/dev/null && echo -n "done" || echo -n "not started"
|
||||
echo
|
||||
done
|
||||
}
|
||||
|
||||
restart() {
|
||||
|
||||
stop && sleep 2s && start
|
||||
if [ -x /etc/rc.d/rc.watchquagga ] ; then
|
||||
sh /etc/rc.d/rc.watchquagga restart
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
start
|
||||
;;
|
||||
'stop')
|
||||
stop
|
||||
;;
|
||||
'restart')
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "usage $0 start|stop|restart"
|
||||
esac
|
40
network/quagga/rc.watchquagga
Normal file
40
network/quagga/rc.watchquagga
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
start() {
|
||||
if [ -x /usr/sbin/watchquagga ]; then
|
||||
|
||||
for i in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
|
||||
if [ -e /var/run/quagga/$i.pid ] ; then
|
||||
WATCHSERVICES="${WATCHSERVICES} ${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
echo -n "Starting watchquagga: "
|
||||
/usr/sbin/watchquagga -dz -R '/etc/rc.d/rc.quagga restart' $WATCHSERVICES || exit 1
|
||||
echo "done"
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Stopping watchquagga: "
|
||||
killall watchquagga 2>/dev/null && echo -n "done" || echo -n "not started"
|
||||
echo
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop && sleep 2s && start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
start
|
||||
;;
|
||||
'stop')
|
||||
stop
|
||||
;;
|
||||
'restart')
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "usage $0 start|stop|restart"
|
||||
esac
|
12
network/quagga/slack-desc
Normal file
12
network/quagga/slack-desc
Normal file
|
@ -0,0 +1,12 @@
|
|||
|-----handy-ruler------------------------------------------------------|
|
||||
quagga: quagga (IP routing daemons)
|
||||
quagga:
|
||||
quagga: Quagga is a routing software suite, providing implementations of
|
||||
quagga: OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for Unix platforms.
|
||||
quagga: Quagga is a fork of GNU Zebra.
|
||||
quagga:
|
||||
quagga:
|
||||
quagga:
|
||||
quagga:
|
||||
quagga:
|
||||
quagga:
|
BIN
network/quagga/vtysh_user.c.diff.gz
Normal file
BIN
network/quagga/vtysh_user.c.diff.gz
Normal file
Binary file not shown.
Loading…
Reference in a new issue