From 44ffe22ac1430a748d595e0929001e36c89c8d5d45b5c4cf26328aa4c97b5195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 21 Sep 2015 11:35:52 +0000 Subject: [PATCH] - 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 --- vsftpd.changes | 5 +++++ vsftpd.spec | 49 +++++++++++++++++++------------------------------ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/vsftpd.changes b/vsftpd.changes index 0c76255..1af95c5 100644 --- a/vsftpd.changes +++ b/vsftpd.changes @@ -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 diff --git a/vsftpd.spec b/vsftpd.spec index ba208bd..1144c4a 100644 --- a/vsftpd.spec +++ b/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}