Blob Blame History Raw
%define prever	rc1

Name:		ebtables
Version:	2.0.8
Release:	0.4.%{prever}%{?dist}
Summary:	Ethernet Bridge frame table administration tool
License:	GPL
Group:		System Environment/Base
URL:		http://ebtables.sourceforge.net/
Source0:	http://dl.sf.net/ebtables/ebtables-v%{version}-%{prever}.tar.gz
Source1:	ebtables.sysv
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
PreReq:		/sbin/chkconfig
PreReq:		/sbin/service

%description
Ethernet bridge tables is a firewalling tool to transparently filter network
traffic passing a bridge. The filtering possibilities are limited to link
layer filtering and some basic filtering on higher network layers.

This tool is the userspace control for the bridge and ebtables kernel
components (built by default in Fedora Core kernels).

The ebtables tool can be used together with the other Linux filtering tools,
like iptables. There are no known incompatibility issues.

%prep
%setup -q -n ebtables-v%{version}-%{prever}

%build
MY_CFLAGS=`echo $RPM_OPT_FLAGS -fPIC | sed -e 's/-fstack-protector//g'`
make %{?_smp_mflags} CFLAGS="$MY_CFLAGS"

%install
rm -rf $RPM_BUILD_ROOT
install -D -m0755 extensions/*.so $RPM_BUILD_ROOT%{_libdir}
install -D -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

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add ebtables
/sbin/ldconfig

%preun
if [ $1 -eq 0 ]; then
	/sbin/service ebtables stop &>/dev/null || :
	/sbin/chkconfig --del ebtables
fi

%postun
if [ $1 -ge 1 ]; then
	/sbin/service ebtables condrestart &> /dev/null || :
fi
/sbin/ldconfig

%files
%defattr(-, root, root, 0755)
%doc ChangeLog COPYING THANKS
%doc %{_mandir}/man8/ebtables.8*
%config(noreplace) %{_sysconfdir}/ethertypes
%{_initrddir}/ebtables
%{_libdir}/libebt*.so
/sbin/ebtables
%ghost %{_sysconfdir}/ebtables.filter
%ghost %{_sysconfdir}/ebtables.nat
%ghost %{_sysconfdir}/ebtables.broute

%changelog
* Sun Apr  2 2006 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.8-0.4.rc1
- package up the shared libs too

* Wed Mar 29 2006 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.8-0.3.rc1
- use -fPIC

* Wed Mar 29 2006 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.8-0.2.rc1
- broken tagging

* Tue Jan 10 2006 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.8-0.1.rc1
- bump to 2.0.8-rc1

* Mon Jul  4 2005 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-7
- buildsystem error requires artificial release bump

* Mon Jul  4 2005 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-6
- actually touch ghosted files

* Fri Jul  1 2005 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-5
- fix sysv file

* Fri Jul  1 2005 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-4
- remove INSTALL file
- add some text to description, correct typos
- fix %postun
- add PreReqs
- add %ghost config files

* Tue May 31 2005 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-3
- reworked for Fedora Extras
- add gcc4 fix
- move init file into SOURCE1

* Thu Dec 02 2004 Dag Wieers <dag@wieers.com> - 2.0.6-2
- Added patch for gcc 3.4. (Nigel Smith)

* Tue Apr 27 2004 Dag Wieers <dag@wieers.com> - 2.0.6-2
- Cosmetic changes.

* Tue Apr 27 2004 Dag Wieers <dag@wieers.com> - 2.0.6-1
- Initial package. (using DAR)