Blame SPECS/rhnsd.spec

062feb
Summary: Spacewalk query daemon
062feb
Name: rhnsd
062feb
Version: 5.0.35
062feb
Release: 3%{?dist}
062feb
License: GPLv2
062feb
Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz
062feb
Patch0: rhnsd-5.0.35-1-to-rhnsd-5.0.35-2-el8.patch
062feb
Patch1: rhnsd-5.0.35-2-el8-to-rhnsd-5.0.35-3-el8.patch
062feb
URL:     https://github.com/spacewalkproject/spacewalk
062feb
062feb
BuildRequires: gettext
062feb
062feb
Requires: rhn-check >= 0.0.8
062feb
%if 0%{?suse_version} >= 1210 || 0%{?fedora} || 0%{?rhel} >= 7
062feb
BuildRequires: systemd
062feb
%{?systemd_requires}
062feb
%endif
062feb
%if 0%{?suse_version}
062feb
Requires(post): aaa_base
062feb
Requires(preun): aaa_base
062feb
BuildRequires: sysconfig
062feb
%else
062feb
%if 0%{?fedora} || 0%{?rhel} >= 7
062feb
Requires(post): chkconfig
062feb
Requires(preun): chkconfig
062feb
Requires(post): systemd-sysv
062feb
Requires(preun): systemd-sysv
062feb
%else
062feb
Requires(post): chkconfig
062feb
Requires(preun): chkconfig
062feb
# This is for /sbin/service
062feb
Requires(preun): initscripts
062feb
Requires(postun): initscripts
062feb
%endif
062feb
%endif
062feb
062feb
%description
062feb
The Red Hat Update Agent that automatically queries the Red Hat
062feb
Network servers and determines which packages need to be updated on
062feb
your machine, and runs any actions.
062feb
062feb
%prep
062feb
%setup -q
062feb
%patch0 -p1
062feb
%patch1 -p1
062feb
062feb
%build
062feb
make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="-pie -fPIE -Wl,-z,relro,-z,now %{optflags}"
062feb
062feb
%install
062feb
make -f Makefile.rhnsd install VERSION=%{version}-%{release} PREFIX=$RPM_BUILD_ROOT MANPATH=%{_mandir} INIT_DIR=$RPM_BUILD_ROOT/%{_initrddir}
062feb
062feb
%if 0%{?suse_version} && 0%{?suse_version} < 1210
062feb
install -m 0755 rhnsd.init.SUSE $RPM_BUILD_ROOT/%{_initrddir}/rhnsd
062feb
%endif
062feb
%if 0%{?fedora} || 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7
062feb
rm $RPM_BUILD_ROOT/%{_initrddir}/rhnsd
062feb
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
062feb
install -m 0644 rhnsd.service $RPM_BUILD_ROOT/%{_unitdir}/
062feb
%endif
062feb
062feb
%find_lang %{name}
062feb
062feb
%{!?systemd_post: %global systemd_post() if [ $1 -eq 1 ] ; then /usr/bin/systemctl enable %%{?*} >/dev/null 2>&1 || : ; fi; }
062feb
%{!?systemd_preun: %global systemd_preun() if [ $1 -eq 0 ] ; then /usr/bin/systemctl --no-reload disable %%{?*} > /dev/null 2>&1 || : ; /usr/bin/systemctl stop %%{?*} > /dev/null 2>&1 || : ; fi; }
062feb
%{!?systemd_postun_with_restart: %global systemd_postun_with_restart() /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : ; if [ $1 -ge 1 ] ; then /usr/bin/systemctl try-restart %%{?*} >/dev/null 2>&1 || : ; fi; }
062feb
062feb
062feb
%if 0%{?suse_version} >= 1210
062feb
%pre
062feb
%service_add_pre rhnsd.service
062feb
%endif
062feb
062feb
%post
062feb
%if 0%{?suse_version} >= 1210
062feb
%service_add_post rhnsd.service
062feb
%else
062feb
if [ -f /etc/init.d/rhnsd ]; then
062feb
    /sbin/chkconfig --add rhnsd
062feb
fi
062feb
if [ -f %{_unitdir}/rhnsd.service ]; then
062feb
    %systemd_post rhnsd.service
062feb
    if [ "$1" = "2" ]; then
062feb
        # upgrade from old init.d
062feb
        if [ -L /etc/rc2.d/S97rhnsd ]; then
062feb
            /usr/bin/systemctl enable rhnsd.service >/dev/null 2>&1
062feb
        fi
062feb
        rm -f /etc/rc?.d/[SK]??rhnsd
062feb
    fi
062feb
fi
062feb
%endif
062feb
062feb
%preun
062feb
%if 0%{?suse_version} >= 1210
062feb
%service_del_preun rhnsd.service
062feb
%else
062feb
if [ $1 = 0 ] ; then
062feb
    %if 0%{?fedora} || 0%{?rhel} >= 7
062feb
        %systemd_preun rhnsd.service
062feb
    %else
062feb
    service rhnsd stop >/dev/null 2>&1
062feb
    %endif
062feb
    if [ -f /etc/init.d/rhnsd ]; then
062feb
        /sbin/chkconfig --del rhnsd
062feb
    fi
062feb
fi
062feb
%endif
062feb
062feb
%postun
062feb
%if 0%{?suse_version} >= 1210
062feb
%service_del_postun rhnsd.service
062feb
%else
062feb
if [ "$1" -ge "1" ]; then
062feb
    %if 0%{?fedora} || 0%{?rhel} >= 7
062feb
    %systemd_postun_with_restart rhnsd.service
062feb
    %else
062feb
    service rhnsd condrestart >/dev/null 2>&1 || :
062feb
    %endif
062feb
fi
062feb
%endif
062feb
062feb
062feb
%files -f %{name}.lang
062feb
%dir %{_sysconfdir}/sysconfig/rhn
062feb
%config(noreplace) %{_sysconfdir}/sysconfig/rhn/rhnsd
062feb
%{_sbindir}/rhnsd
062feb
%if 0%{?fedora} || 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7
062feb
%{_unitdir}/rhnsd.service
062feb
%else
062feb
%{_initrddir}/rhnsd
062feb
%endif
062feb
%{_mandir}/man8/rhnsd.8*
062feb
%doc LICENSE
062feb
062feb
%changelog
062feb
* Fri Aug 10 2018 Tomas Kasparek <tkasparek@redhat.com> 5.0.35-3
062feb
- Resolves: #1610286 - don't start as sysv service on systemd systems
062feb
  (tkasparek@redhat.com)
062feb
062feb
* Mon Feb 19 2018 Tomas Kasparek <tkasparek@redhat.com> 5.0.35-2
062feb
- rebuild for rhel8 
062feb
062feb
* Mon Feb 05 2018 Tomas Kasparek <tkasparek@redhat.com> 5.0.35-1
062feb
- remove systemd-units
062feb
- remove obsoleted things from spec file
062feb
062feb
* Thu Nov 16 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.34-1
062feb
- removed settings for old RH build system
062feb
062feb
* Thu Oct 05 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.33-1
062feb
- fix rhnsd triggered upgrade of rhnsd on systemd systems
062feb
- 1494389 - Revert "[1260527] RHEL7 reboot loop"
062feb
- 1494389 - Revert "1260527 RHEL7 rhnsd reload doesn't work"
062feb
062feb
* Tue Sep 19 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.32-1
062feb
- 1489989 - umask(0) does not reset to default umask
062feb
062feb
* Wed Sep 06 2017 Michael Mraka <michael.mraka@redhat.com> 5.0.31-1
062feb
- purged changelog entries for Spacewalk 2.0 and older
062feb
062feb
* Tue Aug 15 2017 Gennadii Altukhov <grinrag@gmail.com> 5.0.30-1
062feb
- 1480306 - change permissions for rhnsd.pid
062feb
062feb
* Tue Jul 18 2017 Michael Mraka <michael.mraka@redhat.com> 5.0.29-1
062feb
- move version and release before sources
062feb
062feb
* Mon Jul 17 2017 Jan Dobes 5.0.28-1
062feb
- Regenerating .po and .pot files for rhnsd
062feb
062feb
* Tue Jul 11 2017 Jan Dobes 5.0.27-1
062feb
- 1383668 - close and reopen syslog when redirecting child output
062feb
- Updated links to github in spec files
062feb
- Migrating Fedorahosted to GitHub
062feb
062feb
* Thu Dec 01 2016 Jiri Dostal <jdostal@redhat.com> 5.0.26-1
062feb
- 1260527 RHEL7 rhnsd reload doesn't work
062feb
062feb
* Fri Nov 11 2016 Jiri Dostal <jdostal@redhat.com> 5.0.25-1
062feb
- [1260527] RHEL7 reboot loop
062feb
062feb
* Wed Nov 09 2016 Gennadii Altukhov <galt@redhat.com> 5.0.24-1
062feb
- Revert Project-Id-Version for translations
062feb
062feb
* Tue Nov 08 2016 Gennadii Altukhov <galt@redhat.com> 5.0.23-1
062feb
- Regenerating .po and .pot files for rhnsd.
062feb
- Updating .po translations from Zanata
062feb
062feb
* Thu Oct 27 2016 Jan Dobes 5.0.22-1
062feb
- 1306994 - better check if file is opened
062feb
062feb
* Tue May 24 2016 Tomas Kasparek <tkasparek@redhat.com> 5.0.21-1
062feb
- Regenerating .po and .pot files for rhnsd.
062feb
- Updating .po translations from Zanata
062feb
062feb
* Mon Apr 04 2016 Jan Dobes 5.0.20-1
062feb
- 1306994 - use /dev/null as stdin
062feb
062feb
* Thu Feb 18 2016 Jan Dobes 5.0.19-1
062feb
- do not keep this file in git
062feb
- delete file with input files after template is created
062feb
- pulling *.po translations from Zanata
062feb
- fixing current *.po translations
062feb
062feb
* Wed Sep 23 2015 Jan Dobes 5.0.18-1
062feb
- Pulling updated *.po translations from Zanata.
062feb
062feb
* Tue Jun 23 2015 Jan Dobes 5.0.17-1
062feb
- 1138939 - up2date and systemid files are managed by rhnsd itself, no need to
062feb
  break init script if they do not exist
062feb
062feb
* Thu May 21 2015 Matej Kollar <mkollar@redhat.com> 5.0.16-1
062feb
- 1092518 - PIE+RELRO for rhnsd
062feb
062feb
* Tue Jan 13 2015 Matej Kollar <mkollar@redhat.com> 5.0.15-1
062feb
- Getting rid of Tabs and trailing spaces in LICENSE, COPYING, and README files
062feb
062feb
* Thu Oct 10 2013 Michael Mraka <michael.mraka@redhat.com> 5.0.14-1
062feb
- cleaning up old svn Ids
062feb
062feb
* Mon Jun 17 2013 Michael Mraka <michael.mraka@redhat.com> 5.0.13-1
062feb
- removed old CVS/SVN version ids
062feb
062feb
* Mon Jun 17 2013 Tomas Kasparek <tkasparek@redhat.com> 5.0.12-1
062feb
- rebranding few more strings in client stuff
062feb
062feb
* Tue May 21 2013 Tomas Kasparek <tkasparek@redhat.com> 5.0.11-1
062feb
- branding clean-up of rhel client stuff
062feb