Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37728583
en ru br
Репозитории ALT
5.1: 1.0.22-alt6
4.1: 1.0.19-alt1.1
4.0: 1.0.19-alt1.1
3.0: 1.0.19-alt1
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: pure-ftpd

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define _ssldir %(openssl-config --openssldir)
%define _pemdir %_ssldir/private
#%define dist_tag %nil
#%if_with Master
#%define dist_tag Master
#%endif
#%if_with Sisyphus
#%define dist_tag Sisyphus
#%endif
#%if "%dist_tag" == ""
#%define dist_tag %(cut -d" " -f3 < /etc/altlinux-release)
#%endif

# Optional builds

# _with_pgsql
# _with_mysql
# _with_tls
# _with_ldap
# --with pgsql --with mysql --with tls --with ldap
Name: pure-ftpd
Version: 1.0.19
Release: alt1.1
URL: http://www.pureftpd.org
Source: %name-%version.tar.bz2
Source1: %name.init.master
Source2: %name.init.sisyphus
Source3: %name.logrotate
Source4: %name.xinetd
Source5: ftpallow
Source6: ftpusers
Source7: %name.default
Patch1: %name-1.0.18-conf.patch
Patch2: %name-1.0.18-docs.patch
Group: System/Servers
License: BSD
Provides: ftp-server ftpserver pure-ftpd
Summary: Lightweight, fast and secure FTP server
Conflicts: wu-ftpd, ncftpd, proftpd, vsftpd
#%if "%dist_tag" == "Master"
#Requires(post,preun): initscripts
#%else
Requires(post,preun): service
#%endif
#%if "%dist_tag" == "Master"
#BuildRequires: libpam-devel %{?_with_ldap:libldap-devel} %{?_with_mysql:libMySQL-devel zlib-devel}
#BuildRequires: libcap-devel %{?_with_pgsql:postgresql-devel} %{?_with_tls:libssl-devel}
#%else
BuildRequires: libpam0-devel %{?_with_ldap:libldap-devel} %{?_with_mysql:libMySQL-devel zlib-devel}
BuildRequires: libcap-devel %{?_with_pgsql:postgresql-devel} %{?_with_tls:libssl-devel}
#%endif

%description
Pure-FTPd is a fast, production-quality, standard-comformant FTP server,
based upon Troll-FTPd. Unlike other popular FTP servers, it has no known
security flaw, it is really trivial to set up and it is especially designed
for modern Linux and FreeBSD kernels (setfsuid, sendfile, capabilities) .
Features include PAM support, IPv6, chroot()ed home directories, virtual
domains, built-in LS, anti-warez system, bandwidth throttling, FXP, bounded
ports for passive downloads, UL/DL ratios, native LDAP and SQL support,
Apache log files and more.
--------
Optional : ldap mysql pgsql tls
Enabled  :%{?_with_ldap: ldap}%{?_with_mysql: mysql}%{?_with_pgsql: pgslq}%{?_with_tls: tls}

%prep
%setup -q -n %name-%version
%patch1 -p1
%patch2 -p1

%build
%configure \
 --sysconfdir=%_sysconfdir/%name \
 --with-altlog \
 --with-extauth \
 --with-puredb \
 --with-cookie \
 --with-throttling \
 --with-ratios \
 --with-quotas \
 --with-ftpwho \
 --with-uploadscript \
 --with-virtualhosts \
 --with-virtualchroot \
 --with-diraliases \
 --with-peruserlimits \
 --with-pam \
 %{?_with_ldap: --with-ldap} \
 %{?_with_mysql: --with-mysql} \
 %{?_with_pgsql: --with-pgslq} \
 %{?_with_tls: --with-tls --with-certfile=%_pemdir/%name.pem }

echo '#define   VHOST_PATH    "%_sysconfdir/%name/vhost"' >> config.h

%make_build

%install
%makeinstall

%__mkdir_p %buildroot%_sysconfdir/%name
%__mkdir_p %buildroot%_sysconfdir/%name/vhost
%__mkdir_p %buildroot%_sysconfdir/xinetd.d/
%__mkdir_p %buildroot%_sysconfdir/sysconfig/
%__mkdir_p %buildroot%_sysconfdir/pam.d/
%__mkdir_p %buildroot%_sysconfdir/logrotate.d/
%__mkdir_p %buildroot%_initrddir
%__mkdir_p %buildroot%_var/log/%name
%__mkdir_p -m 700 %buildroot%_var/run/%name

%__install -m 600 pam/pure-ftpd %buildroot%_sysconfdir/pam.d/%name
%__install -m 644 %SOURCE3 %buildroot%_sysconfdir/logrotate.d/%name
%__install -m 644 %SOURCE4 %buildroot%_sysconfdir/xinetd.d/%name
%__install -m 644 %SOURCE5 %buildroot%_sysconfdir/ftpallow
%__install -m 644 %SOURCE6 %buildroot%_sysconfdir/ftpusers
%__install -m 644 %SOURCE7 %buildroot%_sysconfdir/sysconfig/%name

%__install -m 644 configuration-file/pure-ftpd.conf %buildroot%_sysconfdir/%name/%name.conf
%__install -m 755 configuration-file/pure-config.py %buildroot%_sbindir

%__install -m 644 man/pure-ftpd.8 %buildroot%_man8dir
%__install -m 644 man/pure-ftpwho.8 %buildroot%_man8dir
%__install -m 644 man/pure-mrtginfo.8 %buildroot%_man8dir
%__install -m 644 man/pure-uploadscript.8 %buildroot%_man8dir
%__install -m 644 man/pure-pw.8 %buildroot%_man8dir
%__install -m 644 man/pure-pwconvert.8 %buildroot%_man8dir
%__install -m 644 man/pure-statsdecode.8 %buildroot%_man8dir
%__install -m 644 man/pure-quotacheck.8 %buildroot%_man8dir
%__install -m 644 man/pure-authd.8 %buildroot%_man8dir

#%if "%dist_tag" == "Master"

#  %__install -m 755 %SOURCE1 %buildroot%_initrddir/%name
#%else
 %__install -m 755 %SOURCE2 %buildroot%_initrddir/%name
#%endif

%if_with ldap
 %__mkdir_p %buildroot%_sysconfdir/openldap/schema
 %__install -m 644 pureftpd-ldap.conf %buildroot%_sysconfdir/%name
 %__install -m 644 pureftpd.schema %buildroot%_sysconfdir/openldap/schema/pureftpd.schema
%endif

%if_with mysql
 %__install -m 644 pureftpd-mysql.conf %buildroot%_sysconfdir/%name
%endif

%if_with pgsql
 %__install -m 644 pureftpd-pgsql.conf %buildroot%_sysconfdir/%name
%endif

%if_with tls
 %__mkdir_p %buildroot%_pemdir
 touch %buildroot%_pemdir/%name.pem
%endif

# bytecompile-python off

unset RPM_PYTHON

%clean

%pre
/usr/sbin/usermod -d /var/ftp ftp >/dev/null 2>&1 || :

%post
%post_service %name

%if_with tls
# create a ssl cert
if [ ! -f %_pemdir/%name.pem ]; then
pushd %_pemdir &>/dev/null
umask 077
cat << EOF | openssl req -new -x509 -days 365 -nodes -out %name.pem -keyout %name.pem &>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
localhost.localdomain
root at localhost.localdomain
EOF
chown root.root %name.pem
chmod 600 %name.pem
popd &>/dev/null
fi
exit 0
%endif

%preun
%preun_service %name

%files
%defattr(-, root, root)
%_bindir/pure-pw
%_bindir/pure-pwconvert
%_bindir/pure-statsdecode
%_sbindir/pure-config.py
%_sbindir/pure-ftpd
%_sbindir/pure-ftpwho
%_sbindir/pure-uploadscript
%_sbindir/pure-mrtginfo
%_sbindir/pure-quotacheck
%_sbindir/pure-authd

%_sysconfdir/ftpallow
%_sysconfdir/ftpusers

%_man8dir/*

%dir %_sysconfdir/%name/vhost
%dir %_var/log/%name
%dir %_var/run/%name

%config %_initrddir/%name
%config(noreplace) %_sysconfdir/%name/%name.conf
%config(noreplace) %_sysconfdir/sysconfig/%name
%config(noreplace) %_sysconfdir/pam.d/%name
%config(noreplace) %_sysconfdir/logrotate.d/%name
%config(noreplace) %_sysconfdir/xinetd.d/%name
%{?_with_ldap: %config(noreplace) %_sysconfdir/%name/pureftpd-ldap.conf}
%{?_with_ldap: %config(noreplace) %_sysconfdir/openldap/schema/pureftpd.schema}
%{?_with_mysql: %config(noreplace) %_sysconfdir/%name/pureftpd-mysql.conf}
%{?_with_pgsql: %config(noreplace) %_sysconfdir/%name/pureftpd-pgsql.conf}
%{?_with_tls: %ghost %attr(0600,root,root) %verify(not md5 size mtime) %config(missingok,noreplace) %_pemdir/%name.pem}

%doc FAQ THANKS AUTHORS CONTACT HISTORY NEWS pure-ftpd.png  
%doc contrib/pure-stat.pl contrib/pure-vpopauth.pl contrib/xml_python_processors.txt
%doc README README.* pureftpd.schema
%doc pureftpd-ldap.conf pureftpd-mysql.conf pureftpd-pgsql.conf

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin