Summary(pt_BR.UTF-8): Servidor FTP profissional, com sintaxe de configuração semelhante à do apache
Summary(zh_CN.UTF-8): 易于管理的,安全的 FTP 服务器
Name: proftpd
-Version: 1.3.6
-Release: 2.1
+Version: 1.3.6c
+Release: 1
Epoch: 2
License: GPL v2+
Group: Networking/Daemons
Source0: ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.gz
-# Source0-md5: 13270911c42aac842435f18205546a1b
+# Source0-md5: 5680a462144e94770d6e5478ffd60254
# https://github.com/jbenden/mod_clamav
Source1: mod_clamav-%{mod_clamav_version}.tar.xz
# Source1-md5: 89ec19115d9ea7c7f4e0b0c4551e69bc
Source11: %{name}-anonftp.conf
Source12: %{name}-mod_clamav.conf
Source13: %{name}.logrotate
+Source14: %{name}-server.crt
+Source15: %{name}-server.key
Patch0: %{name}-paths.patch
Patch1: %{name}-noautopriv.patch
URL: http://www.proftpd.org/
BuildRequires: rpmbuild(macros) >= 1.268
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/ftpd
+%define _sysconfdir /etc/proftpd
%define _localstatedir /var/run
%define _libexecdir %{_prefix}/%{_lib}/%{name}
+# macro called at module post scriptlet
+%define module_post \
+if [ "$1" = "1" ]; then \
+ if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \
+ %service -q rc-inetd reload \
+ elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \
+ %service -q proftpd restart \
+ fi \
+fi
+
+# macro called at module postun scriptlet
+%define module_postun \
+if [ "$1" = "0" ]; then \
+ if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \
+ %service -q rc-inetd reload \
+ elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \
+ %service -q proftpd restart \
+ fi \
+fi
+
+%define module_triggerun \
+if [ $1 -le 1 ]; then \
+ exit 0 \
+fi \
+[ -d /etc/proftpd/conf.d ] || mkdir -p /etc/proftpd 2>/dev/null || : \
+%if "%1" == "mod_tls" \
+for f in /etc/ftpd/{conf.d/mod_tls.conf,server.crt,server.key}; do \
+ f=${f##*/} \
+ [ -f "/etc/ftpd/$f" ] && mv "/etc/ftpd/$f" /etc/proftpd 2>/dev/null || : \
+ [ -f "/etc/ftpd/conf.d/$f" ] && mv "/etc/ftpd/conf.d/$f" /etc/proftpd/conf.d 2>/dev/null || : \
+done \
+%else \
+[ -f /etc/ftpd/conf.d/%1.conf ] && mv /etc/ftpd/conf.d/%1.conf /etc/proftpd/conf.d 2>/dev/null || : \
+%endif \
+sed -i -e 's|/etc/ftpd|/etc/proftpd|g' /etc/ftpd/conf.d/%1.conf 2>/dev/null \
+[ -n "$(find /etc/ftpd/conf.d -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd/conf.d 2>/dev/null || : \
+[ -n "$(find /etc/ftpd -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd 2>/dev/null || :
+
+# it's sooo annoying to write them
+%define module_scripts() \
+%post %1 \
+%module_post \
+\
+%postun %1 \
+%module_postun \
+\
+%triggerun %1 -- proftpd-%1 \
+%module_triggerun
+
%description
ProFTPD is a highly configurable FTP daemon for Unix and Unix-like
operating systems. ProFTPD is designed to be somewhat of a "drop-in"
rm $RPM_BUILD_ROOT%{_sbindir}/in.proftpd
-install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/proftpd
install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_auth_pam.conf
+cp -a %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_auth_pam.conf
MODULES="
mod_auth_file
mod_ident
for module in $MODULES; do
echo "LoadModule $module.c" > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/$module.conf
done
-install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_tls.conf
-install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/anonftp.conf
-install %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_clamav.conf
+cp -a %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_tls.conf
+cp -a %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/anonftp.conf
+cp -a %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/mod_clamav.conf
+
+cp -a %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/server.crt
+cp -a %{SOURCE15} $RPM_BUILD_ROOT%{_sysconfdir}/server.key
-%{?with_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
-install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
-install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
+cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/proftpd
+
+%{?with_pam:cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
+cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
+cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd
install contrib/xferstats.holger-preiss $RPM_BUILD_ROOT%{_bindir}/xferstat
%service -q proftpd restart
fi
-# macro called at module post scriptlet
-%define module_post \
-if [ "$1" = "1" ]; then \
- if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \
- %service -q rc-inetd reload \
- elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \
- %service -q proftpd restart \
- fi \
+%triggerun common -- proftpd-common < 2:1.3.6-5
+if [ $1 -le 1 ]; then
+ exit 0
fi
-
-# macro called at module postun scriptlet
-%define module_postun \
-if [ "$1" = "0" ]; then \
- if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then \
- %service -q rc-inetd reload \
- elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then \
- %service -q proftpd restart \
- fi \
+[ -d /etc/proftpd/conf.d ] || mkdir -p /etc/proftpd/conf.d 2>/dev/null || :
+for f in /etc/ftpd/{conf.d/mod_{auth_file,clamav,ident}.conf,ftpusers,ftpusers.default,proftpd.conf}; do
+ f=${f##*/}
+ [ -f "/etc/ftpd/$f" ] && mv "/etc/ftpd/$f" /etc/proftpd 2>/dev/null || :
+ [ -f "/etc/ftpd/conf.d/$f" ] && mv "/etc/ftpd/conf.d/$f" /etc/proftpd/conf.d 2>/dev/null || :
+done
+find /etc/proftpd -type f 2>/dev/null | xargs sed -i -e 's|/etc/ftpd|/etc/proftpd|g' 2>/dev/null
+[ -n "$(find /etc/ftpd/conf.d -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd 2>/dev/null || :
+[ -n "$(find /etc/ftpd -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd 2>/dev/null || :
+
+%triggerpostun common -- proftpd-common < 2:1.3.6-5
+echo
+echo "Warning! Configuration has been migrated to /etc/proftpd."
+echo
+
+%triggerun anonftp -- proftpd-anonftp < 2:1.3.6-5
+if [ $1 -le 1 ]; then
+ exit 0
fi
-
-# it's sooo annoying to write them
-%define module_scripts() \
-%post %1 \
-%module_post \
-\
-%postun %1 \
-%module_postun
+[ -d /etc/proftpd/conf.d ] || mkdir -p /etc/proftpd 2>/dev/null || :
+[ -f /etc/ftpd/conf.d/anonftp.conf ] && mv /etc/ftpd/conf.d/anonftp.conf /etc/proftpd/conf.d 2>/dev/null || :
+sed -i -e 's|/etc/ftpd|/etc/proftpd|g' /etc/ftpd/conf.d/anonftp.conf 2>/dev/null
+[ -n "$(find /etc/ftpd/conf.d -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd 2>/dev/null || :
+[ -n "$(find /etc/ftpd -type d -empty 2>/dev/null)" ] && rmdir /etc/ftpd 2>/dev/null || :
%module_scripts mod_auth_pam
%module_scripts mod_ldap
%files mod_tls
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_tls.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/server.crt
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/server.key
%attr(755,root,root) %{_libexecdir}/mod_tls.so
%files mod_wrap