2021-06-01 11:18:37 +08:00
|
|
|
# With systemd, the runtime directory is /run on tmpfs rather than /var/run on persistent storage
|
|
|
|
|
%global use_systemd 1
|
|
|
|
|
%global rundir /run
|
|
|
|
|
%global rundir_tmpfs 1
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%global systemd_units systemd
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%global preset_support 1
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%global mysql_lib mariadb
|
|
|
|
|
%global mysql_devel_pkg mariadb-connector-c-devel
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Do a hardened build where possible
|
2020-10-23 14:46:16 +08:00
|
|
|
%global _hardened_build 1
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Dynamic modules contain references to symbols in main dæmon, so we need to disable linker checks for undefined symbols
|
2020-10-23 14:46:16 +08:00
|
|
|
%undefine _strict_symbol_defs_build
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2021-12-04 16:57:02 +08:00
|
|
|
%global mod_vroot_version 0.9.9
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
Name: proftpd
|
2021-12-04 16:57:02 +08:00
|
|
|
Version: 1.3.7c
|
2022-03-17 11:35:57 +08:00
|
|
|
Release: 3
|
2021-06-01 11:18:37 +08:00
|
|
|
Summary: Flexible, stable and highly-configurable FTP server
|
|
|
|
|
License: GPLv2+
|
|
|
|
|
URL: http://www.proftpd.org/
|
|
|
|
|
|
|
|
|
|
Source0: https://github.com/proftpd/proftpd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
|
|
|
Source1: proftpd.conf
|
|
|
|
|
Source2: modules.conf
|
|
|
|
|
Source3: mod_tls.conf
|
|
|
|
|
Source4: mod_ban.conf
|
|
|
|
|
Source5: mod_qos.conf
|
|
|
|
|
Source6: anonftp.conf
|
|
|
|
|
Source8: proftpd-welcome.msg
|
|
|
|
|
Source9: proftpd.sysconfig
|
|
|
|
|
Source10: http://github.com/Castaglia/proftpd-mod_vroot/archive/v%{mod_vroot_version}.tar.gz
|
|
|
|
|
|
|
|
|
|
Patch1: proftpd-1.3.7-shellbang.patch
|
|
|
|
|
Patch2: proftpd.conf-no-memcached.patch
|
|
|
|
|
Patch3: proftpd-1.3.4rc1-mod_vroot-test.patch
|
|
|
|
|
Patch4: proftpd-1.3.6-no-mod-wrap.patch
|
|
|
|
|
Patch5: proftpd-1.3.6-no-mod-geoip.patch
|
|
|
|
|
Patch6: proftpd-1.3.7rc3-logging-not-systemd.patch
|
2022-01-07 15:40:24 +08:00
|
|
|
Patch7: proftpd-1.3.7a-Adjusting-unit-test-timeouts-for-netacl.patch
|
|
|
|
|
Patch8: proftpd-1.3.7a-fix-environment-sensitive-tests-failure.patch
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
BuildRequires: coreutils
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
|
BuildRequires: gettext
|
|
|
|
|
BuildRequires: libacl-devel
|
|
|
|
|
BuildRequires: libcap-devel
|
|
|
|
|
BuildRequires: logrotate
|
|
|
|
|
BuildRequires: %{mysql_devel_pkg}
|
|
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
|
BuildRequires: openldap-devel
|
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
|
BuildRequires: pam-devel
|
|
|
|
|
BuildRequires: pcre-devel >= 7.0
|
2021-12-04 16:57:02 +08:00
|
|
|
BuildRequires: perl-generators
|
2021-06-01 11:18:37 +08:00
|
|
|
BuildRequires: perl-interpreter
|
|
|
|
|
BuildRequires: pkgconfig
|
2022-03-17 11:35:57 +08:00
|
|
|
%if %{?openEuler:1}0
|
2021-06-01 11:18:37 +08:00
|
|
|
BuildRequires: postgresql-devel
|
2022-03-17 11:35:57 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
BuildRequires: sed
|
|
|
|
|
BuildRequires: sqlite-devel
|
|
|
|
|
BuildRequires: tar
|
|
|
|
|
BuildRequires: zlib-devel
|
2021-09-07 15:30:09 +08:00
|
|
|
BuildRequires: chrpath
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Test suite requirements
|
|
|
|
|
BuildRequires: check-devel
|
2020-10-23 14:46:16 +08:00
|
|
|
%if 0%{?_with_integrationtests:1}
|
2021-06-01 11:18:37 +08:00
|
|
|
BuildRequires: perl(Compress::Zlib)
|
|
|
|
|
BuildRequires: perl(Digest::MD5)
|
|
|
|
|
BuildRequires: perl(HTTP::Request)
|
|
|
|
|
BuildRequires: perl(IO::Socket::SSL)
|
|
|
|
|
BuildRequires: perl(LWP::UserAgent)
|
|
|
|
|
BuildRequires: perl(Net::FTPSSL)
|
|
|
|
|
BuildRequires: perl(Net::SSLeay)
|
|
|
|
|
BuildRequires: perl(Net::Telnet)
|
|
|
|
|
BuildRequires: perl(Sys::HostAddr)
|
|
|
|
|
BuildRequires: perl(Test::Harness)
|
|
|
|
|
BuildRequires: perl(Test::Unit) >= 0.25
|
|
|
|
|
BuildRequires: perl(Time::HiRes)
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Need %%{systemd_units} for ownership of /usr/lib/tmpfiles.d directory
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{rundir_tmpfs}
|
2021-06-01 11:18:37 +08:00
|
|
|
Requires: %{systemd_units}
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Logs should be rotated periodically
|
|
|
|
|
Requires: logrotate
|
|
|
|
|
|
|
|
|
|
# Scriptlet dependencies
|
|
|
|
|
Requires(preun): coreutils, findutils
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
2021-06-01 11:18:37 +08:00
|
|
|
BuildRequires: %{systemd_units}
|
2020-10-23 14:46:16 +08:00
|
|
|
%{?systemd_requires}
|
|
|
|
|
%else
|
2021-06-01 11:18:37 +08:00
|
|
|
Requires(post): chkconfig
|
|
|
|
|
Requires(preun): chkconfig, initscripts
|
|
|
|
|
Requires(postun): initscripts
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
Provides: ftpserver
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description
|
|
|
|
|
ProFTPD is an enhanced FTP server with a focus toward simplicity, security,
|
|
|
|
|
and ease of configuration. It features a very Apache-like configuration
|
|
|
|
|
syntax, and a highly customizable server infrastructure, including support for
|
|
|
|
|
multiple 'virtual' FTP servers, anonymous FTP, and permission-based directory
|
|
|
|
|
visibility.
|
|
|
|
|
%if %{use_systemd}
|
|
|
|
|
This package defaults to the standalone behavior of ProFTPD, but all the
|
|
|
|
|
needed scripts to have it run by systemd instead are included.
|
|
|
|
|
%else
|
|
|
|
|
This package defaults to the standalone behavior of ProFTPD, but all the
|
|
|
|
|
needed scripts to have it run by xinetd instead are included.
|
|
|
|
|
%endif
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%package devel
|
|
|
|
|
Summary: ProFTPD - Tools and header files for developers
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
# devel package requires the same devel packages as were build-required
|
|
|
|
|
# for the main package
|
|
|
|
|
Requires: gcc, libtool
|
|
|
|
|
Requires: libacl-devel
|
|
|
|
|
Requires: libcap-devel
|
|
|
|
|
Requires: %{mysql_devel_pkg}
|
|
|
|
|
Requires: ncurses-devel
|
|
|
|
|
Requires: openldap-devel
|
|
|
|
|
Requires: openssl-devel
|
|
|
|
|
Requires: pam-devel
|
|
|
|
|
Requires: pcre-devel
|
|
|
|
|
Requires: pkgconfig
|
2022-03-17 11:35:57 +08:00
|
|
|
%if %{?openEuler:1}0
|
2021-06-01 11:18:37 +08:00
|
|
|
Requires: postgresql-devel
|
2022-03-17 11:35:57 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
Requires: sqlite-devel
|
|
|
|
|
Requires: zlib-devel
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description devel
|
|
|
|
|
This package is required to build additional modules for ProFTPD.
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%package ldap
|
|
|
|
|
Summary: Module to add LDAP support to the ProFTPD FTP server
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description ldap
|
|
|
|
|
Module to add LDAP support to the ProFTPD FTP server.
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%package mysql
|
|
|
|
|
Summary: Module to add MySQL support to the ProFTPD FTP server
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description mysql
|
|
|
|
|
Module to add MySQL support to the ProFTPD FTP server.
|
|
|
|
|
|
2022-03-17 11:35:57 +08:00
|
|
|
%if %{?openEuler:1}0
|
2021-06-01 11:18:37 +08:00
|
|
|
%package postgresql
|
|
|
|
|
Summary: Module to add PostgreSQL support to the ProFTPD FTP server
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description postgresql
|
|
|
|
|
Module to add PostgreSQL support to the ProFTPD FTP server.
|
2022-03-17 11:35:57 +08:00
|
|
|
%endif
|
2020-10-23 14:46:16 +08:00
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%package sqlite
|
|
|
|
|
Summary: Module to add SQLite support to the ProFTPD FTP server
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%description sqlite
|
|
|
|
|
Module to add SQLite support to the ProFTPD FTP server.
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%package utils
|
|
|
|
|
Summary: ProFTPD - Additional utilities
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
Requires: perl-interpreter
|
|
|
|
|
|
2021-12-04 16:57:02 +08:00
|
|
|
BuildRequires: perl(Crypt::Cracklib)
|
|
|
|
|
Requires: perl(Crypt::Cracklib)
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
%description utils
|
2020-10-23 14:46:16 +08:00
|
|
|
This package contains additional utilities for monitoring and configuring the
|
|
|
|
|
ProFTPD server:
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
* ftpasswd: generate passwd(5) files for use with AuthUserFile
|
|
|
|
|
* ftpcount: show the current number of connections per server/virtualhost
|
|
|
|
|
* ftpmail: monitor transfer log and send email when files uploaded
|
|
|
|
|
* ftpquota: manipulate quota tables
|
|
|
|
|
* ftptop: show the current status of FTP sessions
|
|
|
|
|
* ftpwho: show the current process information for each FTP session
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{name}-%{version}%{?prever}
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Extract mod_vroot source into contrib/
|
|
|
|
|
# Directory must be named mod_vroot for configure script to find it
|
2020-10-23 14:46:16 +08:00
|
|
|
cd contrib
|
|
|
|
|
tar xfz %{SOURCE10}
|
|
|
|
|
mv proftpd-mod_vroot-%{mod_vroot_version} mod_vroot
|
|
|
|
|
cd -
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Default config files
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE1} > proftpd.conf
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE2} > modules.conf
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE3} > mod_tls.conf
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE4} > mod_ban.conf
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE5} > mod_qos.conf
|
|
|
|
|
sed -e 's|@RUNDIR@|%{rundir}|' %{SOURCE6} > anonftp.conf
|
|
|
|
|
|
|
|
|
|
# Avoid documentation name conflicts
|
2020-10-23 14:46:16 +08:00
|
|
|
mv contrib/README contrib/README.contrib
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Change shellbangs /usr/bin/env perl ⇒ /usr/bin/perl
|
2020-10-23 14:46:16 +08:00
|
|
|
%patch1
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# If we don't have libmemcached support, remove the mod_tls_memcache
|
|
|
|
|
# snippet from the config file
|
2020-10-23 14:46:16 +08:00
|
|
|
%patch2
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# If we're running the full test suite, include the mod_vroot test
|
2020-10-23 14:46:16 +08:00
|
|
|
%patch3 -p1 -b .test_vroot
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Remove references to mod_wrap from the configuration file if necessary
|
|
|
|
|
%patch4 -b .nowrappers
|
|
|
|
|
|
|
|
|
|
# Remove references to mod_geoip from the configuration file if necessary
|
|
|
|
|
%patch5 -b .nogeoip
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
2021-06-01 11:18:37 +08:00
|
|
|
# Tweak logrotate script for systemd compatibility (#802178)
|
2020-10-23 14:46:16 +08:00
|
|
|
sed -i -e '/killall/s/test.*/systemctl reload proftpd.service/' \
|
2021-06-01 11:18:37 +08:00
|
|
|
contrib/dist/rpm/proftpd.logrotate
|
|
|
|
|
%else
|
|
|
|
|
# Not using systemd, so we want hostname and timestamp in log messages
|
|
|
|
|
%patch6
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2021-12-04 16:57:02 +08:00
|
|
|
%patch7 -p1
|
2022-01-07 15:40:24 +08:00
|
|
|
%patch8 -p1
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Avoid docfile dependencies
|
2020-10-23 14:46:16 +08:00
|
|
|
chmod -c -x contrib/xferstats.holger-preiss
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Remove bogus exec permissions from source files
|
2020-10-23 14:46:16 +08:00
|
|
|
chmod -c -x include/hanson-tpl.h lib/hanson-tpl.c
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Remove any patch backup files from documentation
|
2020-10-23 14:46:16 +08:00
|
|
|
find doc/ contrib/ -name '*.orig' -delete
|
|
|
|
|
|
|
|
|
|
%build
|
2021-06-01 11:18:37 +08:00
|
|
|
# Modules to be built as DSO's (excluding mod_ifsession, always specified last)
|
2022-03-17 11:35:57 +08:00
|
|
|
%if %{?openEuler:1}0
|
2020-10-23 14:46:16 +08:00
|
|
|
SMOD1=mod_sql:mod_sql_passwd:mod_sql_mysql:mod_sql_postgres:mod_sql_sqlite
|
2022-03-17 11:35:57 +08:00
|
|
|
%else
|
|
|
|
|
SMOD1=mod_sql:mod_sql_passwd:mod_sql_mysql:mod_sql_sqlite
|
|
|
|
|
%endif
|
2020-10-23 14:46:16 +08:00
|
|
|
SMOD2=mod_quotatab:mod_quotatab_file:mod_quotatab_ldap:mod_quotatab_radius:mod_quotatab_sql
|
2021-06-01 11:18:37 +08:00
|
|
|
SMOD3=mod_ldap:mod_ban:mod_ctrls_admin:mod_facl:mod_load:mod_vroot
|
|
|
|
|
SMOD4=mod_radius:mod_ratio:mod_rewrite:mod_site_misc:mod_exec:mod_shaper
|
2020-10-23 14:46:16 +08:00
|
|
|
SMOD5=mod_wrap2:mod_wrap2_file:mod_wrap2_sql:mod_copy:mod_deflate:mod_ifversion:mod_qos
|
2021-06-01 11:18:37 +08:00
|
|
|
SMOD6=mod_sftp:mod_sftp_pam:mod_sftp_sql:mod_tls_shmcache
|
2021-12-04 16:57:02 +08:00
|
|
|
SMOD7=mod_unique_id
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
%configure \
|
2021-06-01 11:18:37 +08:00
|
|
|
--libexecdir="%{_libexecdir}/proftpd" \
|
|
|
|
|
--localstatedir="%{rundir}/proftpd" \
|
|
|
|
|
--disable-strip \
|
|
|
|
|
--enable-ctrls \
|
|
|
|
|
--enable-dso \
|
|
|
|
|
--enable-facl \
|
|
|
|
|
--enable-ipv6 \
|
|
|
|
|
--enable-nls \
|
|
|
|
|
--enable-openssl \
|
|
|
|
|
--disable-pcre \
|
|
|
|
|
--disable-redis \
|
|
|
|
|
--enable-shadow \
|
|
|
|
|
--enable-tests=nonetwork \
|
|
|
|
|
--with-libraries="%{_libdir}/%{mysql_lib}" \
|
|
|
|
|
--with-includes="%{_includedir}/mysql" \
|
|
|
|
|
--with-modules=mod_readme:mod_auth_pam:mod_tls \
|
2021-12-04 16:57:02 +08:00
|
|
|
--with-shared=${SMOD1}:${SMOD2}:${SMOD3}:${SMOD4}:${SMOD5}:${SMOD6}:${SMOD7}:mod_ifsession
|
2021-06-01 11:18:37 +08:00
|
|
|
%make_build
|
2020-10-23 14:46:16 +08:00
|
|
|
|
|
|
|
|
%install
|
2021-06-01 11:18:37 +08:00
|
|
|
%{make_install} INSTALL_USER=`id -un` INSTALL_GROUP=`id -gn`
|
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/proftpd/conf.d
|
|
|
|
|
install -D -p -m 640 proftpd.conf %{buildroot}%{_sysconfdir}/proftpd.conf
|
|
|
|
|
install -D -p -m 640 anonftp.conf %{buildroot}%{_sysconfdir}/proftpd/anonftp.conf
|
|
|
|
|
install -D -p -m 640 modules.conf %{buildroot}%{_sysconfdir}/proftpd/modules.conf
|
|
|
|
|
install -D -p -m 640 mod_ban.conf %{buildroot}%{_sysconfdir}/proftpd/mod_ban.conf
|
|
|
|
|
install -D -p -m 640 mod_qos.conf %{buildroot}%{_sysconfdir}/proftpd/mod_qos.conf
|
|
|
|
|
install -D -p -m 640 mod_tls.conf %{buildroot}%{_sysconfdir}/proftpd/mod_tls.conf
|
2020-10-23 14:46:16 +08:00
|
|
|
install -D -p -m 644 contrib/dist/rpm/proftpd.pam \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_sysconfdir}/pam.d/proftpd
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
|
|
|
|
install -D -p -m 644 contrib/dist/rpm/proftpd.service \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_unitdir}/proftpd.service
|
2020-10-23 14:46:16 +08:00
|
|
|
install -D -p -m 644 contrib/dist/systemd/proftpd.socket \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_unitdir}/proftpd.socket
|
2020-10-23 14:46:16 +08:00
|
|
|
install -D -p -m 644 contrib/dist/systemd/proftpd@.service \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_unitdir}/proftpd@.service
|
2020-10-23 14:46:16 +08:00
|
|
|
%else
|
|
|
|
|
install -D -p -m 755 contrib/dist/rpm/proftpd.init.d \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_sysconfdir}/rc.d/init.d/proftpd
|
2020-10-23 14:46:16 +08:00
|
|
|
install -D -p -m 644 contrib/dist/rpm/xinetd \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_sysconfdir}/xinetd.d/xproftpd
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
|
|
|
|
install -D -p -m 644 contrib/dist/rpm/proftpd.logrotate \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_sysconfdir}/logrotate.d/proftpd
|
|
|
|
|
install -D -p -m 644 %{SOURCE8} %{buildroot}%{_localstatedir}/ftp/welcome.msg
|
|
|
|
|
install -D -p -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/proftpd
|
2020-10-23 14:46:16 +08:00
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/{ftp/{pub,uploads},log/proftpd}
|
|
|
|
|
touch %{buildroot}%{_sysconfdir}/ftpusers
|
2021-06-01 11:18:37 +08:00
|
|
|
|
|
|
|
|
# Make sure %%{rundir}/proftpd exists at boot time for systems where it's on tmpfs (#656675)
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{rundir_tmpfs}
|
|
|
|
|
install -d -m 755 %{buildroot}%{_prefix}/lib/tmpfiles.d
|
|
|
|
|
install -p -m 644 contrib/dist/rpm/proftpd-tmpfs.conf \
|
2021-06-01 11:18:37 +08:00
|
|
|
%{buildroot}%{_prefix}/lib/tmpfiles.d/proftpd.conf
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
|
2021-09-07 15:30:09 +08:00
|
|
|
chrpath -d %{buildroot}%{_sbindir}/proftpd
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/etc/ld.so.conf.d
|
|
|
|
|
echo "%{_libdir}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
# Find translations
|
2020-10-23 14:46:16 +08:00
|
|
|
%find_lang proftpd
|
|
|
|
|
|
|
|
|
|
%check
|
2021-06-01 11:18:37 +08:00
|
|
|
# Integration tests not fully maintained - stick to API tests only by default
|
2020-10-23 14:46:16 +08:00
|
|
|
%if 0%{?_with_integrationtests:1}
|
|
|
|
|
ln ftpdctl tests/
|
|
|
|
|
make check
|
|
|
|
|
%else
|
2021-12-04 16:57:02 +08:00
|
|
|
#API tests should always be OK
|
2021-06-01 11:18:37 +08:00
|
|
|
export HOSTNAME=`cat /etc/hosts | grep 127.0.0.1 | head -1| awk '{print $2}'`
|
2020-10-23 14:46:16 +08:00
|
|
|
if ! make -C tests api-tests; then
|
2021-06-01 11:18:37 +08:00
|
|
|
# Diagnostics to report upstream
|
|
|
|
|
cat tests/api-tests.log
|
|
|
|
|
./proftpd -V
|
|
|
|
|
# Fail the build
|
|
|
|
|
false
|
2020-10-23 14:46:16 +08:00
|
|
|
fi
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%if %{use_systemd}
|
|
|
|
|
systemctl daemon-reload &>/dev/null || :
|
|
|
|
|
%endif
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
2021-06-01 11:18:37 +08:00
|
|
|
# Initial installation
|
2020-10-23 14:46:16 +08:00
|
|
|
%if ! %{use_systemd}
|
2021-06-01 11:18:37 +08:00
|
|
|
chkconfig --add proftpd || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
|
|
|
|
%if %{preset_support}
|
2021-06-01 11:18:37 +08:00
|
|
|
systemctl preset proftpd.service &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
IFS=":"; cat /etc/passwd | \
|
|
|
|
|
while { read username nu nu gid nu nu nu nu; }; do \
|
|
|
|
|
if [ $gid -lt 100 -a "$username" != "ftp" ]; then
|
|
|
|
|
echo $username >> %{_sysconfdir}/ftpusers
|
|
|
|
|
fi
|
|
|
|
|
done
|
2020-10-23 14:46:16 +08:00
|
|
|
fi
|
2021-09-07 15:30:09 +08:00
|
|
|
/sbin/ldconfig
|
2020-10-23 14:46:16 +08:00
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
2021-06-01 11:18:37 +08:00
|
|
|
# Package removal, not upgrade
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
2021-06-01 11:18:37 +08:00
|
|
|
systemctl --no-reload disable proftpd.service &>/dev/null || :
|
|
|
|
|
systemctl stop proftpd.service &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%else
|
2021-06-01 11:18:37 +08:00
|
|
|
service proftpd stop &>/dev/null || :
|
|
|
|
|
chkconfig --del proftpd || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
2021-06-01 11:18:37 +08:00
|
|
|
find %{rundir}/proftpd -depth -mindepth 1 |
|
|
|
|
|
xargs rm -rf &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%if %{use_systemd}
|
|
|
|
|
systemctl daemon-reload &>/dev/null || :
|
|
|
|
|
%endif
|
|
|
|
|
if [ $1 -ge 1 ]; then
|
2021-06-01 11:18:37 +08:00
|
|
|
# Package upgrade, not uninstall
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
2021-06-01 11:18:37 +08:00
|
|
|
systemctl try-restart proftpd.service &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%else
|
2021-06-01 11:18:37 +08:00
|
|
|
service proftpd condrestart &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
else
|
2021-06-01 11:18:37 +08:00
|
|
|
# Package removal, not upgrade
|
|
|
|
|
service xinetd reload &>/dev/null || :
|
2020-10-23 14:46:16 +08:00
|
|
|
%endif
|
|
|
|
|
fi
|
2021-09-07 15:30:09 +08:00
|
|
|
/sbin/ldconfig
|
2020-10-23 14:46:16 +08:00
|
|
|
|
|
|
|
|
%files -f proftpd.lang
|
|
|
|
|
%if 0%{?_licensedir:1}
|
|
|
|
|
%license COPYING
|
|
|
|
|
%else
|
|
|
|
|
%doc COPYING
|
|
|
|
|
%endif
|
|
|
|
|
%doc CREDITS ChangeLog NEWS README.md
|
2021-06-01 11:18:37 +08:00
|
|
|
%doc README.modules contrib/README.contrib contrib/README.ratio
|
2020-10-23 14:46:16 +08:00
|
|
|
%doc doc/* sample-configurations/
|
|
|
|
|
%dir %{_localstatedir}/ftp/
|
|
|
|
|
%dir %{_localstatedir}/ftp/pub/
|
|
|
|
|
%dir %{rundir}/proftpd/
|
2021-06-01 11:18:37 +08:00
|
|
|
%dir %{_sysconfdir}/logrotate.d/
|
|
|
|
|
%dir %{_sysconfdir}/proftpd/
|
|
|
|
|
%dir %{_sysconfdir}/proftpd/conf.d/
|
2020-10-23 14:46:16 +08:00
|
|
|
%config(noreplace) %{_localstatedir}/ftp/welcome.msg
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/blacklist.dat
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/dhparams.pem
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/ftpusers
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/proftpd
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/pam.d/proftpd
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd.conf
|
2021-06-01 11:18:37 +08:00
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd/anonftp.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd/modules.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd/mod_ban.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd/mod_qos.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/proftpd/mod_tls.conf
|
2020-10-23 14:46:16 +08:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/proftpd
|
2021-09-07 15:30:09 +08:00
|
|
|
%config(noreplace) /etc/ld.so.conf.d/*
|
2020-10-23 14:46:16 +08:00
|
|
|
%if %{use_systemd}
|
|
|
|
|
%{_unitdir}/proftpd.service
|
|
|
|
|
%{_unitdir}/proftpd.socket
|
|
|
|
|
%{_unitdir}/proftpd@.service
|
|
|
|
|
%else
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/xinetd.d/xproftpd
|
|
|
|
|
%{_sysconfdir}/rc.d/init.d/proftpd
|
|
|
|
|
%endif
|
|
|
|
|
%if %{rundir_tmpfs}
|
|
|
|
|
%{_prefix}/lib/tmpfiles.d/proftpd.conf
|
|
|
|
|
%endif
|
|
|
|
|
%{_bindir}/ftpdctl
|
|
|
|
|
%{_sbindir}/ftpscrub
|
|
|
|
|
%{_sbindir}/ftpshut
|
|
|
|
|
%{_sbindir}/in.proftpd
|
|
|
|
|
%{_sbindir}/proftpd
|
|
|
|
|
%{_mandir}/man5/proftpd.conf.5*
|
|
|
|
|
%{_mandir}/man5/xferlog.5*
|
|
|
|
|
%{_mandir}/man8/ftpdctl.8*
|
|
|
|
|
%{_mandir}/man8/ftpscrub.8*
|
|
|
|
|
%{_mandir}/man8/ftpshut.8*
|
|
|
|
|
%{_mandir}/man8/proftpd.8*
|
|
|
|
|
%dir %{_libexecdir}/proftpd/
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ban.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ctrls_admin.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_copy.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_deflate.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_exec.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_facl.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ifsession.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ifversion.so
|
2021-12-04 16:57:02 +08:00
|
|
|
%{_libexecdir}/proftpd/mod_unique_id.so
|
2020-10-23 14:46:16 +08:00
|
|
|
%{_libexecdir}/proftpd/mod_load.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_qos.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_quotatab.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_quotatab_file.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_quotatab_radius.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_quotatab_sql.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_radius.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ratio.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_rewrite.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sftp.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sftp_pam.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sftp_sql.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_shaper.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_site_misc.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sql.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sql_passwd.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_tls_shmcache.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_vroot.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_wrap2.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_wrap2_file.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_wrap2_sql.so
|
|
|
|
|
%exclude %{_libexecdir}/proftpd/*.a
|
|
|
|
|
%exclude %{_libexecdir}/proftpd/*.la
|
|
|
|
|
%attr(331, ftp, ftp) %dir %{_localstatedir}/ftp/uploads/
|
|
|
|
|
%attr(750, root, root) %dir %{_localstatedir}/log/proftpd/
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%{_bindir}/prxs
|
|
|
|
|
%{_includedir}/proftpd/
|
|
|
|
|
%{_libdir}/pkgconfig/proftpd.pc
|
|
|
|
|
|
|
|
|
|
%files ldap
|
|
|
|
|
%doc README.LDAP contrib/mod_quotatab_ldap.ldif contrib/mod_quotatab_ldap.schema
|
|
|
|
|
%{_libexecdir}/proftpd/mod_ldap.so
|
|
|
|
|
%{_libexecdir}/proftpd/mod_quotatab_ldap.so
|
|
|
|
|
|
|
|
|
|
%files mysql
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sql_mysql.so
|
|
|
|
|
|
2022-03-17 11:35:57 +08:00
|
|
|
%if %{?openEuler:1}0
|
2020-10-23 14:46:16 +08:00
|
|
|
%files postgresql
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sql_postgres.so
|
2022-03-17 11:35:57 +08:00
|
|
|
%endif
|
2020-10-23 14:46:16 +08:00
|
|
|
|
|
|
|
|
%files sqlite
|
|
|
|
|
%{_libexecdir}/proftpd/mod_sql_sqlite.so
|
|
|
|
|
|
|
|
|
|
%files utils
|
|
|
|
|
%doc contrib/xferstats.holger-preiss
|
|
|
|
|
%{_bindir}/ftpasswd
|
|
|
|
|
%{_bindir}/ftpcount
|
|
|
|
|
%{_bindir}/ftpmail
|
|
|
|
|
%{_bindir}/ftpquota
|
|
|
|
|
%{_bindir}/ftptop
|
|
|
|
|
%{_bindir}/ftpwho
|
|
|
|
|
%{_mandir}/man1/ftpasswd.1*
|
|
|
|
|
%{_mandir}/man1/ftpcount.1*
|
|
|
|
|
%{_mandir}/man1/ftpmail.1*
|
|
|
|
|
%{_mandir}/man1/ftpquota.1*
|
|
|
|
|
%{_mandir}/man1/ftptop.1*
|
|
|
|
|
%{_mandir}/man1/ftpwho.1*
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-03-17 11:35:57 +08:00
|
|
|
* Thu Mar 17 2022 gaihuiying <eaglegai@163.com> - 1.3.7c-3
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:add macro to control if postgresql is need
|
|
|
|
|
|
2022-01-07 15:40:24 +08:00
|
|
|
* Fri Jan 07 2022 gaihuiying <gaihuiying1@huawei.com> - 1.3.7c-2
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:fix environment sensitive tests failure
|
|
|
|
|
|
2021-12-04 16:57:02 +08:00
|
|
|
* Sat Dec 04 2021 quanhongfei <quanhongfei@huawei.com> - 1.3.7c-1
|
|
|
|
|
- Type:requirement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:update proftpd to 1.3.7c
|
|
|
|
|
|
2021-09-07 15:30:09 +08:00
|
|
|
* Tue Sep 07 2021 gaihuiying <gaihuiying1@huawei.com> - 1.3.7a-2
|
|
|
|
|
- Type:requirement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:remove rpath of proftpd
|
|
|
|
|
|
2021-06-01 11:18:37 +08:00
|
|
|
* Tue Jun 1 2021 gaihuiying <gaihuiying1@huawei.com> - 1.3.7a-1
|
|
|
|
|
- Update to 1.3.7a
|
|
|
|
|
|
2020-10-23 14:46:16 +08:00
|
|
|
* Wed Oct 14 2020 chengzihan <chengzihan2@huawei.com> - 1.3.6-1
|
|
|
|
|
- Package init
|