forked from pool/vsftpd
- Clean-up the init.d support to be bit more readable and add missing dep
OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=92
This commit is contained in:
parent
71ffe127d6
commit
44ffe22ac1
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 21 11:34:46 UTC 2015 - tchvatal@suse.com
|
||||
|
||||
- Clean-up the init.d support to be bit more readable and add missing dep
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 21 11:14:59 UTC 2015 - joop.boonen@opensuse.org
|
||||
|
||||
|
49
vsftpd.spec
49
vsftpd.spec
@ -16,14 +16,11 @@
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} < 1210
|
||||
%global with_sysvinit 1
|
||||
%global with_systemd 0
|
||||
%else
|
||||
%global with_sysvinit 0
|
||||
%if 0%{?suse_version} > 1210
|
||||
%global with_systemd 1
|
||||
%else
|
||||
%global with_systemd 0
|
||||
%endif
|
||||
|
||||
Name: vsftpd
|
||||
Version: 3.0.3
|
||||
Release: 0
|
||||
@ -73,15 +70,15 @@ 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}
|
||||
BuildRequires: systemd
|
||||
%{?systemd_requires}
|
||||
%else
|
||||
Requires(post): %insserv_prereq
|
||||
%endif
|
||||
|
||||
%description
|
||||
@ -134,15 +131,14 @@ 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
|
||||
%else
|
||||
install -D -m 755 %{SOURCE3} %{buildroot}%{_initddir}/%{name}
|
||||
ln -sf %{_initddir}/%{name} %{buildroot}/%{_sbindir}/rc%{name}
|
||||
%endif
|
||||
install -d %{buildroot}/%{_datadir}/omc/svcinfo.d/
|
||||
install -D -m 644 %{SOURCE5} %{buildroot}/%{_datadir}/omc/svcinfo.d/
|
||||
@ -156,32 +152,26 @@ install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/s
|
||||
%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
|
||||
%else
|
||||
%stop_on_removal %{name}
|
||||
%endif
|
||||
|
||||
%post
|
||||
%if %{with_sysvinit}
|
||||
%insserv_cleanup
|
||||
%restart_on_update %{name}
|
||||
%endif
|
||||
|
||||
%if %{with_systemd}
|
||||
%service_add_post %{name}.service %{name}@.service %{name}.socket
|
||||
%else
|
||||
%insserv_cleanup
|
||||
%restart_on_update %{name}
|
||||
%endif
|
||||
|
||||
%postun
|
||||
%if %{with_sysvinit}
|
||||
%insserv_cleanup
|
||||
%restart_on_update %{name}
|
||||
%endif
|
||||
|
||||
%if %{with_systemd}
|
||||
%service_del_postun %{name}.service %{name}@.service %{name}.socket
|
||||
%else
|
||||
%insserv_cleanup
|
||||
%restart_on_update %{name}
|
||||
%endif
|
||||
|
||||
%files
|
||||
@ -190,12 +180,11 @@ fi
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_unitdir}/%{name}.socket
|
||||
%{_unitdir}/%{name}@.service
|
||||
%else
|
||||
%{_initddir}/%{name}
|
||||
%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}
|
||||
|
Loading…
Reference in New Issue
Block a user