9aa630
Summary: Spacewalk query daemon
9aa630
License: GPLv2
9aa630
Group: System Environment/Base
630c23
Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz
04dec8
Patch0: rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch
baeaa7
Patch1: rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch
baeaa7
Patch2: rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch
baeaa7
Patch3: rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch
baeaa7
Patch4: rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch
630c23
Patch5: rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch
630c23
Patch6: rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch
630c23
Patch7: rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch
630c23
URL:     https://github.com/spacewalkproject/spacewalk
9aa630
Name: rhnsd
9aa630
Version: 5.0.13
630c23
Release: 10%{?dist}
9aa630
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9aa630
9aa630
BuildRequires: gettext
9aa630
9aa630
Requires: rhn-check >= 0.0.8
9aa630
%if 0%{?suse_version} >= 1210
9aa630
BuildRequires: systemd
9aa630
%{?systemd_requires}
9aa630
%endif
9aa630
%if 0%{?suse_version}
9aa630
Requires(post): aaa_base
9aa630
Requires(preun): aaa_base
9aa630
BuildRequires: sysconfig
9aa630
%else
9aa630
%if 0%{?fedora}
9aa630
Requires(post): chkconfig
9aa630
Requires(preun): chkconfig
9aa630
Requires(post): systemd-sysv
9aa630
Requires(preun): systemd-sysv
9aa630
Requires(post): systemd-units
9aa630
Requires(preun): systemd-units
9aa630
BuildRequires: systemd-units
9aa630
%else
9aa630
Requires(post): chkconfig
9aa630
Requires(preun): chkconfig
9aa630
# This is for /sbin/service
9aa630
Requires(preun): initscripts
9aa630
Requires(postun): initscripts
9aa630
%endif
9aa630
%endif
9aa630
9aa630
%description
9aa630
The Red Hat Update Agent that automatically queries the Red Hat
9aa630
Network servers and determines which packages need to be updated on
9aa630
your machine, and runs any actions.
9aa630
9aa630
%prep
9aa630
%setup -q
04dec8
%patch0 -p1
04dec8
%patch1 -p1
04dec8
%patch2 -p1
04dec8
%patch3 -p1
baeaa7
%patch4 -p1
cc76d3
%patch5 -p1
2973af
%patch6 -p1
2973af
%patch7 -p1
9aa630
9aa630
%build
04dec8
make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="-pie -fPIE -Wl,-z,relro,-z,now %{optflags}"
9aa630
9aa630
%install
9aa630
rm -rf $RPM_BUILD_ROOT
9aa630
make -f Makefile.rhnsd install VERSION=%{version}-%{release} PREFIX=$RPM_BUILD_ROOT MANPATH=%{_mandir} INIT_DIR=$RPM_BUILD_ROOT/%{_initrddir}
9aa630
9aa630
%if 0%{?suse_version} && 0%{?suse_version} < 1210
9aa630
install -m 0755 rhnsd.init.SUSE $RPM_BUILD_ROOT/%{_initrddir}/rhnsd
9aa630
%endif
9aa630
%if 0%{?fedora} || 0%{?suse_version} >= 1210
9aa630
rm $RPM_BUILD_ROOT/%{_initrddir}/rhnsd
9aa630
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
9aa630
install -m 0644 rhnsd.service $RPM_BUILD_ROOT/%{_unitdir}/
9aa630
%endif
9aa630
9aa630
%find_lang %{name}
9aa630
9aa630
%{!?systemd_post: %global systemd_post() if [ $1 -eq 1 ] ; then /usr/bin/systemctl enable %%{?*} >/dev/null 2>&1 || : ; fi; }
9aa630
%{!?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; }
9aa630
%{!?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; }
9aa630
9aa630
9aa630
%if 0%{?suse_version} >= 1210
9aa630
%pre
9aa630
%service_add_pre rhnsd.service
9aa630
%endif
9aa630
9aa630
%post
9aa630
%if 0%{?suse_version} >= 1210
9aa630
%service_add_post rhnsd.service
9aa630
%else
9aa630
if [ -f /etc/init.d/rhnsd ]; then
9aa630
    /sbin/chkconfig --add rhnsd
9aa630
fi
9aa630
if [ -f %{_unitdir}/rhnsd.service ]; then
9aa630
    %systemd_post rhnsd.service
9aa630
    if [ "$1" = "2" ]; then
9aa630
        # upgrade from old init.d
9aa630
        if [ -L /etc/rc2.d/S97rhnsd ]; then
9aa630
            /usr/bin/systemctl enable rhnsd.service >/dev/null 2>&1
9aa630
        fi
9aa630
        rm -f /etc/rc?.d/[SK]??rhnsd
9aa630
    fi
9aa630
fi
9aa630
%endif
9aa630
9aa630
%preun
9aa630
%if 0%{?suse_version} >= 1210
9aa630
%service_del_preun rhnsd.service
9aa630
%else
9aa630
if [ $1 = 0 ] ; then
9aa630
    %if 0%{?fedora}
9aa630
        %systemd_preun rhnsd.service
9aa630
    %else
9aa630
    service rhnsd stop >/dev/null 2>&1
9aa630
    %endif
9aa630
    if [ -f /etc/init.d/rhnsd ]; then
9aa630
        /sbin/chkconfig --del rhnsd
9aa630
    fi
9aa630
fi
9aa630
%endif
9aa630
9aa630
%postun
9aa630
%if 0%{?suse_version} >= 1210
9aa630
%service_del_postun rhnsd.service
9aa630
%else
9aa630
if [ "$1" -ge "1" ]; then
9aa630
    %if 0%{?fedora}
9aa630
    %systemd_postun_with_restart rhnsd.service
9aa630
    %else
9aa630
    service rhnsd condrestart >/dev/null 2>&1 || :
9aa630
    %endif
9aa630
fi
9aa630
%endif
9aa630
9aa630
%clean
9aa630
rm -fr $RPM_BUILD_ROOT
9aa630
9aa630
9aa630
%files -f %{name}.lang
9aa630
%dir %{_sysconfdir}/sysconfig/rhn
9aa630
%config(noreplace) %{_sysconfdir}/sysconfig/rhn/rhnsd
9aa630
%{_sbindir}/rhnsd
9aa630
%if 0%{?fedora} || 0%{?suse_version} >= 1210
9aa630
%{_unitdir}/rhnsd.service
9aa630
%else
9aa630
%{_initrddir}/rhnsd
9aa630
%endif
9aa630
%{_mandir}/man8/rhnsd.8*
9aa630
%doc LICENSE
9aa630
9aa630
%changelog
630c23
* Thu Oct 19 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.13-10
630c23
- Resolves: #1503955 - upstream project has migrated to github
2973af
  (tkasparek@redhat.com)
2973af
630c23
* Mon Oct 09 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.13-9
630c23
- Related: #1499793 - revert previous reboot loop changes
630c23
  (tkasparek@redhat.com)
630c23
- Resolves: #1499793 - Revert "1260527 RHEL7 rhnsd reload doesn't work"
630c23
  (tkasparek@redhat.com)
2973af
630c23
* Wed Sep 20 2017 Tomas Kasparek <tkasparek@redhat.com> 5.0.13-8
630c23
- Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com)
630c23
- Resolves: #1489989 - umask(0) does not reset to default umask
630c23
  (tkasparek@redhat.com)
630c23
- Resolves: #1475039 - close and reopen syslog when redirecting child output
630c23
  (martin.matuska@axelspringer.de)
cc76d3
baeaa7
* Mon Mar 06 2017 Gennadii Altukhov <galt@redhat.com> 5.0.13-7
baeaa7
- Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com)
baeaa7
baeaa7
* Mon Mar 06 2017 Gennadii Altukhov <galt@redhat.com> 5.0.13-6
baeaa7
- 1409562 - RHEL7 rhnsd reload doesn't work (jdostal@redhat.com)
baeaa7
- 1409562 - Reboot loop - rhn_check, rhnsd (jdostal@redhat.com)
baeaa7
04dec8
* Thu Jun 25 2015 Grant Gainey 5.0.13-5
04dec8
- Bump release to get past weirdness in brew-tags (ggainey@redhat.com)
04dec8
- Related: #1138939 - up2date and systemid files are managed by rhnsd itself,
04dec8
  no need to break init script if they do not exist (jdobes@redhat.com)
04dec8
- Related: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com)
04dec8
- Revert changes in order to clean up tagging issues with brew
04dec8
  (ggainey@redhat.com)
04dec8
- Automatic commit of package [rhnsd] minor release [5.0.13-4-el7].
04dec8
  (ggainey@redhat.com)
04dec8
- Bump release to get past weirdness in brew-tags (ggainey@redhat.com)
04dec8
- Automatic commit of package [rhnsd] minor release [5.0.13-2-el7].
04dec8
  (ggainey@redhat.com)
04dec8
- Resolves: #1138939 - up2date and systemid files are managed by rhnsd itself,
04dec8
  no need to break init script if they do not exist (jdobes@redhat.com)
04dec8
- Resolves: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com)
348633
9aa630
* Mon Jun 17 2013 Michael Mraka <michael.mraka@redhat.com> 5.0.13-1
9aa630
- removed old CVS/SVN version ids
9aa630
9aa630
* Mon Jun 17 2013 Tomas Kasparek <tkasparek@redhat.com> 5.0.12-1
9aa630
- rebranding few more strings in client stuff
9aa630
9aa630
* Tue May 21 2013 Tomas Kasparek <tkasparek@redhat.com> 5.0.11-1
9aa630
- branding clean-up of rhel client stuff
9aa630
9aa630
* Thu Apr 25 2013 Michael Mraka <michael.mraka@redhat.com> 5.0.10-1
9aa630
- let rhnsd.service be enabled after installation
9aa630
- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
9aa630
9aa630
* Fri Feb 15 2013 Milan Zazrivec <mzazrivec@redhat.com> 5.0.9-1
9aa630
- Update .po and .pot files for rhnsd.
9aa630
- New translations from Transifex for rhnsd.
9aa630
- Download translations from Transifex for rhnsd.
9aa630
9aa630
* Fri Nov 30 2012 Jan Pazdziora 5.0.8-1
9aa630
- Revert "876328 - updating rhel client tools translations"
9aa630
9aa630
* Mon Nov 19 2012 Jan Pazdziora 5.0.7-1
9aa630
- Only run chkconfig if we are in the SysV world.
9aa630
- rhnsd needs to be marked as forking.
9aa630
- When talking to systemctl, we need to say .service.
9aa630
9aa630
* Fri Nov 16 2012 Jan Pazdziora 5.0.6-1
9aa630
- 876328 - updating rhel client tools translations
9aa630
9aa630
* Sun Nov 11 2012 Michael Calmer <mc@suse.de> 5.0.5-1
9aa630
- use systemd on openSUSE >= 12.1
9aa630
- do not start rhnsd in runlevel 2 which has no network
9aa630
- no use of /var/lock/subsys/ anymore
9aa630
9aa630
* Tue Oct 30 2012 Jan Pazdziora 5.0.4-1
9aa630
- Update .po and .pot files for rhnsd.
9aa630
- New translations from Transifex for rhnsd.
9aa630
- Download translations from Transifex for rhnsd.
9aa630
9aa630
* Mon Jul 30 2012 Michael Mraka <michael.mraka@redhat.com> 5.0.3-1
9aa630
- there's no elsif macro
9aa630
9aa630
* Wed Jul 25 2012 Michael Mraka <michael.mraka@redhat.com> 5.0.2-1
9aa630
- make sure _unitdir is defined
9aa630
9aa630
* Wed Jul 25 2012 Michael Mraka <michael.mraka@redhat.com> 5.0.1-1
9aa630
- implement rhnsd.service for systemd
9aa630
9aa630
* Tue Feb 28 2012 Jan Pazdziora 4.9.15-1
9aa630
- Update .po and .pot files for rhnsd.
9aa630
- Download translations from Transifex for rhnsd.
9aa630
9aa630
* Wed Dec 21 2011 Milan Zazrivec <mzazrivec@redhat.com> 4.9.14-1
9aa630
- updated translations
9aa630
9aa630
* Fri Jul 29 2011 Tomas Lestach <tlestach@redhat.com> 4.9.13-1
9aa630
- 679054 - fix random interval part (tlestach@redhat.com)
9aa630
9aa630
* Tue Jul 19 2011 Jan Pazdziora 4.9.12-1
9aa630
- Merging Transifex changes for rhnsd.
9aa630
- New translations from Transifex for rhnsd.
9aa630
- Download translations from Transifex for rhnsd.
9aa630
9aa630
* Tue Jul 19 2011 Jan Pazdziora 4.9.11-1
9aa630
- update .po and .pot files for rhnsd
9aa630
9aa630
* Fri Apr 15 2011 Jan Pazdziora 4.9.10-1
9aa630
- changes to build rhnsd on SUSE (mc@suse.de)
9aa630
9aa630
* Fri Feb 18 2011 Jan Pazdziora 4.9.9-1
9aa630
- l10n: Updates to Estonian (et) translation (mareklaane@fedoraproject.org)
9aa630
9aa630
* Thu Jan 20 2011 Tomas Lestach <tlestach@redhat.com> 4.9.8-1
9aa630
- updating Copyright years for year 2011 (tlestach@redhat.com)
9aa630
- update .po and .pot files for rhnsd (tlestach@redhat.com)
9aa630
9aa630
* Tue Nov 02 2010 Jan Pazdziora 4.9.7-1
9aa630
- Update copyright years in the rest of the repo.
9aa630
- update .po and .pot files for rhnsd
9aa630
9aa630
* Thu Aug 12 2010 Milan Zazrivec <mzazrivec@redhat.com> 4.9.6-1
9aa630
- update .po and .pot files for rhnsd (msuchy@redhat.com)
9aa630
9aa630
* Thu Jul 01 2010 Miroslav Suchý <msuchy@redhat.com> 4.9.4-1
9aa630
- l10n: Updates to Czech (cs) translation (msuchy@fedoraproject.org)
9aa630
- cleanup - removing translation file, which does not match any language code
9aa630
  (msuchy@redhat.com)
9aa630
- update po files for rhnsd (msuchy@redhat.com)
9aa630
- generate new pot file for rhnsd (msuchy@redhat.com)
9aa630
- l10n: Updates to Polish (pl) translation (raven@fedoraproject.org)
9aa630