%bcond_without puredb # disable pure-db support
%bcond_without tls # disable SSL/TLS support
%bcond_without cap # disable capabilities
-#
+
%define rel 1
Summary: Small, fast and secure FTP server
Summary(pl.UTF-8): Mały, szybki i bezpieczny serwer FTP
Name: pure-ftpd
-Version: 1.0.31
+Version: 1.0.41
Release: %{rel}%{?with_extra:extra}
Epoch: 0
License: BSD-like%{?with_extra:, GLPv2 for pure-config due to libcfg+ license}
Group: Daemons
Source0: http://download.pureftpd.org/pub/pure-ftpd/releases/%{name}-%{version}.tar.bz2
-# Source0-md5: fba0d592a6316f45b5c312a78789ad97
+# Source0-md5: 76c2364591418f153ed815034621d058
Source1: %{name}.pamd
Source2: %{name}.init
Source3: %{name}.sysconfig
Patch1: %{name}-path_to_ssl_cert_in_config.patch
Patch2: %{name}-pure-pw_passwd.patch
Patch3: %{name}-mysql_config.patch
-Patch4: %{name}-allauth.patch
+
Patch5: %{name}-passwd_location.patch
Patch6: %{name}-additionalgid.patch
Patch7: audit_cap.patch
+Patch8: pure-ftpd-apparmor.patch
+Patch9: pure-ftpd-mysql-utf8.patch
URL: http://www.pureftpd.org/
%{?with_extra:BuildRequires: autoconf}
%{?with_extra:BuildRequires: automake}
%{?with_cap:BuildRequires: libcap-devel}
%{?with_extra:BuildRequires: libcfg+-devel >= 0.6.2}
+BuildRequires: libsodium-devel
%{?with_mysql:BuildRequires: mysql-devel}
%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
%{?with_tls:BuildRequires: openssl-devel}
+BuildRequires: libapparmor-devel
BuildRequires: pam-devel
%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: rpmbuild(macros) >= 1.304
Requires(post,postun): sed >= 4.0
Requires: openldap-servers
Requires: sed >= 4.0
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description -n openldap-schema-pureftpd
This package contains an Pure-FTPd openldap schema.
%setup -q -a 5
%patch0 -p0
%patch3 -p1
-%patch4 -p1
+
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
+%patch9 -p1
%{?with_extra:%patch1 -p1}
%{?with_extra:%patch2 -p1}
%build
-%{__aclocal}
+%{__aclocal} -Im4
%{__autoconf}
%{__autoheader}
%configure \
%{?with_mysql:CPPFLAGS="-I%{_includedir}/mysql" --with-mysql} \
--with-pam \
--with-peruserlimits \
+ --with-rfc2640 \
%{?with_pgsql:--with-pgsql} \
--with-privsep \
%{?with_puredb:--with-puredb} \
%{?with_tls:--with-tls --with-certfile=%{_sharedstatedir}/openssl/certs/ftpd.pem} \
--with-uploadscript \
--with-virtualchroot \
- --with-virtualhosts
+ --with-virtualhosts \
+ --with-apparmor
%if %{with extra}
cd pure-config
%service -q ldap restart
fi
+%triggerpostun -- pure-ftpd < 1.0.40-1
+%{?with_mysql:sed -i -e 's#MYSQLCrypt[\t ]\+all#MYSQLCrypt any#gi' $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-mysql.conf}
+%{?with_pgsql:sed -i -e 's#PgSQLCrypt[\t ]\+all#PgSQLCrypt any#gi' $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-pgsql.conf}
+exit 0
%files
%defattr(644,root,root,755)