]> git.pld-linux.org Git - packages/frox.git/blob - frox.spec
- Make it fork for both 2.2 and 2.4 kernels
[packages/frox.git] / frox.spec
1
2 %define         _kernel_ver     %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
3 %define         _kernel24       %(echo %{_kernel_ver} | grep -q '2\.[012]\.' ; echo $?)
4 %if %{_kernel24}
5 %define         _kernel_series  2.4
6 %define         _with_pivot_root 1
7 %else
8 %define         _kernel_series  2.2
9 %endif
10
11 Summary:        Transparent FTP proxy
12 Summary(pl):    Prze¼roczyste proxy FTP
13 Name:           frox
14 Version:        0.7.5
15 Release:        1@%{_kernel_series}
16 License:        GPL
17 Group:          Networking/Daemons
18 Source0:        http://frox.sourceforge.net/download/%{name}-%{version}.tar.bz2
19 Source1:        %{name}.init
20 Source2:        %{name}.sysconfig
21 Patch0:         %{name}-config.patch
22 URL:            http://frox.sourceforge.net/
23 BuildRequires:  autoconf
24 BuildRequires:  automake
25 Prereq:         rc-scripts
26 Prereq:         /sbin/chkconfig
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 Frox is transparent FTP proxy. It also has support for non-transparent
31 connections, caching of anonymous ftp, and active --> passive
32 conversion of data connections.
33
34 %description -l pl
35 Frox to prze¼roczyste proxy FTP, posiada równie¿ wsparcie do
36 nie-transparentnych po³aczen, buforowania anonimowego ftp, i konwersji
37 aktywne-pasywne polaczenia.
38
39 %prep
40 %setup -q
41 %patch0 -p1
42
43 %build
44 aclocal
45 %{__autoconf}
46 %configure \
47         --enable-http-cache \
48         --enable-local-cache \
49         %{?_kernel24:--enable-libiptc} \
50         %{?!_kernel24:--disable-libiptc} \
51         --enable-transparent-data \
52         --enable-configfile=%{_sysconfdir}/frox.conf
53 %{__make}
54
55 %install
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{_mandir}/man{5,8}} \
58         $RPM_BUILD_ROOT/var/lib/frox
59
60 %{__make} install DESTDIR=$RPM_BUILD_ROOT
61 install src/frox.conf   $RPM_BUILD_ROOT%{_sysconfdir}/frox.conf
62
63 install doc/frox.man    $RPM_BUILD_ROOT%{_mandir}/man8/frox.8
64 install doc/frox.conf.man       $RPM_BUILD_ROOT%{_mandir}/man5/frox.5
65 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/rc.d/init.d/frox
66 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/sysconfig/frox
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %pre
72 if [ ! -n "`getgid frox`" ]; then
73         /usr/sbin/groupadd -g 97 -r -f frox 1>&2 || :
74 fi
75
76 if [ ! -n "`id -u frox 2>/dev/null`" ]; then
77         /usr/sbin/useradd -M -o -r -u 97 -s /bin/false \
78                 -g squid -c "FROX ftp caching daemon" -d /var/cache/frox frox 1>&2 || :
79 fi
80
81 %post
82 /sbin/chkconfig --add frox
83 if [ -f /var/lock/subsys/frox ]; then
84         /etc/rc.d/init.d/frox restart >&2
85 else
86         echo "Run \"/etc/rc.d/init.d/frox start\" to start frox daemons."
87 fi
88
89 %preun
90 if [ "$1" = "0" ]; then
91         if [ -f /var/lock/subsys/frox ]; then
92                 /etc/rc.d/init.d/frox stop >&2
93         fi
94         /sbin/chkconfig --del frox
95 fi
96
97 %postun
98 # If package is being erased for the last time.
99 if [ "$1" = "0" ]; then
100         /usr/sbin/userdel frox 2> /dev/null
101         /usr/sbin/groupdel frox 2> /dev/null
102 fi
103
104 %files
105 %defattr(644,root,root,755)
106 %doc doc/{FAQ,README.transdata,RELEASE,SECURITY,TODO}
107 %attr(754,root,root) /etc/rc.d/init.d/frox
108 %attr(750,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/frox
109 %attr(640,root,frox) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/frox.conf
110 %attr(755,root,root) %{_sbindir}/frox
111 %attr(770,root,frox) /var/lib/frox
112 %{_mandir}/man*/*
This page took 1.008217 seconds and 4 git commands to generate.