From 0a52de4db38e5e181bb8baed57dc5c65c21ed39d Mon Sep 17 00:00:00 2001
From: Kedar Sovani <Kedar Sovani kedars@marvell.com>
Date: Mon, 2 Feb 2009 14:36:33 +0530
Subject: [PATCH] tog-pegasus: enable builds on ARM.

LSB is not defined for ARM. Rip out that dependency.

Signed-off-by: Kedar Sovani <kedars@marvell.com>
---
 pegasus-2.7.1-arm.patch |  486 +++++++++++++++++++++++++++++++++++++++++++++++
 tog-pegasus.spec        |   29 ++-
 2 files changed, 508 insertions(+), 7 deletions(-)
 create mode 100644 pegasus-2.7.1-arm.patch

diff --git a/pegasus-2.7.1-arm.patch b/pegasus-2.7.1-arm.patch
new file mode 100644
index 0000000..7d5d3e8
--- /dev/null
+++ b/pegasus-2.7.1-arm.patch
@@ -0,0 +1,486 @@
+diff -Nurp pegasus.orig/InterfaceArchive/v002003/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h pegasus/InterfaceArchive/v002003/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h
+--- pegasus.orig/InterfaceArchive/v002003/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/InterfaceArchive/v002003/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	2009-01-31 20:09:01.000000000 -0500
+@@ -0,0 +1,74 @@
++//%2003////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
++// Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
++// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
++// IBM Corp.; EMC Corporation, The Open Group.
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to
++// deal in the Software without restriction, including without limitation the
++// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++// sell copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++// 
++// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++//==============================================================================
++//
++// Original copied from Pegasus_Platform_LINUX_PPC_GNU for Linux/ARM port
++//
++// Author: Kedar Sovani (kedars@marvell.com
++//
++//%/////////////////////////////////////////////////////////////////////////////
++
++#ifndef Pegasus_Platform_LINUX_ARM_GNU_h
++#define Pegasus_Platform_LINUX_ARM_GNU_h
++
++#include <cstddef>
++
++#define PEGASUS_OS_TYPE_UNIX
++
++#define PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++
++#define PEGASUS_OS_LINUX
++
++#define PEGASUS_ARCHITECTURE_ARM
++
++#define PEGASUS_COMPILER_GNU
++
++#define PEGASUS_UINT64 unsigned long long
++
++#define PEGASUS_SINT64 long long
++
++#define PEGASUS_HAVE_NAMESPACES
++
++#define PEGASUS_HAVE_EXPLICIT
++
++#define PEGASUS_HAVE_MUTABLE
++
++#define PEGASUS_HAVE_FOR_SCOPE
++
++// #define PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#ifndef _REENTRANT
++#define _REENTRANT
++#endif
++#define _THREAD_SAFE
++#include <features.h>
++#include <stdio.h>
++#include <stdlib.h>
++#ifndef min
++#define min(a,b) (((a)<(b))?(a):(b))
++#endif
++#endif /* Pegasus_Platform_LINUX_ARM_GNU_h */
+diff -Nurp pegasus.orig/InterfaceArchive/v002004/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h pegasus/InterfaceArchive/v002004/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h
+--- pegasus.orig/InterfaceArchive/v002004/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/InterfaceArchive/v002004/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	2009-01-31 20:10:08.000000000 -0500
+@@ -0,0 +1,77 @@
++//%2005////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
++// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
++// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation, The Open Group.
++// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
++// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++// EMC Corporation; VERITAS Software Corporation; The Open Group.
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to
++// deal in the Software without restriction, including without limitation the
++// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++// sell copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++// 
++// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++//==============================================================================
++//
++//%/////////////////////////////////////////////////////////////////////////////
++
++#ifndef Pegasus_Platform_LINUX_ARM_GNU_h
++#define Pegasus_Platform_LINUX_ARM_GNU_h
++
++#include <cstddef>
++
++#define PEGASUS_OS_TYPE_UNIX
++
++#define PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++
++#define PEGASUS_OS_LINUX
++
++#define PEGASUS_ARCHITECTURE_ARM
++
++#define PEGASUS_COMPILER_GNU
++
++#define PEGASUS_UINT64 unsigned long long
++
++#define PEGASUS_SINT64 long long
++
++#define PEGASUS_HAVE_NAMESPACES
++
++#define PEGASUS_HAVE_EXPLICIT
++
++#define PEGASUS_HAVE_MUTABLE
++
++#define PEGASUS_HAVE_FOR_SCOPE
++
++#define PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#ifndef _REENTRANT
++#define _REENTRANT
++#endif
++#define _THREAD_SAFE
++#include <features.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <sys/param.h> // For MAXHOSTNAMELEN
++
++#if defined(PEGASUS_OS_LSB) && !defined(MAXHOSTNAMELEN)
++#define PEGASUS_MAXHOSTNAMELEN 64
++#endif
++
++#endif /* Pegasus_Platform_LINUX_ARM_GNU_h */
+diff -Nurp pegasus.orig/InterfaceArchive/v002005/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h pegasus/InterfaceArchive/v002005/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h
+--- pegasus.orig/InterfaceArchive/v002005/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/InterfaceArchive/v002005/include/Pegasus/Common/Platform_LINUX_ARM_GNU.h	2009-01-31 20:09:43.000000000 -0500
+@@ -0,0 +1,83 @@
++//%2006////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
++// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
++// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation, The Open Group.
++// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
++// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++// EMC Corporation; VERITAS Software Corporation; The Open Group.
++// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++// EMC Corporation; Symantec Corporation; The Open Group.
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to
++// deal in the Software without restriction, including without limitation the
++// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++// sell copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++// 
++// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++//==============================================================================
++//
++//%/////////////////////////////////////////////////////////////////////////////
++
++#ifndef Pegasus_Platform_LINUX_ARM_GNU_h
++#define Pegasus_Platform_LINUX_ARM_GNU_h
++
++#include <cstddef>
++
++#define PEGASUS_OS_TYPE_UNIX
++
++#ifndef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++#define PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++#endif
++
++#define PEGASUS_OS_LINUX
++
++#define PEGASUS_ARCHITECTURE_ARM
++
++#define PEGASUS_COMPILER_GNU
++
++#define PEGASUS_UINT64 unsigned long long
++
++#define PEGASUS_SINT64 long long
++
++#define PEGASUS_HAVE_NAMESPACES
++
++#define PEGASUS_HAVE_EXPLICIT
++
++#define PEGASUS_HAVE_MUTABLE
++
++#define PEGASUS_HAVE_FOR_SCOPE
++
++#define PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#ifndef _REENTRANT
++#define _REENTRANT
++#endif
++#define _THREAD_SAFE
++#include <features.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <sys/param.h> // For MAXHOSTNAMELEN
++
++#if defined(PEGASUS_OS_LSB) && !defined(MAXHOSTNAMELEN)
++#define PEGASUS_MAXHOSTNAMELEN 64
++#endif
++
++#define PEGASUS_SOCKLEN_T socklen_t
++
++#endif /* Pegasus_Platform_LINUX_ARM_GNU_h */
+diff -Nurp pegasus.orig/mak/platform_LINUX_ARM_GNU.mak pegasus/mak/platform_LINUX_ARM_GNU.mak
+--- pegasus.orig/mak/platform_LINUX_ARM_GNU.mak	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/mak/platform_LINUX_ARM_GNU.mak	2009-01-31 20:05:07.000000000 -0500
+@@ -0,0 +1,36 @@
++#//%2006////////////////////////////////////////////////////////////////////////
++#//
++#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
++#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
++#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
++#// IBM Corp.; EMC Corporation, The Open Group.
++#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
++#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
++#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++#// EMC Corporation; VERITAS Software Corporation; The Open Group.
++#// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++#// EMC Corporation; Symantec Corporation; The Open Group.
++#//
++#// Permission is hereby granted, free of charge, to any person obtaining a copy
++#// of this software and associated documentation files (the "Software"), to
++#// deal in the Software without restriction, including without limitation the
++#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++#// sell copies of the Software, and to permit persons to whom the Software is
++#// furnished to do so, subject to the following conditions:
++#// 
++#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++#//
++#//==============================================================================
++# Platform Configuration for Linux on ARM
++# If you have generic Linux config options, please place them in config-linux.mak
++
++include $(ROOT)/mak/config-linux.mak
++
++ARCHITECTURE = ARM
+diff -Nurp pegasus.orig/src/Pegasus/Common/Platform_LINUX_ARM_GNU.h pegasus/src/Pegasus/Common/Platform_LINUX_ARM_GNU.h
+--- pegasus.orig/src/Pegasus/Common/Platform_LINUX_ARM_GNU.h	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/src/Pegasus/Common/Platform_LINUX_ARM_GNU.h	2009-01-31 20:10:35.000000000 -0500
+@@ -0,0 +1,93 @@
++//%2006////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
++// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
++// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation, The Open Group.
++// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
++// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
++// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++// EMC Corporation; VERITAS Software Corporation; The Open Group.
++// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++// EMC Corporation; Symantec Corporation; The Open Group.
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to
++// deal in the Software without restriction, including without limitation the
++// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++// sell copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++// 
++// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++//==============================================================================
++//
++//%/////////////////////////////////////////////////////////////////////////////
++
++#ifndef Pegasus_Platform_LINUX_ARM_GNU_h
++#define Pegasus_Platform_LINUX_ARM_GNU_h
++
++#ifdef __cplusplus
++#include <cstddef>
++#endif
++
++#define PEGASUS_OS_TYPE_UNIX
++
++#ifndef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++#define PEGASUS_PLATFORM_LINUX_GENERIC_GNU
++#endif
++
++#define PEGASUS_OS_LINUX
++
++#define PEGASUS_ARCHITECTURE_ARM
++
++#define PEGASUS_COMPILER_GNU
++
++#define PEGASUS_UINT64 unsigned long long
++
++#define PEGASUS_SINT64 long long
++
++#define PEGASUS_HAVE_NAMESPACES
++
++#define PEGASUS_HAVE_FOR_SCOPE
++
++#define PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#ifndef _REENTRANT
++#define _REENTRANT
++#endif
++#define _THREAD_SAFE
++#include <features.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <sys/param.h> // For MAXHOSTNAMELEN
++#include <limits.h>    // _POSIX_HOST_NAME_MAX 
++
++#if (__GNUC__ >= 4)
++# define PEGASUS_EXPORT __attribute__ ((visibility("default")))
++# define PEGASUS_IMPORT __attribute__ ((visibility("default")))
++# define PEGASUS_HIDDEN_LINKAGE __attribute__((visibility("hidden")))
++#endif
++
++#define PEGASUS_HAVE_PTHREADS
++
++#define PEGASUS_HAVE_NANOSLEEP
++
++#define PEGASUS_HAS_SIGNALS
++
++/* getifaddrs() avilable in gcc version > 3.4 */
++#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
++# define PEGASUS_HAS_GETIFADDRS
++#endif
++
++#endif /* Pegasus_Platform_LINUX_ARM_GNU_h */
+diff -Nurp pegasus.orig/src/SDK/samples/mak/LINUX_ARM_GNU.mak pegasus/src/SDK/samples/mak/LINUX_ARM_GNU.mak
+--- pegasus.orig/src/SDK/samples/mak/LINUX_ARM_GNU.mak	1969-12-31 19:00:00.000000000 -0500
++++ pegasus/src/SDK/samples/mak/LINUX_ARM_GNU.mak	2009-01-31 20:10:50.000000000 -0500
+@@ -0,0 +1,55 @@
++#//%2006////////////////////////////////////////////////////////////////////////
++#//
++#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
++#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
++#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
++#// IBM Corp.; EMC Corporation, The Open Group.
++#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
++#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
++#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++#// EMC Corporation; VERITAS Software Corporation; The Open Group.
++#// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
++#// EMC Corporation; Symantec Corporation; The Open Group.
++#//
++#// Permission is hereby granted, free of charge, to any person obtaining a copy
++#// of this software and associated documentation files (the "Software"), to
++#// deal in the Software without restriction, including without limitation the
++#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++#// sell copies of the Software, and to permit persons to whom the Software is
++#// furnished to do so, subject to the following conditions:
++#// 
++#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
++#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
++#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
++#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
++#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++#//
++#//==============================================================================
++
++ECHO = echo
++MKDIRHIER = mkdir -p
++RM = rm -f
++TOUCH = touch
++
++COMPILE_CXX_COMMAND = g++
++COMPILE_C_COMMAND = gcc
++LIBRARY_LINK_COMMAND = $(COMPILE_CXX_COMMAND) -shared
++PROGRAM_LINK_COMMAND = $(COMPILE_CXX_COMMAND)
++
++SYS_LIBS = -ldl -lpthread -lcrypt
++
++OBJ_SUFFIX=.o
++
++DEFINES = -DPEGASUS_PLATFORM_$(PEGASUS_PLATFORM)
++PROGRAM_COMPILE_OPTIONS = -O2 -W -Wall -Wno-unused -D_GNU_SOURCE \
++     -DTHREAD_SAFE -D_REENTRANT -fPIC
++LIBRARY_COMPILE_OPTIONS = $(PROGRAM_COMPILE_OPTIONS)
++
++PROGRAM_LINK_OPTIONS = -Xlinker -rpath -Xlinker $(PEGASUS_DEST_LIB_DIR)
++LIBRARY_LINK_OPTIONS = $(PROGRAM_LINK_OPTIONS)
++LINK_OUT = -o
++SYM_LINK_LIB = $(PEGASUS_PROVIDER_LIB_DIR)/lib$(LIBRARY)
++PLATFORM_LIB_SUFFIX = so
+--- pegasus.orig/InterfaceArchive/v002004/include/Pegasus/Common/Config.h	2006-06-16 14:51:25.000000000 -0400
++++ pegasus/InterfaceArchive/v002004/include/Pegasus/Common/Config.h	2009-01-31 22:52:51.000000000 -0500
+@@ -56,6 +56,8 @@
+ # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
++#elif defined (PEGASUS_PLATFORM_LINUX_ARM_GNU)
++# include <Pegasus/Common/Platform_LINUX_ARM_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
+--- pegasus.orig/InterfaceArchive/v002005/include/Pegasus/Common/Config.h	2006-06-16 14:51:27.000000000 -0400
++++ pegasus/InterfaceArchive/v002005/include/Pegasus/Common/Config.h	2009-01-31 22:53:49.000000000 -0500
+@@ -62,6 +62,8 @@
+ # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
++#elif defined (PEGASUS_PLATFORM_LINUX_ARM_GNU)
++# include <Pegasus/Common/Platform_LINUX_ARM_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
+--- pegasus.orig/InterfaceArchive/v002003/include/Pegasus/Common/Config.h	2006-06-16 14:51:22.000000000 -0400
++++ pegasus/InterfaceArchive/v002003/include/Pegasus/Common/Config.h	2009-01-31 22:54:05.000000000 -0500
+@@ -60,6 +60,8 @@
+ # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
++#elif defined (PEGASUS_PLATFORM_LINUX_ARM_GNU)
++# include <Pegasus/Common/Platform_LINUX_ARM_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
+ # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
+ #elif defined (__OS400__)
+--- pegasus.orig/src/Pegasus/Common/Config.h	2007-08-02 20:37:57.000000000 -0400
++++ pegasus/src/Pegasus/Common/Config.h	2009-01-31 22:49:42.000000000 -0500
+@@ -68,6 +68,8 @@
+ # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
++#elif defined (PEGASUS_PLATFORM_LINUX_ARM_GNU)
++# include <Pegasus/Common/Platform_LINUX_ARM_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
+ # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
diff --git a/tog-pegasus.spec b/tog-pegasus.spec
index 60aec68..9138088 100644
--- a/tog-pegasus.spec
+++ b/tog-pegasus.spec
@@ -40,10 +40,14 @@
 %endif
 %endif
 
+%ifnarch %{arm}
+%define rhlsbdeps redhat-lsb
+%endif
+
 %define _default_patch_fuzz 2
 
 Version: 		2.7.1
-Release: 		2%{?dist}
+Release: 		2%{?dist}.fa1
 Epoch:   		2
 #
 Summary:   		OpenPegasus WBEM Services for Linux
@@ -83,6 +87,8 @@ Patch12:		pegasus-2.7.0-no_snmp_tests.patch
 Patch13:		pegasus-2.7.1-bz454589.patch
 Patch14:		pegasus-2.7.1-bz454590.patch
 Patch15:		pegasus-2.7.1-bz454591.patch
+Patch16:		pegasus-2.7.1-arm.patch
+
 #
 Conflicts: 		openwbem
 Provides: 		tog-pegasus-cimserver
@@ -92,16 +98,16 @@ BuildRequires:      	imake, libstdc++, make, pam-devel
 BuildRequires:      	openssl-devel >= 0.9.8b, e2fsprogs
 BuildRequires:		net-snmp-devel
 Requires:           	bash, sed, grep, coreutils, procps, openssl >= 0.9.8b, pam
-Requires:          	redhat-lsb, chkconfig, sysvinit
+Requires:          	%{?rhlsbdeps}, chkconfig, sysvinit
 Requires:           	e2fsprogs, bind-utils, net-tools
 Requires(post):     	bash, sed, grep, coreutils, procps, openssl >= 0.9.8b, pam
-Requires(post):    	redhat-lsb, chkconfig, sysvinit
+Requires(post):    	%{?rhlsbdeps}, chkconfig, sysvinit
 Requires(post):     	e2fsprogs, bind-utils, net-tools
 Requires(pre):      	bash, sed, grep, coreutils, procps, openssl >= 0.9.8b, pam
-Requires(pre):     	redhat-lsb, chkconfig, sysvinit
+Requires(pre):     	%{?rhlsbdeps}, chkconfig, sysvinit
 Requires(pre):      	e2fsprogs, bind-utils, net-tools
 Requires(postun):   	bash, sed, grep, coreutils, procps, openssl >= 0.9.8b, pam
-Requires(postun):  	redhat-lsb, chkconfig, sysvinit
+Requires(postun):  	%{?rhlsbdeps}, chkconfig, sysvinit
 Requires(postun):   	e2fsprogs, bind-utils, net-tools
 Requires:		net-snmp
 
@@ -153,6 +159,7 @@ The OpenPegasus WBEM tests for the OpenPegasus %{version} Linux rpm.
 %patch13 -p1 -b .bz454589
 %patch14 -p1 -b .bz454590
 %patch15 -p1 -b .bz454591
+%patch16 -p1 -b .arm
 find . -name 'CVS' -exec /bin/rm -rf '{}' ';' >/dev/null 2>&1 ||:;
 
 %build
@@ -184,7 +191,11 @@ export RPM_OPT_FLAGS=`rpm -q rpm --qf '%{OPTFLAGS}'`
           %ifarch s390x
             export PEGASUS_PLATFORM=LINUX_ZSERIES64_GNU
           %else
-            export PEGASUS_PLATFORM=LINUX_IX86_GNU
+	    %ifarch %{arm}
+	      export PEGASUS_PLATFORM=LINUX_ARM_GNU
+	    %else
+	       export PEGASUS_PLATFORM=LINUX_IX86_GNU
+	    %endif
           %endif
         %endif
       %endif
@@ -239,7 +250,11 @@ export RPM_OPT_FLAGS=`rpm -q rpm --qf '%{OPTFLAGS}'`
           %ifarch s390x
             export PEGASUS_PLATFORM=LINUX_ZSERIES64_GNU
           %else
-            export PEGASUS_PLATFORM=LINUX_IX86_GNU
+            %ifarch %{arm}
+	      export PEGASUS_PLATFORM=LINUX_ARM_GNU
+	    %else
+              export PEGASUS_PLATFORM=LINUX_IX86_GNU
+	    %endif
           %endif
         %endif
       %endif
-- 
1.5.3.3

