Search
j0ke.net Open Build Service
>
Projects
>
SUSE
:
Manager
:
1.2
>
osad
> osad.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File osad.spec of Package osad
# # spec file for package osad # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define rhnroot /usr/share/rhn %define rhnconf /etc/sysconfig/rhn %define client_caps_dir /etc/sysconfig/rhn/clientCaps.d %{!?pythongen:%define pythongen %(%{__python} -c "import sys ; print sys.version[:3]")} %if 0%{?suse_version} %define apache_group www %else %define apache_group apache %endif Name: osad Summary: Open Source Architecture Daemon Group: System Environment/Daemons License: GPL v2 only Url: https://fedorahosted.org/spacewalk Source0: osad-git-f5bf811b87bd1edc69ba40f3190a3674285036f9.tar.gz Version: 5.9.44 Release: 0.8.1 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch BuildRequires: -post-build-checks BuildRequires: python-devel Requires: python Requires: rhnlib >= 1.8-3 %if 0%{?suse_version} == 0 && 0%{?rhel} <= 5 Requires: python-hashlib %endif # This should have been required by rhnlib Requires: PyXML %if "%{pythongen}" == "1.5" Requires: python-iconv %endif Conflicts: osa-dispatcher < %{version}-%{release} Conflicts: osa-dispatcher > %{version}-%{release} %if !0%{?suse_version} Requires(post): chkconfig Requires(preun): chkconfig Requires: jabberpy # This is for /sbin/service Requires(preun): initscripts %else Requires: python-jabberpy Requires(preun): %fillup_prereq %insserv_prereq %endif %description OSAD agent receives commands over jabber protocol from Spacewalk Server and commands are instantly executed. This package effectively replaces the behaviour of rhnsd/rhn_check that only poll the Spacewalk Server from time to time. %package -n osa-dispatcher License: GPL v2 only Summary: OSA dispatcher Group: System Environment/Daemons Requires: spacewalk-backend-server >= 1.2.32 Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} > %{version}-%{release} %if !0%{?suse_version} Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts Requires: jabberpy %else Requires: python-jabberpy logrotate Requires(preun): %fillup_prereq %insserv_prereq %endif %description -n osa-dispatcher OSA dispatcher is supposed to run on the Spacewalk server. It gets information from the Spacewalk server that some command needs to be execute on the client; that message is transported via jabber protocol to OSAD agent on the clients. %if 0%{?rhel} && 0%{?rhel} <= 4 %define include_selinux_package 0 %else %if 0%{?suse_version} %define include_selinux_package 0 %else %define include_selinux_package 1 %endif %endif %if %{include_selinux_package} %package -n osa-dispatcher-selinux %define selinux_variants mls strict targeted %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2> /dev/null) %define POLICYCOREUTILSVER 1.33.12-1 %define moduletype apps %define modulename osa-dispatcher Summary: SELinux policy module supporting osa-dispatcher Group: System Environment/Base BuildRequires: checkpolicy hardlink selinux-policy-devel BuildRequires: policycoreutils >= %{POLICYCOREUTILSVER} Requires: spacewalk-selinux %if "%{selinux_policyver}" != "" Requires: selinux-policy >= %{selinux_policyver} %endif %if 0%{?rhel} == 5 Requires: selinux-policy >= 2.4.6-114 %endif Requires(post): /usr/sbin/semodule, /sbin/restorecon, /usr/sbin/selinuxenabled, /usr/sbin/semanage Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /usr/sbin/semanage, spacewalk-selinux Requires: osa-dispatcher %description -n osa-dispatcher-selinux SELinux policy module supporting osa-dispatcher. %endif %prep %setup -q -n osad-git-f5bf811b87bd1edc69ba40f3190a3674285036f9 %if 0%{?suse_version} > 0 cp prog.init.SUSE prog.init %endif %build make -f Makefile.osad all %if %{include_selinux_package} %{__perl} -i -pe 'BEGIN { $VER = join ".", grep /^\d+$/, split /\./, "%{version}.%{release}"; } s!\@\@VERSION\@\@!$VER!g;' osa-dispatcher-selinux/%{modulename}.te for selinuxvariant in %{selinux_variants} do make -C osa-dispatcher-selinux NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile mv osa-dispatcher-selinux/%{modulename}.pp osa-dispatcher-selinux/%{modulename}.pp.${selinuxvariant} make -C osa-dispatcher-selinux NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean done %endif %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{rhnroot} make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot} %if %{include_selinux_package} for selinuxvariant in %{selinux_variants} do install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} install -p -m 644 osa-dispatcher-selinux/%{modulename}.pp.${selinuxvariant} \ %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp done # Install SELinux interfaces install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype} install -p -m 644 osa-dispatcher-selinux/%{modulename}.if \ %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if # Hardlink identical policy module packages together /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux # Install osa-dispatcher-selinux-enable which will be called in %post install -d %{buildroot}%{_sbindir} install -p -m 755 osa-dispatcher-selinux/osa-dispatcher-selinux-enable %{buildroot}%{_sbindir}/osa-dispatcher-selinux-enable %endif %if 0%{?suse_version} %define _sysconfdir /etc %define _initrddir %{_sysconfdir}/init.d mv %{buildroot}%{_sysconfdir}/rc.d/init.d %{buildroot}%{_initrddir} %endif # add rclinks ln -sf ../../etc/init.d/osad %{buildroot}%{_sbindir}/rcosad ln -sf ../../etc/init.d/osa-dispatcher %{buildroot}%{_sbindir}/rcosa-dispatcher %clean rm -rf $RPM_BUILD_ROOT %if 0%{?suse_version} %preun %stop_on_removal osad %post %{fillup_and_insserv osad} %postun %restart_on_update osad %{insserv_cleanup} %preun -n osa-dispatcher %stop_on_removal osa-dispatcher %post -n osa-dispatcher %{fillup_and_insserv osa-dispatcher} %postun -n osa-dispatcher %restart_on_update osa-dispatcher %{insserv_cleanup} %else %post if [ -f %{_sysconfdir}/init.d/osad ]; then /sbin/chkconfig --add osad fi %preun if [ $1 = 0 ]; then /sbin/service osad stop > /dev/null 2>&1 /sbin/chkconfig --del osad fi %post -n osa-dispatcher if [ -f %{_sysconfdir}/init.d/osa-dispatcher ]; then /sbin/chkconfig --add osa-dispatcher fi %preun -n osa-dispatcher if [ $1 = 0 ]; then /sbin/service osa-dispatcher stop > /dev/null 2>&1 /sbin/chkconfig --del osa-dispatcher fi %if %{include_selinux_package} %post -n osa-dispatcher-selinux if /usr/sbin/selinuxenabled ; then %{_sbindir}/osa-dispatcher-selinux-enable fi %posttrans -n osa-dispatcher-selinux #this may be safely remove when BZ 505066 is fixed if /usr/sbin/selinuxenabled ; then rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {} /sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log fi %postun -n osa-dispatcher-selinux # Clean up after package removal if [ $1 -eq 0 ]; then /usr/sbin/semanage port -ln \ | perl '-F/,?\s+/' -ane 'print map "$_\n", @F if shift @F eq "osa_dispatcher_upstream_notif_server_port_t" and shift @F eq "tcp"' \ | while read port ; do \ /usr/sbin/semanage port -d -t osa_dispatcher_upstream_notif_server_port_t -p tcp $port || : done for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -l > /dev/null 2>&1 \ && /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} || : done fi rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {} /sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log %endif %endif %files %defattr(-,root,root) %dir %{rhnroot} %dir %{rhnroot}/osad %dir %{_sysconfdir}/sysconfig/rhn %if 0%{?suse_version} %dir %{_sysconfdir}/sysconfig/rhn/clientCaps.d %endif %attr(755,root,root) %{_sbindir}/osad %{_sbindir}/rcosad %{rhnroot}/osad/__init__.py* %{rhnroot}/osad/_ConfigParser.py* %{rhnroot}/osad/jabber_lib.py* %{rhnroot}/osad/osad.py* %{rhnroot}/osad/osad_client.py* %{rhnroot}/osad/osad_config.py* %{rhnroot}/osad/rhn_log.py* %config(noreplace) %{_sysconfdir}/sysconfig/rhn/osad.conf %config(noreplace) %attr(600,root,root) %{_sysconfdir}/sysconfig/rhn/osad-auth.conf %config(noreplace) %{client_caps_dir}/* %attr(755,root,root) %{_initrddir}/osad %doc LICENSE %doc PYTHON-LICENSES.txt %files -n osa-dispatcher %defattr(-,root,root) %dir %{rhnroot}/osad %attr(755,root,root) %{_sbindir}/osa-dispatcher %{_sbindir}/rcosa-dispatcher %{rhnroot}/osad/__init__.py* %{rhnroot}/osad/jabber_lib.py* %{rhnroot}/osad/osa_dispatcher.py* %{rhnroot}/osad/dispatcher_client.py* %{rhnroot}/osad/rhn_log.py* %config(noreplace) %{_sysconfdir}/sysconfig/osa-dispatcher %config(noreplace) %{_sysconfdir}/logrotate.d/osa-dispatcher %config %{_sysconfdir}/rhn/default/rhn_osa-dispatcher.conf %if 0%{?suse_version} %dir %{_sysconfdir}/rhn %dir %{_sysconfdir}/rhn/tns_admin %dir %{_sysconfdir}/rhn/default %attr(770,root,%{apache_group}) %dir %{_var}/log/rhn %endif %config %{_sysconfdir}/rhn/tns_admin/osa-dispatcher %config(noreplace) %{_sysconfdir}/rhn/tns_admin/osa-dispatcher/sqlnet.ora %attr(755,root,root) %{_initrddir}/osa-dispatcher %attr(770,root,%{apache_group}) %dir %{_var}/log/rhn/oracle %attr(770,root,root) %dir %{_var}/log/rhn/oracle/osa-dispatcher %doc LICENSE %doc PYTHON-LICENSES.txt %if %{include_selinux_package} %files -n osa-dispatcher-selinux %defattr(-,root,root,0755) %doc osa-dispatcher-selinux/%{modulename}.fc %doc osa-dispatcher-selinux/%{modulename}.if %doc osa-dispatcher-selinux/%{modulename}.te %{_datadir}/selinux/*/%{modulename}.pp %{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if %doc LICENSE %doc PYTHON-LICENSES.txt %attr(0755,root,root) %{_sbindir}/osa-dispatcher-selinux-enable %endif # $Id$ %changelog * Mon Feb 7 2011 mc@suse.de - add rc links (bnc#669894) * Wed Feb 2 2011 mc@suse.de - fix build on RH4 * Sun Jan 30 2011 mc@suse.de - backport upstrem fixes * Sat Jan 22 2011 mc@suse.de - fix macros * Thu Sep 16 2010 mantel@suse.de - fix missing prog.init.SUSE * Wed Sep 15 2010 mantel@suse.de - cleanup specfile: remove excessive *init.SUSE Source statement * Wed Sep 15 2010 mantel@suse.de - fix post-build-checks * Tue Sep 14 2010 mantel@suse.de - Initial release of osad