SHA256
1
0
forked from pool/vsftpd

Accepting request 332591 from home:worldcitizen:branches:network

Brought back additional systemv support so it also builds for SLES 10 and 11

OBS-URL: https://build.opensuse.org/request/show/332591
OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=91
This commit is contained in:
Tomáš Chvátal
2015-09-21 11:27:21 +00:00
committed by Git OBS Bridge
parent 7cbe902ddd
commit 71ffe127d6
3 changed files with 158 additions and 0 deletions

View File

@@ -16,6 +16,14 @@
#
%if 0%{?suse_version} < 1210
%global with_sysvinit 1
%global with_systemd 0
%else
%global with_sysvinit 0
%global with_systemd 1
%endif
Name: vsftpd
Version: 3.0.3
Release: 0
@@ -26,6 +34,7 @@ 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
Source4: README.SUSE
Source5: %{name}.xml
Source6: %{name}.firewall
@@ -64,12 +73,16 @@ Patch22: vsftpd-path-normalize.patch
BuildRequires: libcap-devel
BuildRequires: openssl-devel
BuildRequires: pam-devel
%if %{with_systemd}
BuildRequires: systemd
%endif
Requires: logrotate
Requires(pre): %{_sbindir}/useradd
Provides: ftp-server
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with_systemd}
%{?systemd_requires}
%endif
%description
Vsftpd is an FTP server, or daemon. The "vs" stands for Very Secure.
@@ -121,10 +134,16 @@ install -D -m 644 $RPM_SOURCE_DIR/%{name}.pam %{buildroot}%{_sysconfdir}/pam.d/%
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
%if %{with_sysvinit}
install -D -m 755 %SOURCE3 %{buildroot}/etc/init.d/%{name}
ln -sf ../../etc/init.d/%{name} %{buildroot}/%_prefix/sbin/rc%{name}
%endif
%if %{with_systemd}
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
%endif
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/
@@ -132,24 +151,51 @@ install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/s
%pre
%{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || :
%if %{with_systemd}
%service_add_pre %{name}.service %{name}@.service %{name}.socket
%endif
%preun
if [ -e /etc/init.d/%{name} ]; then
%stop_on_removal %{name}
fi
%if %{with_systemd}
%service_del_preun %{name}.service %{name}@.service %{name}.socket
%endif
%post
%if %{with_sysvinit}
%insserv_cleanup
%restart_on_update %{name}
%endif
%if %{with_systemd}
%service_add_post %{name}.service %{name}@.service %{name}.socket
%endif
%postun
%if %{with_sysvinit}
%insserv_cleanup
%restart_on_update %{name}
%endif
%if %{with_systemd}
%service_del_postun %{name}.service %{name}@.service %{name}.socket
%endif
%files
%defattr(-,root,root)
%if %{with_systemd}
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_unitdir}/%{name}@.service
%endif
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
%if %{with_sysvinit}
%config /etc/init.d/%{name}
%endif
%{_datadir}/omc/svcinfo.d/vsftpd.xml
%dir %{_datadir}/empty
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}