5af4d6a
Name:           needrestart
5af4d6a
Version:        2.11
7a80265
Release:        7%{?dist}
5af4d6a
Summary:        Restart daemons after library updates
5af4d6a
5af4d6a
License:        GPLv2+
5af4d6a
URL:            https://github.com/liske/%{name}
5af4d6a
Source0:        https://github.com/liske/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
5af4d6a
Source1:        debconf__needrestart.templates
5af4d6a
Source2:        restart.d__auditd.service
5af4d6a
Source3:        yum__plugin.py
5af4d6a
Source4:        dnf__plugin.py
5af4d6a
# borrowed from Debian, so keeping the original name to ease sync
5af4d6a
Patch0:         02-install-restart-d.diff
5af4d6a
Patch1:         03-perl-warning.diff
5af4d6a
5af4d6a
BuildArch:         noarch
5af4d6a
BuildRequires:     perl
5af4d6a
BuildRequires:     gettext
5af4d6a
BuildRequires:     perl(ExtUtils::MakeMaker)
5af4d6a
BuildRequires:     debconf
5af4d6a
BuildRequires:     po-debconf
5af4d6a
%if 0%{?fedora}
5af4d6a
BuildRequires:     python3-devel
5af4d6a
Requires:          python3-dnf
5af4d6a
%else
5af4d6a
Requires:          yum
5af4d6a
%endif
5af4d6a
Requires:          perl(Module::Find)
5af4d6a
Requires:          perl(Module::ScanDeps)
5af4d6a
Requires:          perl(Locale::TextDomain)
5af4d6a
Requires:          perl(Proc::ProcessTable)
5af4d6a
Requires:          perl(Sort::Naturally)
5af4d6a
Requires:          perl(Term::ReadKey)
5af4d6a
Requires:          perl(Debconf::Client::ConfModule)
5af4d6a
Requires:          xz
5af4d6a
5af4d6a
%{?perl_default_filter}
5af4d6a
5af4d6a
5af4d6a
%description
5af4d6a
needrestart checks which daemons need to be restarted after library
5af4d6a
upgrades. It is inspired by checkrestart from the debian-goodies
5af4d6a
package.
5af4d6a
5af4d6a
5af4d6a
%prep
5af4d6a
%autosetup -n %{name}-%{version} -p 1
5af4d6a
5af4d6a
%build
5af4d6a
%make_build
5af4d6a
5af4d6a
5af4d6a
%install
5af4d6a
%make_install
5af4d6a
mkdir -p %{buildroot}/%{_mandir}/man1
5af4d6a
cp man/needrestart.1 %{buildroot}/%{_mandir}/man1/
5af4d6a
%find_lang %{name}
5af4d6a
%find_lang needrestart-notify
5af4d6a
# useless files
5af4d6a
rm -rf %{buildroot}/%{perl_archlib}
5af4d6a
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1489569
5af4d6a
cp %{SOURCE1} %{buildroot}/%{_datadir}/%{name}/needrestart.templates
5af4d6a
# workaround for https://github.com/liske/needrestart/issues/75
5af4d6a
cp %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}/restart.d/auditd.service
5af4d6a
chmod a+x %{buildroot}/%{_sysconfdir}/%{name}/restart.d/auditd.service
5af4d6a
%if 0%{?fedora}
5af4d6a
mkdir -p %{buildroot}/%{_sysconfdir}/dnf/plugins %{buildroot}/%{python3_sitelib}/dnf-plugins
5af4d6a
echo -e "[main]\nenabled=1\n" >%{buildroot}/%{_sysconfdir}/dnf/plugins/needrestart.conf
5af4d6a
cp %{SOURCE4} %{buildroot}/%{python3_sitelib}/dnf-plugins/needrestart.py
5af4d6a
%else
5af4d6a
mkdir -p %{buildroot}/%{_sysconfdir}/yum/pluginconf.d %{buildroot}/usr/lib/yum-plugins
5af4d6a
echo -e "[main]\nenabled=1\n" >%{buildroot}/%{_sysconfdir}/yum/pluginconf.d/needrestart.conf
5af4d6a
cp %{SOURCE3} %{buildroot}/usr/lib/yum-plugins/needrestart.py
5af4d6a
%endif
5af4d6a
5af4d6a
5af4d6a
# About executable files in the /etc directory:
5af4d6a
#   The 'README.needrestart' files in /etc/needrestart/restart.d/ and
5af4d6a
#   /etc/needrestart/notify.d/ explicitly say the files will only be
5af4d6a
#   considered if they are executables. There's nothing said for
5af4d6a
#   /etc/needrestart/hook.d/ but I guess this is the same logic.
5af4d6a
%files -f %{name}.lang -f needrestart-notify.lang
5af4d6a
%license COPYING
5af4d6a
%doc README.md README.batch.md README.Cont.md README.Interp.md README.nagios.md NEWS ChangeLog
5af4d6a
%config(noreplace) %{_sysconfdir}/%{name}
5af4d6a
%{_sbindir}/%{name}
5af4d6a
%{perl_vendorlib}/*
5af4d6a
# %{_libdir} resolves to /usr/lib64 on 64-bits systems, but the software does not handle this
5af4d6a
/usr/lib/%{name}
5af4d6a
%{_datadir}/%{name}
5af4d6a
%{_datadir}/polkit-1
5af4d6a
%{_mandir}/man1/needrestart.1*
5af4d6a
%if 0%{?fedora}
5af4d6a
%config(noreplace) %{_sysconfdir}/dnf/plugins/needrestart.conf
5af4d6a
%{python3_sitelib}
5af4d6a
%else
5af4d6a
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/needrestart.conf
5af4d6a
/usr/lib/yum-plugins
5af4d6a
%endif
5af4d6a
5af4d6a
5af4d6a
%changelog
7a80265
* Thu Oct 05 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-7
7a80265
- forgot the %%{?dist} release component
7a80265
5af4d6a
* Thu Sep 28 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-6
5af4d6a
- Thanks Matthias Runge Mauchin for the review
5af4d6a
- break description line too long
5af4d6a
5af4d6a
* Thu Sep 28 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-5
5af4d6a
- add dependency on respective YUM/DNF packages to avoid unowned directories
5af4d6a
5af4d6a
* Wed Sep 27 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-4
5af4d6a
- make the changelog more readable
5af4d6a
5af4d6a
* Fri Sep 22 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-3
5af4d6a
- YUM plugin: call needrestart in close_hook to avoid RPMDB mess
5af4d6a
- fix conditional to install DNF plugin instead of YUM plugin
5af4d6a
- build depends on python3-devel to get the related macros
5af4d6a
- fix DNF plugin directory creation
5af4d6a
5af4d6a
* Fri Sep 15 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-2
5af4d6a
- update YUM and DNF plugins: don't crash when needrestart itself is being removed
5af4d6a
5af4d6a
* Thu Sep 07 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-1
5af4d6a
- initial packaging
5af4d6a