summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariusz Michaluk <d.michaluk@samsung.com>2014-05-08 13:13:32 +0200
committerPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>2014-06-18 16:45:58 +0200
commitba38c2266db75595333902181fe1e3848b4a46c9 (patch)
treeaad7767f59ab3c3cc7002acc71732f7a4810f1cd
parent62b465331393b5052cd3b3ed341ae427d33fedea (diff)
downloadebtables-ba38c2266db75595333902181fe1e3848b4a46c9.tar.gz
ebtables-ba38c2266db75595333902181fe1e3848b4a46c9.tar.bz2
ebtables-ba38c2266db75595333902181fe1e3848b4a46c9.zip
Add packaging directory and spec file
Change-Id: I7e29bf8200d71f3158700423a8c9ece1ffe7b91e Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
-rw-r--r--packaging/ebtables.spec54
-rw-r--r--packaging/no-as-needed.patch13
-rw-r--r--packaging/no-root-install.patch67
3 files changed, 134 insertions, 0 deletions
diff --git a/packaging/ebtables.spec b/packaging/ebtables.spec
new file mode 100644
index 0000000..2c8c2a1
--- /dev/null
+++ b/packaging/ebtables.spec
@@ -0,0 +1,54 @@
+Summary: Ethernet Bridge frame table administration tool
+Name: ebtables
+Version: 2.0.10
+Release: 4
+License: GPL-2.0+
+Group: Security/Network
+URL: http://ebtables.sf.net/
+Source: http://downloads.sf.net/ebtables/%{name}-v%{version}-%{release}.tar.gz
+
+# Gbp-Ignore-Patches: 0 1
+Patch0: no-root-install.patch
+Patch1: no-as-needed.patch
+
+%description
+Ethernet bridge tables is a firewalling tool to transparantly filter network
+traffic passing a bridge. The filtering possibilities are limited to link
+layer filtering and some basic filtering on higher network layers.
+
+The ebtables tool can be used together with the other Linux filtering tools,
+like iptables. There are no incompatibility issues.
+
+%prep
+%setup -q -n %{name}-v%{version}-%{release}
+
+# Gbp-Patch-Macros
+%patch0 -p1
+%patch1 -p1
+
+%build
+make \
+ %{?_smp_mflags} \
+ CFLAGS="${RPM_OPT_FLAGS}" \
+ LIBDIR="%{_libdir}/ebtables" \
+ BINDIR="/sbin" \
+ LDFLAGS="${RPM_LD_FLAGS} -Wl,-z,now"
+
+%install
+make \
+ DESTDIR="%{buildroot}" \
+ LIBDIR="%{_libdir}/ebtables" \
+ BINDIR="/sbin" \
+ install
+
+rm -rf %{buildroot}/etc/rc.d/init.d/ebtables
+rm -rf %{buildroot}/usr/local/man/man8/ebtables.8
+
+%files
+%defattr(-,root,root)
+%doc COPYING
+%config(noreplace) %{_sysconfdir}/ethertypes
+%config(noreplace) %{_sysconfdir}/sysconfig/ebtables-config
+%{_libdir}/ebtables/*.so
+/sbin/ebtables*
+
diff --git a/packaging/no-as-needed.patch b/packaging/no-as-needed.patch
new file mode 100644
index 0000000..78c3bb0
--- /dev/null
+++ b/packaging/no-as-needed.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index c1106a4..6bc2b48 100644
+--- a/Makefile
++++ b/Makefile
+@@ -90,7 +90,7 @@ libebtc.so: $(OBJECTS2)
+ $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2)
+
+ ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so
+- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
++ $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \
+ -Wl,-rpath,$(LIBDIR)
+
+ ebtablesu: ebtablesu.c
diff --git a/packaging/no-root-install.patch b/packaging/no-root-install.patch
new file mode 100644
index 0000000..613743a
--- /dev/null
+++ b/packaging/no-root-install.patch
@@ -0,0 +1,67 @@
+diff --git a/Makefile b/Makefile
+index c1106a4..79ee167 100644
+--- a/Makefile
++++ b/Makefile
+@@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
+ scripts: ebtables-save ebtables.sysv ebtables-config
+ cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
+ mkdir -p $(DESTDIR)$(BINDIR)
+- install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(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_
+ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
+- if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
++ if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
+ cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
+ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
+- if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
++ if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
+ rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
+
+ tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g')
+ $(MANDIR)/man8/ebtables.8: ebtables.8
+ mkdir -p $(DESTDIR)$(@D)
+ sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_
+- install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
++ install -m 0644 ebtables.8_ $(DESTDIR)$@
+ rm -f ebtables.8_
+
+ $(DESTDIR)$(ETHERTYPESFILE): ethertypes
+ mkdir -p $(@D)
+- install -m 0644 -o root -g root $< $@
++ install -m 0644 $< $@
+
+ .PHONY: exec
+ exec: ebtables ebtables-restore
+ mkdir -p $(DESTDIR)$(BINDIR)
+- install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+- install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
++ install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
++ install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
+
+ .PHONY: install
+ install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
+@@ -205,18 +205,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 *