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