Blob Blame History Raw
Name:       pure-ftpd
Version:    1.0.20
Release:    1
Summary:    Lightweight, fast and secure FTP server

Group:      System Environment/Daemons
License:    BSD
URL:        http://www.pureftpd.org
Source0:    ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.20.tar.bz2
Source1:    pure-ftpd.init 
Source2:    pure-ftpd.logrotate
Source3:    pure-ftpd.xinetd
Patch0:     pure-ftpd-1.0.20-config.patch
Patch1:     pure-ftpd-1.0.20-libdir.patch
Provides:   ftpserver
BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  pam-devel, perl, python, libcap-devel
#BuildRequires: openssl-devel
%{?_with_ldap:BuildRequires:  openldap-devel}
%{?_with_mysql:BuildRequires: mysql-devel}
%{?_with_pgsql:BuildRequires: postgresql-devel}

Requires(post):   chkconfig
Requires(preun):  chkconfig, initscripts
Requires(postun): initscripts
Requires:   logrotate


%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.
Rebuild switches:
--with ldap     enable ldap support
--with mysql    enable mysql support
--with pgsql    enable postgresql support
--with extauth  enable external authentication


%prep
%setup -q 
%patch0 -p0 -b .config
%patch1 -p0 -b .libdir


%build
%configure  --with-paranoidmsg \
            --with-capabilities \
            --with-privsep \
            --with-pam \
            --with-puredb \
            --with-sendfile \
            --with-altlog \
            --with-cookie \
            --with-diraliases \
            --with-throttling \
            --with-ratios \
            --with-quotas \
            --with-ftpwho \
            --with-welcomemsg \
            --with-uploadscript \
            --with-peruserlimits \
            --with-virtualhosts \
            --with-virtualchroot \
            --with-largefile \
            --sysconfdir=%{_sysconfdir}/%{name} \
            --without-tls \
            --without-rendezvous \
            %{?_with_ldap} \
            %{?_with_mysql} \
            %{?_with_pgsql} \
            %{?_with_extauth}

make %{?_smp_mflags}

%install 
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man8/
install -d -m 755 $RPM_BUILD_ROOT%{_sbindir}
install -d -m 755 $RPM_BUILD_ROOT%{_initrddir}
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/ftp

# Conf 
install -p -m 755 configuration-file/pure-config.pl $RPM_BUILD_ROOT%{_sbindir}
install -p -m 644 configuration-file/pure-ftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -p -m 755 configuration-file/pure-config.py $RPM_BUILD_ROOT%{_sbindir}
install -p -m 644 pureftpd-ldap.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -p -m 644 pureftpd-mysql.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -p -m 644 pureftpd-pgsql.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}

# Man
install -p -m 644 man/pure-ftpd.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-ftpwho.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-mrtginfo.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-uploadscript.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-pw.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-pwconvert.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-statsdecode.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-quotacheck.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -p -m 644 man/pure-authd.8 $RPM_BUILD_ROOT%{_mandir}/man8

# Init script
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}

# Pam 
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/
install -p -m 644 pam/pure-ftpd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/

# Logrotate
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}

# xinetd support
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/%{name}


%clean
rm -rf $RPM_BUILD_ROOT


%post
if [ "$1" -le "1" ]; then 
    /sbin/chkconfig --add pure-ftpd
fi

%preun
if [ "$1" -lt "1" ]; then
    /sbin/service pure-ftpd stop > /dev/null 2>&1 || :
    /sbin/chkconfig --del pure-ftpd
fi

%postun 
if [ "$1" -ge "1" ]; then 
    /sbin/service pure-ftpd condrestart > /dev/null 2>&1 
fi


%files
%defattr(-, root, root, -)
%doc FAQ THANKS README.Authentication-Modules README.Virtual-Users README
%doc README.Contrib README.Configuration-File AUTHORS CONTACT HISTORY NEWS
%doc README.LDAP README.PGSQL README.MySQL README.Netfilter
%doc contrib/pure-vpopauth.pl pureftpd.schema contrib/pure-stat.pl
%{_bindir}/pure-*
%{_sbindir}/pure-*
%config %{_initrddir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
%{_mandir}/man8/*
%dir /var/ftp/


%changelog
* Sun Mar 13 2005 Aurelien Bompard <gauret[AT]free.fr> 1.0.20-1
- adapt to Fedora Extras (drop Epoch, change Release tag)

* Wed Feb 16 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.9
- license is BSD, not GPL

* Mon Feb 14 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.8
- various fixes. See bug 1573 (fedora.us) for more info.

* Fri Feb 11 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.7
- fix init script
- require logrotate
- add rebuild switches to lower dependancies
- see bug 1573 (fedora.us) for more info.

* Fri Feb 04 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.6
- Add the "UseFtpUsers no" directive in the config file since we don't
  use it anymore

* Wed Feb 02 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.5
- various spec file improvements

* Mon Jan 31 2005 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.4
- add patch for x86_64 support
- implement wishes in bug 1573 from Jose Pedro Oliveira
- don't use the ftpusers file, and thus remove conflicts with other FTP servers
- rediff config patch

* Tue Nov 02 2004 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.3
- add large file support

* Fri Sep 24 2004 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.2
- redirect %%preun output to /dev/null
- add requirements to chkconfig for the scriptlets

* Sun Aug 01 2004 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.20-0.fdr.1
- version 1.0.20 (bugfixes)

* Mon Jun 28 2004 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.19-0.fdr.1
- version 1.0.19

* Tue May 04 2004 Aurelien Bompard <gauret[AT]free.fr> 0:1.0.18-0.fdr.1
- version 1.0.18
- spec file cleanups

* Sun Oct 19 2003 Aurelien Bompard <gauret[AT]free.fr> 1.0.16a-1
- Redhatize the Mandrake RPM
- version 1.0.16a
- improve ftpusers creation script