File pure-ftpd.spec of Package pure-ftpd.import4353

# spec file for package pure-ftpd
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# check if oes specific patches will be applied or not
%define with_oes 0

Name:           pure-ftpd
Version:        1.0.29
Release:        8.<RELEASE9>
License:        BSD3c
Summary:        A Lightweight, Fast, and Secure FTP Server
Group:          Productivity/Networking/Ftp/Servers
Source1:        %{name}.init
Source2:        %{name}.pamd
Source3:        %{name}.xinetd
Source4:        %{name}.xml
Source5:        %{name}.firewall
# PATCH-FEATURE-OPENSUSE %{name}-1.0.20_config.patch -- Custom service configs.
Patch:          %{name}-1.0.20_config.patch
# PATCH-FEATURE-OPENSUSE %{name}-1.0.20_doc.patch -- Adjust command paths on documentation.
Patch1:         %{name}-1.0.20_doc.patch
# PATCH-FEATURE-OPENSUSE %{name}-1.0.20_virtualhosts.patch -- Custom VHOST_PATH on openSUSE.
Patch2:         %{name}-1.0.20_virtualhosts.patch
Patch5:         %{name}-1.0.20_ftpwho_path.patch
Patch7:         %{name}-1.0.22-default_tcp_sedrcv_buffer_size.patch
# PATCH-FEATURE-OPENSUSE %{name}-1.0.21-portrange.patch -- Add PassivePortRange to "%numpairc_switch_for".
Patch8:         %{name}-1.0.21-portrange.patch
Patch9:         pure-ftpd-1.0.29-flush-cmd-after-tls.patch
# OES patches - see %with_oes
Patch100:       %{name}-1.0.20-oes_remote_server.patch
Patch101:       pure-ftpd-1.0.22-oes-bugfix-534424.patch
BuildRequires:  mysql-devel
BuildRequires:  openldap2-devel
BuildRequires:  pam-devel
BuildRequires:  postgresql-devel
BuildRequires:  libcap-devel
PreReq:         %insserv_prereq
PreReq:         coreutils
Provides:       ftp-server
Provides:       pureftpd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Pure-FTPd is a fast, production-quality, and standard-conforming FTP
server, based-on Troll-FTPd. Unlike other popular FTP servers, it has
no known security flaws, is trivial to set up, and is especially
designed for modern Linux kernels (setfsuid and 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, upload and download ratios,
Apache log files, and more.

%setup -q
%patch9 -p1
# uncomment this if you want to have the OES remote_server feature
%if %{with_oes}
%patch100 -p0
%patch101 -p1

CFLAGS="%{optflags} -DLDAP_DEPRECATED -fstack-protector"
%configure --with-rfc2640 \
	--sysconfdir=%{_sysconfdir}/%{name} \
	--with-ldap \
	--with-paranoidmsg \
	--with-altlog \
	--with-virtualhosts \
	--with-ftpwho \
	--with-mysql \
	--with-nonalnum \
	--with-pgsql \
	--with-cookie \
	--with-throttling \
	--with-ratios \
	--with-uploadscript \
	--with-diraliases \
	--with-pam \
	--with-puredb \
	--with-sysquotas \
	--with-quotas \
	--with-inetd \
	--with-tls \
	--with-boring \
	--with-peruserlimits \
	--with-largefile %_target_cpu-suse-linux \
cat configuration-file/ |grep -v "^print" | grep -v "^exec" > configuration-file/pure-config-args
echo "print join(\" \", @flg);" >> configuration-file/pure-config-args

%{__install} -dD -m 0755 \
%{__install} -m 0755 \
        configuration-file/ \
        configuration-file/pure-config-args \
%{__install} -m 0644 configuration-file/pure-ftpd.conf \
%{__install} -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
ln -sf /etc/init.d/%{name}  %{buildroot}%{_sbindir}/rc%{name}
%{__install} -m 0644 %{S:2}          %{buildroot}%{_sysconfdir}/pam.d/pure-ftpd
%{__install} -m 0644 %{S:3}          %{buildroot}%{_sysconfdir}/xinetd.d/pure-ftpd
%{__install} -m 0644 pureftpd.schema %{buildroot}%{_sysconfdir}/openldap/schema/
%{__install} -d						 %{buildroot}%{_datadir}/omc/svcinfo.d/
%{__install} -m 0644 %{S:4}			 %{buildroot}%{_datadir}/omc/svcinfo.d/
%{__install} -d						 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
%{__install} -m 644 %{S:5}			 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%name

%{__rm} -rf %{buildroot}

%stop_on_removal %{name}

if [ -f etc/pure-ftpd.conf ]; then
        mv etc/pure-ftpd.conf etc/pure-ftpd/pure-ftpd.conf

%restart_on_update %{name}

%defattr(-, root, root)
%doc README.Configuration-File HISTORY README.Virtual-Users
%dir %{_sysconfdir}/openldap
%dir %{_sysconfdir}/openldap/schema
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/vhosts
%config %{_sysconfdir}/openldap/schema/pureftpd.schema
%config %{_sysconfdir}/init.d/pure-ftpd
%config %{_sysconfdir}/pam.d/pure-ftpd
%config(noreplace) %{_sysconfdir}/%{name}/pure-ftpd.conf
%config(noreplace) %{_sysconfdir}/xinetd.d/pure-ftpd
%config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%name

openSUSE Build Service is sponsored by