]> git.pld-linux.org Git - packages/frox.git/blob - frox.spec
- fixed GID/UID
[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.159
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 if [ -n "`/usr/bin/getgid frox`" ]; then
92         if [ "`/usr/bin/getgid frox`" = 97 ]; then
93                 /usr/sbin/groupmod -g 103 frox
94         else
95                 if [ "`/usr/bin/getgid frox`" != 103 ]; then
96                         echo "Error: group gnunet doesn't have gid=103. Correct this before installing frox." 1>&2
97                         exit 1
98                 fi
99         fi
100 else
101         /usr/sbin/groupadd -g 103 frox 1>&2
102 fi
103 if [ -n "`/bin/id -u frox 2>/dev/null`" ]; then
104         if [ "`/bin/id -u frox`" = 97 ]; then
105                 /usr/sbin/usermod -u 103 frox
106                 chown -R frox:frox /var/cache/frox ||:
107                 chown -R root:frox /var/log/frox /var/log/archiv/frox ||:
108         else
109                 if [ "`/bin/id -u frox`" != 103 ]; then
110                         echo "Error: user frox doesn't have uid=103. Correct this before installing frox." 1>&2
111                         exit 1
112                 fi
113         fi
114 else
115         /usr/sbin/useradd -u 103 -s /bin/false -g frox \
116                 -c "FROX ftp caching daemon" -d /var/cache/frox frox 1>&2
117 fi
118
119 %post
120 /sbin/chkconfig --add frox
121 if [ -f /var/lock/subsys/frox ]; then
122         /etc/rc.d/init.d/frox restart >&2
123 else
124         echo "Run \"/etc/rc.d/init.d/frox start\" to start frox daemons."
125 fi
126
127 %preun
128 if [ "$1" = "0" ]; then
129         if [ -f /var/lock/subsys/frox ]; then
130                 /etc/rc.d/init.d/frox stop >&2
131         fi
132         /sbin/chkconfig --del frox
133 fi
134
135 %postun
136 if [ "$1" = "0" ]; then
137         %userremove frox
138         %groupremove frox
139 fi
140
141 %files
142 %defattr(644,root,root,755)
143 %doc doc/{FAQ,README.transdata,RELEASE,SECURITY,TODO}
144 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/frox
145 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/frox
146 %attr(640,root,frox) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/frox.conf
147 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/logrotate.d/frox
148 %attr(755,root,root) %{_sbindir}/frox
149 %attr(770,root,frox) /var/lib/frox
150 %attr(770,root,frox) /var/log/frox
151 %attr(770,root,frox) /var/log/archiv/frox
152 %attr(770,frox,frox) /var/cache/frox
153 %{_mandir}/man*/*
This page took 0.039051 seconds and 4 git commands to generate.