diff --git a/ebtables-2.0.9-lsb.patch b/ebtables-2.0.9-lsb.patch new file mode 100644 index 0000000..721deea --- /dev/null +++ b/ebtables-2.0.9-lsb.patch @@ -0,0 +1,106 @@ +diff -up ebtables-v2.0.9-1/ebtables.sysv.lsb ebtables-v2.0.9-1/ebtables.sysv +--- ebtables-v2.0.9-1/ebtables.sysv.lsb 2010-01-15 11:39:31.000000000 +0100 ++++ ebtables-v2.0.9-1/ebtables.sysv 2010-01-15 12:52:24.000000000 +0100 +@@ -18,9 +18,9 @@ source /etc/sysconfig/network + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 0 + +-[ -x __EXEC_PATH__/ebtables ] || exit 1 +-[ -x __EXEC_PATH__/ebtables-save ] || exit 1 +-[ -x __EXEC_PATH__/ebtables-restore ] || exit 1 ++[ -x __EXEC_PATH__/ebtables ] || exit 5 ++[ -x __EXEC_PATH__/ebtables-save ] || exit 5 ++[ -x __EXEC_PATH__/ebtables-restore ] || exit 5 + + RETVAL=0 + prog="ebtables" +@@ -39,6 +39,7 @@ config=__SYSCONFIG__/$prog-config + [ -f "$config" ] && . "$config" + + start() { ++ [ "$EUID" != "0" ] && exit 4 + echo -n $"Starting $desc ($prog): " + if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then + for table in $(ls __SYSCONFIG__/ebtables.* 2>/dev/null | sed -e 's/.*ebtables\.//' -e '/save/d' ); do +@@ -50,7 +51,7 @@ start() { + + if [ $RETVAL -eq 0 ]; then + success "$prog startup" +- rm -f /var/lock/subsys/$prog ++ touch "/var/lock/subsys/$prog" + else + failure "$prog startup" + fi +@@ -58,6 +59,7 @@ start() { + } + + stop() { ++ [ "$EUID" != "0" ] && exit 4 + echo -n $"Stopping $desc ($prog): " + for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do + __EXEC_PATH__/ebtables -t $table --init-table || RETVAL=1 +@@ -71,7 +73,7 @@ stop() { + + if [ $RETVAL -eq 0 ]; then + success "$prog shutdown" +- rm -f /var/lock/subsys/$prog ++ rm -f "/var/lock/subsys/$prog" + else + failure "$prog shutdown" + fi +@@ -79,11 +81,13 @@ stop() { + } + + restart() { ++ [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save + stop + start + } + + save() { ++ [ "$EUID" != "0" ] && exit 4 + echo -n $"Saving $desc ($prog): " + if [ "$EBTABLES_TEXT_FORMAT" = "yes" ]; then + if [ -e __SYSCONFIG__/ebtables ]; then +@@ -116,30 +120,34 @@ save() { + + case "$1" in + start) ++ [ -f "/var/lock/subsys/$prog" ] && exit 0 + start + ;; + stop) + [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save + stop + ;; +- restart|reload) +- [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save ++ restart|force-reload) + restart + ;; +- condrestart) +- [ -e /var/lock/subsys/$prog ] && restart +- RETVAL=$? ++ reload) ++ [ ! -f "/var/lock/subsys/$prog" ] && exit 7 ++ restart ++ ;; ++ condrestart|try-restart) ++ [ ! -e "/var/lock/subsys/$prog" ] && exit 0 ++ restart + ;; + save) + save + ;; + status) ++ [ -f "/var/lock/subsys/$prog" ] && RETVAL=0 || RETVAL=3 + __EXEC_PATH__/ebtables-save +- RETVAL=$? + ;; + *) + echo $"Usage $0 {start|stop|restart|condrestart|save|status}" +- RETVAL=1 ++ RETVAL=2 + esac + + exit $RETVAL diff --git a/ebtables.spec b/ebtables.spec index ee2642c..5013fe8 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -1,17 +1,18 @@ Name: ebtables Version: 2.0.9 -Release: 2%{?dist} +Release: 4%{?dist} Summary: Ethernet Bridge frame table administration tool License: GPLv2+ Group: System Environment/Base URL: http://ebtables.sourceforge.net/ -Source0: http://dl.sourceforge.net/ebtables/ebtables-v%{version}-1.tar.gz +Source0: http://downloads.sourceforge.net/ebtables/ebtables-v%{version}-1.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /sbin/chkconfig Requires(postun): /sbin/service Patch0: ebtables-2.0.8-norootinst.patch Patch1: ebtables-2.0.8-cflags.patch Patch2: ebtables-2.0.8-buildid.patch +Patch3: ebtables-2.0.9-lsb.patch %description Ethernet bridge tables is a firewalling tool to transparently filter network @@ -29,19 +30,20 @@ like iptables. There are no known incompatibility issues. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 -b .lsb # Convert to UTF-8 f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f %build MY_CFLAGS=`echo $RPM_OPT_FLAGS -fPIC | sed -e 's/-fstack-protector//g'` -make %{?_smp_mflags} CFLAGS="$MY_CFLAGS" LIBDIR="%{_libdir}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}" +make %{?_smp_mflags} CFLAGS="$MY_CFLAGS" LIBDIR="/%{_lib}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}" %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_initrddir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig -make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="%{_libdir}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}" install +make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="/%{_lib}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}" install touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.filter touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.nat touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.broute @@ -72,13 +74,20 @@ fi %config(noreplace) %{_sysconfdir}/ethertypes %config(noreplace) %{_sysconfdir}/sysconfig/ebtables-config %{_initrddir}/ebtables -%{_libdir}/ebtables/ +/%{_lib}/ebtables/ /sbin/ebtables* %ghost %{_sysconfdir}/sysconfig/ebtables.filter %ghost %{_sysconfdir}/sysconfig/ebtables.nat %ghost %{_sysconfdir}/sysconfig/ebtables.broute %changelog +* Fri Jan 29 2010 Thomas Woerner - 2.0.9-4 +- moved ebtables modules to /lib[64]/ebtables (rhbz#558886) + +* Fri Jan 15 2010 Thomas Woerner - 2.0.9-3 +- fixed init script to be lsb conform (rhbz#536828) +- fixed download link according to package review + * Wed Aug 19 2009 Tom "spot" Callaway - 2.0.9-2 - fix source0 url