X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=pure-ftpd.spec;h=4abfc33f7a09a98b93a94315d2775dd6a708fca4;hb=771edd2ebe64c269039c2c4062e799e3796420dd;hp=401e979b676e3ac9a35e532190f2ea1db62ff250;hpb=24109f58efa0699fecb1f0f602bcc75c88b0d6ab;p=packages%2Fpure-ftpd.git diff --git a/pure-ftpd.spec b/pure-ftpd.spec index 401e979..4abfc33 100644 --- a/pure-ftpd.spec +++ b/pure-ftpd.spec @@ -8,17 +8,17 @@ %bcond_without puredb # disable pure-db support %bcond_without tls # disable SSL/TLS support %bcond_without cap # disable capabilities -# + +%define rel 5 Summary: Small, fast and secure FTP server Summary(pl.UTF-8): Mały, szybki i bezpieczny serwer FTP Name: pure-ftpd -Version: 1.0.22 -Release: 1%{?with_extra:extra} -Epoch: 0 +Version: 1.0.47 +Release: %{rel}%{?with_extra:extra} License: BSD-like%{?with_extra:, GLPv2 for pure-config due to libcfg+ license} Group: Daemons -Source0: ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/%{name}-%{version}.tar.bz2 -# Source0-md5: 7f9ceefafaf9eb8fca757d7358f474fa +Source0: http://download.pureftpd.org/pub/pure-ftpd/releases/%{name}-%{version}.tar.bz2 +# Source0-md5: a41fa531c0d21bd3416dd524d75495ae Source1: %{name}.pamd Source2: %{name}.init Source3: %{name}.sysconfig @@ -27,17 +27,22 @@ Source4: ftpusers.tar.bz2 Source5: http://twittner.host.sk/files/pure-config/pure-config-20041201.tar.gz # Source5-md5: 3f2ff6b00b5c38ee11ce588ee5af6cf6 Patch0: %{name}-config.patch -Patch1: %{name}-path_to_ssl_cert_in_config.patch +Patch1: %{name}-allauth.patch Patch2: %{name}-pure-pw_passwd.patch Patch3: %{name}-mysql_config.patch -Patch4: %{name}-nosymlinks-hideuidmismatch.patch -Patch5: %{name}-passwd_location.patch -Patch6: %{name}-additionalgid.patch +# from Fedora +Patch4: 0003-Allow-having-both-options-and-config-file-on-command.patch + +Patch7: audit_cap.patch +Patch8: %{name}-apparmor.patch +Patch9: %{name}-mysql-utf8.patch URL: http://www.pureftpd.org/ %{?with_extra:BuildRequires: autoconf} %{?with_extra:BuildRequires: automake} +BuildRequires: libapparmor-devel %{?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} @@ -45,10 +50,18 @@ BuildRequires: pam-devel %{?with_pgsql:BuildRequires: postgresql-devel} BuildRequires: rpmbuild(macros) >= 1.304 Requires(post,preun): /sbin/chkconfig +Requires(postun): /usr/sbin/groupdel +Requires(postun): /usr/sbin/userdel +Requires(pre): /bin/id +Requires(pre): /usr/bin/getgid +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd Requires: pam >= 0.79.0 %{!?with_extra:Requires: perl-base} Requires: rc-scripts Provides: ftpserver +Provides: user(ftpauth) +Provides: group(ftpauth) Conflicts: man-pages < 1.51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -82,6 +95,9 @@ Group: Networking/Daemons 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. @@ -92,17 +108,23 @@ Ten pakiet zawiera schemat Pure-FTPd pureftpd.schema dla openldapa. %prep %setup -q -a 5 %patch0 -p0 +%patch1 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%{?with_extra:%patch1 -p1} +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 + %{?with_extra:%patch2 -p1} %build +%{__aclocal} -Im4 +%{__autoconf} +%{__autoheader} +%{__automake} %configure \ - CFLAGS="%{rpmcflags} %{rpmcppflags} -DALLOW_DELETION_OF_TEMPORARY_FILES=1" \ + CFLAGS="%{rpmcflags} %{rpmcppflags} -DALLOW_DELETION_OF_TEMPORARY_FILES=1 -DALWAYS_SHOW_RESOLVED_SYMLINKS=1" \ --with-boring \ --with-altlog \ --with-cookie \ @@ -115,6 +137,7 @@ Ten pakiet zawiera schemat Pure-FTPd pureftpd.schema dla openldapa. %{?with_mysql:CPPFLAGS="-I%{_includedir}/mysql" --with-mysql} \ --with-pam \ --with-peruserlimits \ + --with-rfc2640 \ %{?with_pgsql:--with-pgsql} \ --with-privsep \ %{?with_puredb:--with-puredb} \ @@ -124,7 +147,8 @@ Ten pakiet zawiera schemat Pure-FTPd pureftpd.schema dla openldapa. %{?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 @@ -144,16 +168,16 @@ install -d $RPM_BUILD_ROOT/etc/{pam.d,sysconfig,security,rc.d/init.d} \ %{__make} install \ DESTDIR=$RPM_BUILD_ROOT -install %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name} -install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} -install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name} +cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name} +install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} +cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name} %{?with_ldap:install pureftpd-ldap.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-ldap.conf} %{?with_mysql:install pureftpd-mysql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-mysql.conf} %{?with_pgsql:install pureftpd-pgsql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-pgsql.conf} -install configuration-file/pure-ftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd.conf -%{!?with_extra:install configuration-file/pure-config.pl $RPM_BUILD_ROOT%{_sbindir}} -install pureftpd.schema $RPM_BUILD_ROOT%{schemadir}/pureftpd.schema +cp -p pureftpd.schema $RPM_BUILD_ROOT%{schemadir}/pureftpd.schema + +mv $RPM_BUILD_ROOT%{_sysconfdir}/{pure-ftpd,pureftpd}.conf touch $RPM_BUILD_ROOT%{_sysconfdir}/{ftpusers,pureftpd-dir-aliases} @@ -174,12 +198,22 @@ rm -rf $RPM_BUILD_ROOT /sbin/chkconfig --add %{name} %service %{name} restart "PureFTPD daemon" +%pre +%groupadd -g 326 ftpauth +%useradd -u 326 -d %{_ftpdir} -s /bin/false -c "FTP Auth daemon" -g ftpauth ftpauth + %preun if [ "$1" = "0" ]; then %service %{name} stop /sbin/chkconfig --del %{name} fi +%postun +if [ "$1" = "0" ]; then + %userremove ftpauth + %groupremove ftpauth +fi + %post -n openldap-schema-pureftpd %openldap_schema_register %{schemadir}/pureftpd.schema -d core %service -q ldap restart @@ -190,6 +224,11 @@ if [ "$1" = "0" ]; then %service -q ldap restart fi +%triggerpostun -- %{name} < 1.0.41-2 +%{?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} +sed -i -e 's#SSLCertFile#CertFile#gi' $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd.conf +exit 0 %files %defattr(644,root,root,755)