2 # $Id: iproute.spec 7668 2008-01-08 11:49:43Z thierry $
4 %define url $URL: svn+ssh://thierry@svn.planet-lab.org/svn/iproute2/trunk/iproute.spec $
7 %define version 1.4.1.1
10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13 Packager: PlanetLab Central <support@planet-lab.org>
14 Distribution: PlanetLab %{plrelease}
15 URL: %(echo %{url} | cut -d ' ' -f 2)
18 %define linux_header 0
20 Summary: Tools for managing Linux kernel packet filtering capabilities.
24 Source: http://www.netfilter.org/%{name}-%{version}.tar.bz2
25 %define SOURCE1 iptables.init
26 %define SOURCE2 iptables-config
27 %define SOURCE3 planetlab-config
28 Group: System Environment/Base
29 #URL: http://www.netfilter.org/
30 BuildRoot: %{_tmppath}/%{name}-buildroot
32 BuildPrereq: /usr/bin/perl
33 Requires: kernel >= 2.4.20
34 Requires(post,postun): chkconfig
36 BuildRequires: kernel-devel
39 Summary: IPv6 support for iptables.
40 Group: System Environment/Base
41 Requires: %{name} = %{version}
45 Summary: Development package for iptables.
46 Group: System Environment/Base
47 Requires: %{name} = %{version}
51 The iptables utility controls the network packet filtering code in the
52 Linux kernel. If you need to set up firewalls and/or IP masquerading,
53 you should install this package.
56 The iptables package contains IPv6 (the next version of the IP
57 protocol) support for iptables. Iptables controls the Linux kernel
58 network packet filtering code, allowing you to set up firewalls and IP
61 Install iptables-ipv6 if you need to set up firewalling for your
62 network and you are using ipv6.
66 The iptables utility controls the network packet filtering code in the
67 Linux kernel. If you need to set up firewalls and/or IP masquerading,
68 you should install this package.
76 # Put it to a reasonable place
77 find . -type f -exec perl -pi -e "s,/usr,%{prefix},g" {} \;
81 OPT="$RPM_OPT_FLAGS -I$TOPDIR/include"
83 %define KERNEL %(rpm -q --qf '%%{VERSION}-%%{RELEASE}-%%{ARCH}\\n' kernel-devel | tail -n 1 )
84 count=$(rpm -q kernel-devel| wc -l)
85 if [ $count -gt 1 ] ; then
86 echo "WARNING: choosing kernel-devel-%{KERNEL}"
87 echo " but there are other kernel-devel packages installed: $(rpm -q kernel-devel)"
90 %define KERNEL_DIR "/usr/src/kernels/%{KERNEL}"
92 ./configure --disable-devel
94 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib}
95 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib} iptables-save iptables-restore
96 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib} ip6tables-save ip6tables-restore
99 mkdir -p %{buildroot}/sbin
100 make install DESTDIR=%{buildroot} KERNEL_DIR=%{KERNEL_DIR} BINDIR=/sbin LIBDIR=/%{_lib} MANDIR=%{_mandir}
101 cp ip{6,}tables-{save,restore} $RPM_BUILD_ROOT/sbin
102 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
103 cp iptables-*.8 $RPM_BUILD_ROOT%{_mandir}/man8
104 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
105 install -c -m755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/iptables
106 sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE1} > ip6tables.init
107 install -c -m755 ip6tables.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ip6tables
108 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
109 install -c -m755 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/iptables-config
110 install -c -m755 %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/iptables
111 sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE2} > ip6tables-config
112 install -c -m755 ip6tables-config $RPM_BUILD_ROOT/etc/sysconfig/ip6tables-config
115 rm -rf $RPM_BUILD_ROOT
118 /sbin/chkconfig --add iptables
119 if [ "$PL_BOOTCD" != "1" ] ; then
120 /sbin/service iptables restart
124 if [ "$1" = 0 ]; then
125 /sbin/chkconfig --del iptables
129 /sbin/chkconfig --add ip6tables
130 if [ "$PL_BOOTCD" != "1" ] ; then
131 /sbin/service ip6tables restart
135 if [ "$1" = 0 ]; then
136 /sbin/chkconfig --del ip6tables
140 %defattr(-,root,root,0755)
141 %doc COPYING INSTALL INCOMPATIBILITIES
142 %config %attr(0755,root,root) /etc/rc.d/init.d/iptables
143 %config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables-config
144 %config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables
145 /usr/local/sbin/iptables*
147 /usr/local/bin/iptables*
148 /usr/local/libexec/xtables/*
149 %{_mandir}/man8/iptables*
152 %defattr(-,root,root,0755)
153 %config %attr(0755,root,root) /etc/rc.d/init.d/ip6tables
154 %config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables-config
156 %{_mandir}/man8/ip6tables*
157 /%{_lib}/iptables/libip6t*
161 %defattr(-,root,root,0755)
162 %{_includedir}/libipq.h
164 #%{_libdir}/libiptc.a
169 * Sun Feb 22 2009 Sapan Bhatia <sapanb@cs.princeton.edu>
170 - Checking in initial version of iptables 1.4.1.1