5af4d6a
Name:           needrestart
893a3b1
Version:        3.3
893a3b1
Release:        1%{?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
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
893a3b1
Requires:          python2-subprocess32
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
893a3b1
Requires:          iucode-tool
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
893a3b1
# this calls the rpm command and breaks the RPM DB
893a3b1
# (I guess it's not closed yet in the close_hook)
893a3b1
# we use systemd for all services so this is not needed anyway
893a3b1
rm %{buildroot}/%{_sysconfdir}/%{name}/hook.d/20-rpm
893a3b1
# see https://github.com/liske/needrestart/issues/123
893a3b1
mkdir -p %{buildroot}/%{_sysconfdir}/default
893a3b1
echo "IUCODE_TOOL_EXTRA_OPTIONS=--ignore-broken" >%{buildroot}/%{_sysconfdir}/default/intel-microcode
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
893a3b1
%doc README.md README.batch.md README.Cont.md README.Interp.md README.nagios.md README.uCode.md NEWS ChangeLog
5af4d6a
%config(noreplace) %{_sysconfdir}/%{name}
893a3b1
%config(noreplace) %{_sysconfdir}/default/intel-microcode
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
893a3b1
* Thu Jul 19 2018 Marc Dequènes (Duck) <duck@redhat.com> - 3.3-1
893a3b1
- NUR
893a3b1
- YUM plugin: use subprocess32 as recommended by Python
893a3b1
  subprocess documentation, and catch all exceptions
893a3b1
- removes the `20-rpm` hook, this is breaking the RPM DB
893a3b1
- workaround needrestart#123
3fa6741
- add missing dependency on 'iucode-tool'
3fa6741
- install new documentation file 'README.uCode.md'
3fa6741
- update debconf templates
3fa6741
- NUR: removed all patches, integrated upstream
3fa6741
- added workaround for GetTerminalSize problem when used
3fa6741
  non-interractively (see needrestart#110)
3fa6741
- fix crash with YUM plugin when called by yum-cron
893a3b1
c98a220
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.11-11
c98a220
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c98a220
350865d
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.11-10
350865d
- Rebuilt for Python 3.7
350865d
7f6c5f4
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.11-9
7f6c5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7f6c5f4
e7c6690
* Thu Dec 21 2017 Marc Dequènes (Duck) <duck@redhat.com> - 2.11-8
e7c6690
- fix 'check_needed' variable scope in YUM plugin
f6e3409
- fix YUM plugin Python encoding problem
815200d
- declare YUM plugin can be run non-interactively
286b171
- YUM/DNF plugins: run non-interactively if --assumeyes is used
e7c6690
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