Hi,
here is the patch to build and run osad on openSUSE.
0006-build-osad-on-SUSE.patch:
- specfile work
- add init script for SUSE
- osad.py missed and import of the config module
--
Regards,
Michael Calmer
--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575 - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 17423372daefefabeb43a68b921dd665196adc86 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 15:17:06 +0200
Subject: [PATCH 06/17] build osad on SUSE
- modify specfile
- add init script for SUSE
---
client/tools/osad/osad.spec | 57 +++--
client/tools/osad/prog.init.SUSE | 75 ++
client/tools/osad/src/osad.py|1 +
3 files changed, 129 insertions(+), 4 deletions(-)
create mode 100755 client/tools/osad/prog.init.SUSE
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 80cb6ab..285d30e 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -3,6 +3,14 @@
%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
+%define include_selinux_package 0
+%else
+%define apache_group apache
+%define include_selinux_package 1
+%endif
+
Name: osad
Summary: Open Source Architecture Daemon
Group: System Environment/Daemons
@@ -17,22 +25,32 @@ BuildRequires: python-devel
Requires: python
Requires: rhnlib = 2.5.38
Requires: jabberpy
-%if 0%{?rhel} = 5
+%if 0%{?rhel} 0%{?rhel} = 5
Requires: python-hashlib
%endif
# This should have been required by rhnlib
+%if 0%{?suse_version} = 1140
+Requires: python-xml
+%else
Requires: PyXML
+%endif
%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
# This is for /sbin/service
Requires(preun): initscripts
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+BuildRequires: sysconfig syslog
+%endif
-%description
+%description
OSAD agent receives commands over jabber protocol from Spacewalk Server and
commands are instantly executed.
@@ -47,16 +65,24 @@ Requires: jabberpy
Requires: lsof
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
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+Requires: logrotate
+BuildRequires: sysconfig
+%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%{?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)
@@ -83,13 +109,18 @@ Requires: osa-dispatcher
%description -n osa-dispatcher-selinux
SELinux policy module supporting osa-dispatcher.
+%endif
%prep
%setup -q
+%if 0%{?suse_version}
+cp prog.init.SUSE prog.init
+%endif
%build
make -f Makefile.osad all
+%if 0%{?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
@@ -97,12 +128,14 @@ do
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}
+make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot} INITDIR=%{_initrddir}
+%if 0%{?include_selinux_package}
for selinuxvariant in %{selinux_variants}
do
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
@@ -121,6 +154,7 @@ install -p -m 644 osa-dispatcher-selinux/%{modulename}.if \
# 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
%clean
rm -rf $RPM_BUILD_ROOT
@@ -147,6