X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=proftpd.spec;h=f64399b2f3368c39c7f88d19c13a1200f6dfb51b;hb=740e26090ba4eadd9676ba69d28d00e2da1c9a31;hp=f3314696eab17ee3582ddce7e2bc8b9cdd0ee141;hpb=fb70bff867dcf7858827b5dbb9ca3cd76003086f;p=packages%2Fproftpd.git diff --git a/proftpd.spec b/proftpd.spec index f331469..f64399b 100644 --- a/proftpd.spec +++ b/proftpd.spec @@ -23,13 +23,13 @@ Summary(pl.UTF-8): PROfesionalny serwer FTP 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: 3 +Version: 1.3.7d +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: f7e1272fc48bbf1b6a50a2e29db6c927 # https://github.com/jbenden/mod_clamav Source1: mod_clamav-%{mod_clamav_version}.tar.xz # Source1-md5: 89ec19115d9ea7c7f4e0b0c4551e69bc @@ -71,10 +71,59 @@ BuildRequires: postgresql-devel 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" @@ -606,33 +655,34 @@ if [ "$2" != 1 ]; then %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 @@ -652,8 +702,7 @@ fi %files common %defattr(644,root,root,755) %doc sample-configurations/*.conf CREDITS ChangeLog NEWS RELEASE_NOTES -%doc README.md README.capabilities README.classes README.controls README.IPv6 -%doc README.modules +%doc README.md README.modules %doc doc/*.html doc/contrib doc/howto doc/modules %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/proftpd %dir %attr(750,root,ftp) %dir %{_sysconfdir} @@ -706,7 +755,6 @@ fi %if %{with pam} %files mod_auth_pam %defattr(644,root,root,755) -%doc README.PAM %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.ftp %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mod_auth_pam.conf