3 # bcond_off_pam - disable PAM support
4 # bcond_on_ldap - enable LDAP suppoer
5 # bcond_on_mysql - enable MySQL suppoer
6 # bcond_on_quota - enable quota support
7 # bcond_on_linuxprivs - enable libcap support
8 # bcond_off_ipv6 - disable IPv6 and TCPD support
9 # bcond_off_ssl - disbale TLS/SSL support
10 # --without pam --with ldap --with mysql --with quota --with linuxprivs
11 Summary: PROfessional FTP Daemon with apache-like configuration syntax
12 Summary(pl): PROfesionalny serwer FTP
20 Source0: ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.bz2
22 Source2: %{name}.logrotate
24 Source4: %{name}.inetd
25 Source5: %{name}.sysconfig
27 Source7: %{name}-mod_tcpd.c
28 Patch0: %{name}-1.2.1-v6-20010303.patch.gz
29 # ftp://ftp.runestig.com/pub/proftpd-tls/
30 Patch1: %{name}-1.2.1+v6-tls.20010303.patch.gz
31 Patch2: %{name}-umode_t.patch
32 Patch3: %{name}-glibc.patch
33 Patch4: %{name}-paths.patch
34 Patch5: %{name}-release.patch
35 Patch6: %{name}-noautopriv.patch
36 Patch7: %{name}-betterlog.patch
37 Patch8: %{name}-DESTDIR.patch
38 Patch9: %{name}-wtmp.patch
39 Patch10: %{name}-link.patch
40 URL: http://www.proftpd.org/
41 %{?!bcond_off_pam:BuildRequires: pam-devel}
42 %{?bcond_on_ldap:BuildRequires: openldap-devel}
43 %{?bcond_on_mysql:BuildRequires: mysql-devel}
44 %{?!bcond_off_ssl:BuildRequires: openssl-devel}
49 %{?!bcond_off_pam:Requires: pam >= 0.67}
50 Requires: %{name}-setup = %{version}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 Obsoletes: heimdal-ftpd
63 %define _sysconfdir /etc/ftpd
64 %define _localstatedir /var/run
67 ProFTPD is a highly configurable ftp daemon for unix and unix-like
68 operating systems. ProFTPD is designed to be somewhat of a "drop-in"
69 replacement for wu-ftpd. Full online documentation is available at
70 http://www.proftpd.org/, including a server configuration directive
74 ProFTPD jest wysoce konfigurowalnym serwerem ftp dla systemów Unix.
75 ProFTPD jest robiony jako bezpo¶redni zamiennik wu-ftpd. Pe³na
76 dokunentacja jest dostêpna on-line pod http://www.proftpd.org/
77 w³±cznie z dokumentacj± dotycz±c± konfigurowania.
80 Summary: inetd configs for proftpd
84 Prereq: %{name} = %{version}
85 Provides: %{name}-setup
86 Obsoletes: proftpd-standalone
89 ProFTPD configs for running from inetd.
92 Summary: standalone daemon configs for proftpd
96 Prereq: %{name} = %{version}
97 Provides: %{name}-setup
98 Obsoletes: proftpd-inetd
100 %description standalone
101 ProFTPD configs for running as a standalone daemon.
116 install -m644 %{SOURCE7} contrib/mod_tcpd.c
120 RUN_DIR=%{_localstatedir} ; export RUN_DIR
122 --enable-autoshadow \
123 --with-modules=mod_ratio:mod_readme%{?!bcond_off_ipv6::mod_tcpd}%{?!bcond_off_pam::mod_pam}%{?bcond_on_ldap::mod_ldap}%{?bcond_on_quota::mod_quota}%{?bcond_on_linuxprivs::mod_linuxprivs}%{?bcond_on_mysql::mod_sql:mod_sql_mysql} \
124 %{?!bcond_off_ipv6:--enable-ipv6} \
125 %{?bcond_off_ssl:--disable-tls} \
131 rm -rf $RPM_BUILD_ROOT
133 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,sysconfig/rc-inetd,rc.d/init.d} \
134 $RPM_BUILD_ROOT/{home/ftp/pub/Incoming,var/log}
136 %{__make} install DESTDIR=$RPM_BUILD_ROOT \
137 INSTALL_USER=`id -u` \
138 INSTALL_GROUP=`id -g`
140 rm -f $RPM_BUILD_ROOT%{_sbindir}/in.proftpd
142 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
143 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/ftpd
144 %{?!bcond_off_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
145 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
146 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
147 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd
148 install contrib/xferstats.* $RPM_BUILD_ROOT%{_bindir}/xferstat
150 mv -f contrib/README contrib/README.modules
152 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers.default
153 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers
154 :> $RPM_BUILD_ROOT/var/log/xferlog
156 ln -s proftpd $RPM_BUILD_ROOT%{_sbindir}/ftpd
158 gzip -9nf sample-configurations/{virtual,anonymous}.conf ChangeLog README \
159 README.linux-* contrib/README.modules README.IPv6 README.PAM \
163 touch /var/log/xferlog
164 awk 'BEGIN { FS = ":" }; { if(($3 < 1000)&&($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
165 if [ ! -f %{_sysconfdir}/ftpusers ]; then
166 ( cd %{_sysconfdir}; mv -f ftpusers.default ftpusers )
170 if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then
171 cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
172 sed -e "s/^ServerType[[:space:]]\+standalone/ServerType inetd/g" \
173 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
175 if [ -f /var/lock/subsys/rc-inetd ]; then
176 /etc/rc.d/init.d/rc-inetd restart 1>&2
178 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet sever" 1>&2
182 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
183 /etc/rc.d/init.d/rc-inetd reload 1>&2
187 /sbin/chkconfig --add proftpd
188 if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then
189 cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
190 sed -e "s/^ServerType[[:space:]]\+inetd/ServerType standalone/g" \
191 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
193 if [ -f /var/lock/subsys/proftpd ]; then
194 /etc/rc.d/init.d/proftpd restart 1>&2
196 echo "Run \"/etc/rc.d/init.d/proftpd start\" to start ProFTPD daemon."
200 if [ "$1" = "0" -a -f /var/lock/subsys/proftpd ]; then
201 /etc/rc.d/init.d/proftpd stop 1>&2
203 /sbin/chkconfig --del proftpd
206 rm -rf $RPM_BUILD_ROOT
209 %defattr(644,root,root,755)
210 %doc {ChangeLog,README*}.gz contrib/README.modules.gz
211 %doc sample-configurations/{virtual,anonymous}.conf.gz
214 %attr(750,root,root) %dir %{_sysconfdir}
215 %attr(640,root,root) /etc/logrotate.d/*
216 %attr(640,root,root) %ghost /var/log/*
217 %{?!bcond_off_pam:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*}
219 %attr(640,root,root) %{_sysconfdir}/ftpusers.default
220 %attr(640,root,root) %ghost %{_sysconfdir}/ftpusers
222 %attr(755,root,root) %{_bindir}/*
223 %attr(755,root,root) %{_sbindir}/*
225 %{_mandir}/man[158]/*
228 %attr(711,root,root) %dir /home/ftp/pub/Incoming
231 %defattr(644,root,root,755)
232 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
233 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/ftpd
236 %defattr(644,root,root,755)
237 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
238 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/proftpd
239 %attr(754,root,root) /etc/rc.d/init.d/proftpd