+
+%define _kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
+%define _kernel24 %(echo %{_kernel_ver} | grep -q '2\.[012]\.' ; echo $?)
+%if %{_kernel24}
+%define _kernel_series 2.4
+%define _with_pivot_root 1
+%else
+%define _kernel_series 2.2
+%endif
+
Summary: Transparent FTP proxy
Summary(pl): Prze¼roczyste proxy FTP
Name: frox
Version: 0.7.5
-Release: 1
+Release: 1@%{_kernel_series}
License: GPL
Group: Networking/Daemons
Source0: http://frox.sourceforge.net/download/%{name}-%{version}.tar.bz2
Source1: %{name}.init
-Source2: %{name}.conf
+Source2: %{name}.sysconfig
+Patch0: %{name}-config.patch
URL: http://frox.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
Prereq: rc-scripts
Prereq: /sbin/chkconfig
-BuildConflicts: kernel-headers < 2.3.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%prep
%setup -q
+%patch0 -p1
%build
aclocal
%configure \
--enable-http-cache \
--enable-local-cache \
- --enable-libiptc \
+ %{?_kernel24:--enable-libiptc} \
+ %{?!_kernel24:--disable-libiptc} \
--enable-transparent-data \
--enable-configfile=%{_sysconfdir}/frox.conf
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_mandir}/man8} \
- $RPM_BUILD_ROOT/var/cache/frox/0{1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f}
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{_mandir}/man{5,8}} \
+ $RPM_BUILD_ROOT/var/lib/frox
%{__make} install DESTDIR=$RPM_BUILD_ROOT
+install src/frox.conf $RPM_BUILD_ROOT%{_sysconfdir}/frox.conf
install doc/frox.man $RPM_BUILD_ROOT%{_mandir}/man8/frox.8
+install doc/frox.conf.man $RPM_BUILD_ROOT%{_mandir}/man5/frox.5
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/frox
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/frox.conf
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/frox
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc doc/{FAQ,README.transdata,RELEASE,SECURITY,TODO}
%attr(754,root,root) /etc/rc.d/init.d/frox
+%attr(750,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/frox
%attr(640,root,frox) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/frox.conf
%attr(755,root,root) %{_sbindir}/frox
-%attr(750,frox,frox) %dir /var/cache/frox
+%attr(770,root,frox) /var/lib/frox
%{_mandir}/man*/*