SHA256
1
0
forked from pool/vsftpd

- Cleanup with spec-cleaner

- Remove conditions about init files as we do not build for < 12.1
  anyway.
- Update the README.SUSE file to describe more the listen option.

OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=63
This commit is contained in:
Tomáš Chvátal
2014-05-26 13:22:17 +00:00
committed by Git OBS Bridge
parent 9c280be826
commit 210c375786
4 changed files with 57 additions and 195 deletions

View File

@@ -16,19 +16,7 @@
#
%global with_sysvinit 0
%if 0%{?suse_version} < 1310
%global with_sysvinit 1
%endif
Name: vsftpd
BuildRequires: gpg-offline
BuildRequires: libcap-devel
BuildRequires: openssl-devel
BuildRequires: pam-devel
%if 0%{?suse_version} > 1140
BuildRequires: systemd
%endif
Version: 3.0.2
Release: 0
Summary: Very Secure FTP Daemon - Written from Scratch
@@ -36,15 +24,14 @@ License: SUSE-GPL-2.0-with-openssl-exception
Group: Productivity/Networking/Ftp/Servers
Url: https://security.appspot.com/vsftpd.html
Source0: https://security.appspot.com/downloads/%{name}-%{version}.tar.gz
Source1: %name.pam
Source2: %name.logrotate
Source3: %name.init
Source1: %{name}.pam
Source2: %{name}.logrotate
Source4: README.SUSE
Source5: %name.xml
Source6: %name.firewall
Source5: %{name}.xml
Source6: %{name}.firewall
Source7: vsftpd.service
Source8: vsftpd@.service
Source9: %name.keyring
Source9: %{name}.keyring
Source10: vsftpd.socket
Source1000: https://security.appspot.com/downloads/%{name}-%{version}.tar.gz.asc
Patch1: vsftpd-2.0.4-lib64.diff
@@ -69,11 +56,16 @@ Patch15: vsftpd-enable-dev-log-sendto.patch
Patch16: vsftpd-root-squashed-chroot.patch
#PATCH-FIX-UPSTREAM: bnc#870122
Patch17: vsftpd-enable-gettimeofday-sec.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: ftp-server
Requires(pre): %insserv_prereq /usr/sbin/useradd
%{?systemd_requires}
BuildRequires: gpg-offline
BuildRequires: libcap-devel
BuildRequires: openssl-devel
BuildRequires: pam-devel
BuildRequires: systemd
Requires: logrotate
Requires(pre): %{_sbindir}/useradd
Provides: ftp-server
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%description
Vsftpd is an FTP server, or daemon. The "vs" stands for Very Secure.
@@ -107,94 +99,58 @@ tests.
%patch17 -p1
%build
%define seccomp_opts %{nil}
%if 0%{?suse_version} > 1030
%define seccomp_opts -D_GNU_SOURCE -DUSE_SECCOMP
%endif
rm -f dummyinc/sys/capability.h
make CFLAGS="$RPM_OPT_FLAGS -DOPENSSL_NO_SSL_INTERN -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIE -fstack-protector --param=ssp-buffer-size=4 %{seccomp_opts}" \
make CFLAGS="%{optflags} -DOPENSSL_NO_SSL_INTERN -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIE -fstack-protector --param=ssp-buffer-size=4 %{seccomp_opts}" \
LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now" LINK=
%install
mkdir -p $RPM_BUILD_ROOT/usr/share/empty
cp %SOURCE4 .
install -D -m 755 %name $RPM_BUILD_ROOT/usr/sbin/%name
install -D -m 600 %name.conf $RPM_BUILD_ROOT/etc/%name.conf
install -D -m 600 xinetd.d/%name $RPM_BUILD_ROOT/etc/xinetd.d/%name
install -D -m 644 $RPM_SOURCE_DIR/%name.pam $RPM_BUILD_ROOT/etc/pam.d/%name
install -D -m 644 $RPM_SOURCE_DIR/%name.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/%name
install -D -m 644 %name.conf.5 $RPM_BUILD_ROOT/%_mandir/man5/%name.conf.5
install -D -m 644 %name.8 $RPM_BUILD_ROOT/%_mandir/man8/%name.8
%if %{with_sysvinit}
install -D -m 755 %SOURCE3 $RPM_BUILD_ROOT/etc/init.d/%name
ln -sf ../../etc/init.d/%name $RPM_BUILD_ROOT/%_prefix/sbin/rc%name
%else
ln -sf service $RPM_BUILD_ROOT/%{_prefix}/sbin/rc%{name}
%endif
install -d $RPM_BUILD_ROOT/%_datadir/omc/svcinfo.d/
install -D -m 644 %SOURCE5 $RPM_BUILD_ROOT/%_datadir/omc/svcinfo.d/
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
install -m 644 %{S:6} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%if 0%{?suse_version} > 1140
install -D -m 0644 %SOURCE7 %{buildroot}/%{_unitdir}/%{name}.service
install -D -m 0644 %SOURCE8 %{buildroot}/%{_unitdir}/%{name}@.service
install -D -m 0644 %SOURCE10 %{buildroot}/%{_unitdir}/%{name}.socket
%endif
mkdir -p %{buildroot}%{_datadir}/empty
cp %{SOURCE4} .
install -D -m 755 %{name} %{buildroot}%{_sbindir}/%{name}
install -D -m 600 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
install -D -m 600 xinetd.d/%{name} %{buildroot}%{_sysconfdir}/xinetd.d/%{name}
install -D -m 644 $RPM_SOURCE_DIR/%{name}.pam %{buildroot}%{_sysconfdir}/pam.d/%{name}
install -D -m 644 $RPM_SOURCE_DIR/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -D -m 644 %{name}.conf.5 %{buildroot}/%{_mandir}/man5/%{name}.conf.5
install -D -m 644 %{name}.8 %{buildroot}/%{_mandir}/man8/%{name}.8
ln -sf service %{buildroot}/%{_sbindir}/rc%{name}
install -D -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/%{name}.service
install -D -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/%{name}@.service
install -D -m 0644 %{SOURCE10} %{buildroot}/%{_unitdir}/%{name}.socket
install -d %{buildroot}/%{_datadir}/omc/svcinfo.d/
install -D -m 644 %{SOURCE5} %{buildroot}/%{_datadir}/omc/svcinfo.d/
install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%pre
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d /var/lib/empty ftpsecure 2> /dev/null || :
%if 0%{?suse_version} > 1140
%{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || :
%service_add_pre %{name}.service
%endif
%preun
if [ -e /etc/init.d/%{name} ]; then
%stop_on_removal %name
fi
%if 0%{?suse_version} > 1140
%service_del_preun %{name}.service
%endif
%post
%if %{with_sysvinit}
%{fillup_and_insserv -f %{name}}
%endif
%if 0%{?suse_version} > 1140
%service_add_post %{name}.service
%endif
%postun
%if %{with_sysvinit}
%insserv_cleanup
%restart_on_update %name
%endif
%if 0%{?suse_version} > 1140
%service_del_postun %{name}.service
%endif
%files
%defattr(-,root,root)
%if 0%{?suse_version} > 1140
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_unitdir}/%{name}@.service
%endif
/usr/sbin/%name
/usr/sbin/rc%name
%if %{with_sysvinit}
%config /etc/init.d/%name
%endif
%_datadir/omc/svcinfo.d/vsftpd.xml
%dir /usr/share/empty
%config(noreplace) /etc/xinetd.d/%name
%config(noreplace) /etc/%name.conf
%config /etc/pam.d/%name
%config(noreplace) /etc/logrotate.d/%name
%_mandir/man5/%name.conf.*
%_mandir/man8/%name.*
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
%{_datadir}/omc/svcinfo.d/vsftpd.xml
%dir %{_datadir}/empty
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_mandir}/man5/%{name}.conf.*
%{_mandir}/man8/%{name}.*
%doc BUGS AUDIT Changelog LICENSE README README.security
%doc REWARD SPEED TODO SECURITY TUNING SIZE FAQ EXAMPLE COPYING
%doc README.SUSE