]> git.pld-linux.org Git - packages/frox.git/blob - frox.spec
- use %service
[packages/frox.git] / frox.spec
1 #
2 # Conditional build:
3 %bcond_with     kernel22
4 #
5 Summary:        Transparent FTP proxy
6 Summary(pl):    Przezroczyste proxy FTP
7 Name:           frox
8 Version:        0.7.18
9 %if %{with kernel22}
10 Release:        1@2.2
11 %else
12 Release:        1
13 %endif
14 License:        GPL
15 Group:          Networking/Daemons
16 Source0:        http://frox.sourceforge.net/download/%{name}-%{version}.tar.bz2
17 # Source0-md5:  d30c35b9820d706ff2f9a6ab3b501247
18 Source1:        %{name}.init
19 Source2:        %{name}.sysconfig
20 Patch0:         %{name}-config.patch
21 URL:            http://frox.sourceforge.net/
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 Requires(post,preun):   /sbin/chkconfig
26 Requires(postun):       /usr/sbin/groupdel
27 Requires(postun):       /usr/sbin/userdel
28 Requires(pre):  /bin/id
29 Requires(pre):  /usr/bin/getgid
30 Requires(pre):  /usr/sbin/groupadd
31 Requires(pre):  /usr/sbin/groupmod
32 Requires(pre):  /usr/sbin/useradd
33 Requires(pre):  /usr/sbin/usermod
34 Requires:       rc-scripts
35 Provides:       group(frox)
36 Provides:       user(frox)
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
40 Frox is transparent FTP proxy. It also has support for non-transparent
41 connections, caching of anonymous ftp, and active --> passive
42 conversion of data connections.
43
44 %description -l pl
45 Frox to przezroczyste proxy FTP, posiada równie¿ wsparcie do
46 nieprzezroczystych po³±czeñ, buforowania anonimowego ftp, i konwersji
47 po³±czeñ z aktywnych na pasywne.
48
49 %prep
50 %setup -q
51 %patch0 -p1
52
53 %build
54 %{__aclocal}
55 %{__autoconf}
56 %configure \
57         --enable-http-cache \
58         --enable-local-cache \
59         %{?!with_kernel22:--enable-libiptc} \
60         %{?with_kernel22:--disable-libiptc} \
61         --enable-transparent-data \
62         --enable-configfile=%{_sysconfdir}/frox.conf
63 %{__make}
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT{/var/lib/frox,%{_mandir}/man{5,8}} \
68         $RPM_BUILD_ROOT/etc/{logrotate.d,sysconfig,rc.d/init.d} \
69         $RPM_BUILD_ROOT/var/{log/{archiv/frox,frox},cache/frox}
70
71 %{__make} install \
72         DESTDIR=$RPM_BUILD_ROOT
73
74 install src/frox.conf   $RPM_BUILD_ROOT%{_sysconfdir}/frox.conf
75 install doc/frox.man    $RPM_BUILD_ROOT%{_mandir}/man8/frox.8
76 install doc/frox.conf.man       $RPM_BUILD_ROOT%{_mandir}/man5/frox.5
77 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/rc.d/init.d/frox
78 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/sysconfig/frox
79
80 cat >$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/frox << EOF
81 /var/log/frox/frox-log {
82         olddir /var/log/archiv/frox
83         nocreate
84 }
85 EOF
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %pre
91 if [ "`/usr/bin/getgid frox`" = 97 ]; then
92         /usr/sbin/groupmod -g 103 frox
93 fi
94 %groupadd -g 103 frox
95
96 if [ -n "`id -u frox 2>/dev/null`" ] && [ "`/bin/id -u frox`" = 97 ]; then
97         /usr/sbin/usermod -u 103 frox
98         chown -R frox:frox /var/cache/frox ||:
99         chown -R root:frox /var/log/frox /var/log/archiv/frox ||:
100 fi
101 %useradd -u 103 -s /bin/false -g frox -c "FROX ftp caching daemon" -d /var/cache/frox frox
102
103 %post
104 /sbin/chkconfig --add frox
105 %service frox restart "frox daemons"
106
107 %preun
108 if [ "$1" = "0" ]; then
109         %service frox stop
110         /sbin/chkconfig --del frox
111 fi
112
113 %postun
114 if [ "$1" = "0" ]; then
115         %userremove frox
116         %groupremove frox
117 fi
118
119 %files
120 %defattr(644,root,root,755)
121 %doc doc/{ChangeLog,FAQ,README.transdata,RELEASE,SECURITY,TODO}
122 %attr(754,root,root) /etc/rc.d/init.d/frox
123 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/frox
124 %attr(640,root,frox) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frox.conf
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/frox
126 %attr(755,root,root) %{_sbindir}/frox
127 %attr(770,root,frox) /var/lib/frox
128 %attr(770,root,frox) /var/log/frox
129 %attr(770,root,frox) /var/log/archiv/frox
130 %attr(770,frox,frox) /var/cache/frox
131 %{_mandir}/man*/*
This page took 0.167018 seconds and 4 git commands to generate.