]> git.pld-linux.org Git - packages/frox.git/blob - frox.spec
- use %useradd/%groupadd macros
[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.15
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:  fae2d10d6ac742f298dc5fb47a0e306f
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.202
25 PreReq:         rc-scripts
26 Requires(pre):  /bin/id
27 Requires(pre):  /usr/bin/getgid
28 Requires(pre):  /usr/sbin/groupadd
29 Requires(pre):  /usr/sbin/groupmod
30 Requires(pre):  /usr/sbin/useradd
31 Requires(pre):  /usr/sbin/usermod
32 Requires(postun):       /usr/sbin/groupdel
33 Requires(postun):       /usr/sbin/userdel
34 Requires(post,preun):   /sbin/chkconfig
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%{_sysconfdir}/{logrotate.d,sysconfig,rc.d/init.d} \
69         $RPM_BUILD_ROOT/var/log/{archiv/frox,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%{_sysconfdir}/rc.d/init.d/frox
78 install %{SOURCE2}      $RPM_BUILD_ROOT%{_sysconfdir}/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 %groupadd -g 103 frox
92 # TODO: should be in trigger
93 if [ "`/usr/bin/getgid frox`" = 97 ]; then
94         /usr/sbin/groupmod -g 103 frox
95 fi
96
97 %useradd -u 103 -s /bin/false -g frox -c "FROX ftp caching daemon" -d /var/cache/frox frox
98 # FIXME: should be in trigger
99 if [ "`/bin/id -u frox`" = 97 ]; then
100         /usr/sbin/usermod -u 103 frox
101         chown -R frox:frox /var/cache/frox ||:
102         chown -R root:frox /var/log/frox /var/log/archiv/frox ||:
103 fi
104
105 %post
106 /sbin/chkconfig --add frox
107 if [ -f /var/lock/subsys/frox ]; then
108         /etc/rc.d/init.d/frox restart >&2
109 else
110         echo "Run \"/etc/rc.d/init.d/frox start\" to start frox daemons."
111 fi
112
113 %preun
114 if [ "$1" = "0" ]; then
115         if [ -f /var/lock/subsys/frox ]; then
116                 /etc/rc.d/init.d/frox stop >&2
117         fi
118         /sbin/chkconfig --del frox
119 fi
120
121 %postun
122 if [ "$1" = "0" ]; then
123         %userremove frox
124         %groupremove frox
125 fi
126
127 %files
128 %defattr(644,root,root,755)
129 %doc doc/{FAQ,README.transdata,RELEASE,SECURITY,TODO}
130 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/frox
131 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/frox
132 %attr(640,root,frox) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/frox.conf
133 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/logrotate.d/frox
134 %attr(755,root,root) %{_sbindir}/frox
135 %attr(770,root,frox) /var/lib/frox
136 %attr(770,root,frox) /var/log/frox
137 %attr(770,root,frox) /var/log/archiv/frox
138 %attr(770,frox,frox) /var/cache/frox
139 %{_mandir}/man*/*
This page took 0.044848 seconds and 4 git commands to generate.