From f7f9a59031ba5d3d397f65abffc0852c4fbee60a Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Thu, 23 Aug 2007 14:49:27 +0000 Subject: [PATCH] Lots of fixes. License fix. buildid. --- ebtables-2.0.8-buildid.patch | 12 +++++ ebtables-2.0.8-cflags.patch | 19 ++++++++ ebtables-2.0.8-fixbrokendestdir.patch | 67 +++++++++++++++++++++++++++ ebtables-2.0.8-norootinst.patch | 63 +++++++++++++++++++++++++ ebtables.spec | 48 ++++++++++++------- 5 files changed, 191 insertions(+), 18 deletions(-) create mode 100644 ebtables-2.0.8-buildid.patch create mode 100644 ebtables-2.0.8-cflags.patch create mode 100644 ebtables-2.0.8-fixbrokendestdir.patch create mode 100644 ebtables-2.0.8-norootinst.patch diff --git a/ebtables-2.0.8-buildid.patch b/ebtables-2.0.8-buildid.patch new file mode 100644 index 0000000..ef7511d --- /dev/null +++ b/ebtables-2.0.8-buildid.patch @@ -0,0 +1,12 @@ +diff -up ebtables-v2.0.8-1/Makefile.BAD ebtables-v2.0.8-1/Makefile +--- ebtables-v2.0.8-1/Makefile.BAD 2007-08-23 09:57:40.000000000 -0400 ++++ ebtables-v2.0.8-1/Makefile 2007-08-23 09:58:11.000000000 -0400 +@@ -94,7 +94,7 @@ ebtables-standalone.o: ebtables-standalo + + .PHONY: libebtc + libebtc: $(OBJECTS2) +- $(LD) -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) ++ $(LD) --build-id -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) + + ebtables: $(OBJECTS) ebtables-standalone.o libebtc + $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ diff --git a/ebtables-2.0.8-cflags.patch b/ebtables-2.0.8-cflags.patch new file mode 100644 index 0000000..1e34a9e --- /dev/null +++ b/ebtables-2.0.8-cflags.patch @@ -0,0 +1,19 @@ +diff -up ebtables-v2.0.8-1/extensions/Makefile.BAD ebtables-v2.0.8-1/extensions/Makefile +--- ebtables-v2.0.8-1/extensions/Makefile.BAD 2007-08-23 09:52:37.000000000 -0400 ++++ ebtables-v2.0.8-1/extensions/Makefile 2007-08-23 09:52:50.000000000 -0400 +@@ -11,13 +11,13 @@ EXT_LIBSI+=$(foreach T,$(EXT_FUNC), -leb + EXT_LIBSI+=$(foreach T,$(EXT_TABLES), -lebtable_$(T)) + + extensions/ebt_%.so: extensions/ebt_%.o +- $(CC) -shared -o $@ -lc $< -nostartfiles ++ $(CC) $(CFLAGS) -shared -o $@ -lc $< -nostartfiles + + extensions/libebt_%.so: extensions/ebt_%.so + mv $< $@ + + extensions/ebtable_%.so: extensions/ebtable_%.o +- $(CC) -shared -o $@ -lc $< -nostartfiles ++ $(CC) $(CFLAGS) -shared -o $@ -lc $< -nostartfiles + + extensions/libebtable_%.so: extensions/ebtable_%.so + mv $< $@ diff --git a/ebtables-2.0.8-fixbrokendestdir.patch b/ebtables-2.0.8-fixbrokendestdir.patch new file mode 100644 index 0000000..26263e8 --- /dev/null +++ b/ebtables-2.0.8-fixbrokendestdir.patch @@ -0,0 +1,67 @@ +diff -up ebtables-v2.0.8-1/Makefile.destdir ebtables-v2.0.8-1/Makefile +--- ebtables-v2.0.8-1/Makefile.destdir 2007-08-23 10:05:00.000000000 -0400 ++++ ebtables-v2.0.8-1/Makefile 2007-08-23 10:05:44.000000000 -0400 +@@ -15,13 +15,8 @@ INITDIR:=/etc/rc.d/init.d + SYSCONFIGDIR:=/etc/sysconfig + DESTDIR:= + +-# include DESTDIR param +-override LIBDIR:=$(DESTDIR)$(LIBDIR)/$(PROGNAME) +-override MANDIR:=$(DESTDIR)$(MANDIR) +-override BINDIR:=$(DESTDIR)$(BINDIR) +-override ETCDIR:=$(DESTDIR)$(ETCDIR) +-override INITDIR:=$(DESTDIR)$(INITDIR) +-override SYSCONFIGDIR:=$(DESTDIR)$(SYSCONFIGDIR) ++# include PROGNAME in LIBDIR ++override LIBDIR:=$(LIBDIR)/$(PROGNAME) + + + CFLAGS:=-Wall -Wunused +@@ -163,34 +158,34 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\/ + .PHONY: scripts + scripts: ebtables-save ebtables.sysv ebtables-config + cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ +- install -m 0755 ebtables-save_ $(BINDIR)/ebtables-save ++ install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save + cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ +- install -m 0755 ebtables.sysv_ $(INITDIR)/ebtables ++ install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables + cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ +- install -m 0600 ebtables-config_ $(SYSCONFIGDIR)/ebtables-config ++ install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config + rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ + + $(MANDIR)/man8/ebtables.8: ebtables.8 +- mkdir -p $(@D) ++ mkdir -p $(DESTDIR)$(@D) + sed 's/$$(VERSION)/$(PROGVERSION)/' ebtables.8 | sed 's/$$(DATE)/$(PROGDATE)/' > ebtables.8_ +- install -m 0644 ebtables.8_ $@ ++ install -m 0644 ebtables.8_ $(DESTDIR)$@ + rm -f ebtables.8_ + + $(ETHERTYPESFILE): ethertypes +- mkdir -p $(@D) +- install -m 0644 $< $@ ++ mkdir -p $(DESTDIR)$(@D) ++ install -m 0644 $< $(DESTDIR)$@ + + .PHONY: exec + exec: ebtables ebtables-restore +- mkdir -p $(BINDIR) +- install -m 0755 $(PROGNAME) $(BINDIR)/$(PROGNAME) +- install -m 0755 ebtables-restore $(BINDIR)/ebtables-restore ++ mkdir -p $(DESTDIR)$(BINDIR) ++ install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) ++ install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore + + .PHONY: install + install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts +- mkdir -p $(LIBDIR) +- install -m 0755 extensions/*.so $(LIBDIR) +- install -m 0755 *.so $(LIBDIR) ++ mkdir -p $(DESTDIR)$(LIBDIR) ++ install -m 0755 extensions/*.so $(DESTDIR)$(LIBDIR) ++ install -m 0755 *.so $(DESTDIR)$(LIBDIR) + + .PHONY: clean + clean: diff --git a/ebtables-2.0.8-norootinst.patch b/ebtables-2.0.8-norootinst.patch new file mode 100644 index 0000000..47c99cf --- /dev/null +++ b/ebtables-2.0.8-norootinst.patch @@ -0,0 +1,63 @@ +diff -up ebtables-v2.0.8-1/Makefile.BAD ebtables-v2.0.8-1/Makefile +--- ebtables-v2.0.8-1/Makefile.BAD 2007-08-23 09:42:30.000000000 -0400 ++++ ebtables-v2.0.8-1/Makefile 2007-08-23 09:44:23.000000000 -0400 +@@ -163,28 +163,28 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\/ + .PHONY: scripts + scripts: ebtables-save ebtables.sysv ebtables-config + cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ +- install -m 0755 -o root -g root ebtables-save_ $(BINDIR)/ebtables-save ++ install -m 0755 ebtables-save_ $(BINDIR)/ebtables-save + cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ +- install -m 0755 -o root -g root ebtables.sysv_ $(INITDIR)/ebtables ++ install -m 0755 ebtables.sysv_ $(INITDIR)/ebtables + cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ +- install -m 0600 -o root -g root ebtables-config_ $(SYSCONFIGDIR)/ebtables-config ++ install -m 0600 ebtables-config_ $(SYSCONFIGDIR)/ebtables-config + rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ + + $(MANDIR)/man8/ebtables.8: ebtables.8 + mkdir -p $(@D) + sed 's/$$(VERSION)/$(PROGVERSION)/' ebtables.8 | sed 's/$$(DATE)/$(PROGDATE)/' > ebtables.8_ +- install -m 0644 -o root -g root ebtables.8_ $@ ++ install -m 0644 ebtables.8_ $@ + rm -f ebtables.8_ + + $(ETHERTYPESFILE): ethertypes + mkdir -p $(@D) +- install -m 0644 -o root -g root $< $@ ++ install -m 0644 $< $@ + + .PHONY: exec + exec: ebtables ebtables-restore + mkdir -p $(BINDIR) +- install -m 0755 -o root -g root $(PROGNAME) $(BINDIR)/$(PROGNAME) +- install -m 0755 -o root -g root ebtables-restore $(BINDIR)/ebtables-restore ++ install -m 0755 $(PROGNAME) $(BINDIR)/$(PROGNAME) ++ install -m 0755 ebtables-restore $(BINDIR)/ebtables-restore + + .PHONY: install + install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts +@@ -208,18 +208,18 @@ release: + rm -f extensions/ebt_inat.c + rm -rf $(CVSDIRS) + mkdir -p include/linux/netfilter_bridge +- install -m 0644 -o root -g root \ ++ install -m 0644 \ + $(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/ + # To keep possible compile error complaints about undefined ETH_P_8021Q + # off my back +- install -m 0644 -o root -g root \ ++ install -m 0644 \ + $(KERNEL_INCLUDES)/linux/if_ether.h include/linux/ +- install -m 0644 -o root -g root \ ++ install -m 0644 \ + $(KERNEL_INCLUDES)/linux/types.h include/linux/ +- install -m 0644 -o root -g root \ ++ install -m 0644 \ + $(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \ + include/linux/netfilter_bridge/ +- install -m 0644 -o root -g root \ ++ install -m 0644 \ + include/ebtables.h include/linux/netfilter_bridge/ + make clean + touch * diff --git a/ebtables.spec b/ebtables.spec index d6dc7de..3386d3d 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -2,14 +2,17 @@ Name: ebtables Version: 2.0.8 Release: 2%{?dist} Summary: Ethernet Bridge frame table administration tool -License: GPL +License: GPLv2+ Group: System Environment/Base URL: http://ebtables.sourceforge.net/ Source0: http://dl.sf.net/ebtables/ebtables-v%{version}-1.tar.gz -Source1: ebtables.sysv BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) PreReq: /sbin/chkconfig PreReq: /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.8-fixbrokendestdir.patch %description Ethernet bridge tables is a firewalling tool to transparently filter network @@ -24,23 +27,23 @@ like iptables. There are no known incompatibility issues. %prep %setup -q -n ebtables-v%{version}-1 +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build MY_CFLAGS=`echo $RPM_OPT_FLAGS -fPIC | sed -e 's/-fstack-protector//g'` -make %{?_smp_mflags} CFLAGS="$MY_CFLAGS" +make %{?_smp_mflags} CFLAGS="$MY_CFLAGS" LIBDIR="%{_libdir}" BINDIR="/sbin" MANDIR="%{_mandir}" %install rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_libdir} -install -m0755 extensions/*.so $RPM_BUILD_ROOT%{_libdir} -install -m0755 *.so $RPM_BUILD_ROOT%{_libdir} -install -D -m0755 ebtables $RPM_BUILD_ROOT/sbin/ebtables -install -D -m0755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/ebtables -install -D -m0644 ethertypes $RPM_BUILD_ROOT%{_sysconfdir}/ethertypes -install -D -m0644 ebtables.8 $RPM_BUILD_ROOT%{_mandir}/man8/ebtables.8 -touch $RPM_BUILD_ROOT%{_sysconfdir}/ebtables.filter -touch $RPM_BUILD_ROOT%{_sysconfdir}/ebtables.nat -touch $RPM_BUILD_ROOT%{_sysconfdir}/ebtables.broute +mkdir -p $RPM_BUILD_ROOT%{_initrddir} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="%{_libdir}" 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 %clean rm -rf $RPM_BUILD_ROOT @@ -66,14 +69,23 @@ fi %doc ChangeLog COPYING THANKS %doc %{_mandir}/man8/ebtables.8* %config(noreplace) %{_sysconfdir}/ethertypes +%config(noreplace) %{_sysconfdir}/sysconfig/ebtables-config %{_initrddir}/ebtables -%{_libdir}/libebt*.so -/sbin/ebtables -%ghost %{_sysconfdir}/ebtables.filter -%ghost %{_sysconfdir}/ebtables.nat -%ghost %{_sysconfdir}/ebtables.broute +%{_libdir}/ebtables/ +/sbin/ebtables* +%ghost %{_sysconfdir}/sysconfig/ebtables.filter +%ghost %{_sysconfdir}/sysconfig/ebtables.nat +%ghost %{_sysconfdir}/sysconfig/ebtables.broute %changelog +* Thu Aug 23 2007 Tom "spot" Callaway 2.0.8-3 +- use _libdir/ebtables to match upstream RPATH (bugzilla 248865) +- correct license tag +- use upstream init script +- enable build-id +- use cflags for all compiles +- be sane with DESTDIR + * Mon Jul 9 2007 Tom "spot" Callaway 2.0.8-2 - remove "Fedora Core" reference in spec