From ace2880d3c0c046baeb6c2c72be147956afe3d5b Mon Sep 17 00:00:00 2001
From: Kedar Sovani <kedars@marvell.com>
Date: Thu, 18 Jun 2009 07:10:50 +0200
Subject: [PATCH] setools: disable java for ARM.

Signed-off-by: Kedar Sovani <kedars@marvell.com>
---
 setools.spec |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/setools.spec b/setools.spec
index 1a02391..383e24d 100644
--- a/setools.spec
+++ b/setools.spec
@@ -3,9 +3,14 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
+%define build_java 1
+%ifarch %{arm}
+%define build_java 0
+%endif
+
 Name: setools
 Version: %{setools_maj_ver}.%{setools_min_ver}
-Release: 8%{?dist}
+Release: 8%{?dist}.fa1
 License: GPLv2
 URL: http://oss.tresys.com/projects/setools
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -81,6 +86,8 @@ This package includes Python bindings for the following libraries:
   libseaudit    parse and filter SELinux audit messages in log files
   libsefs       SELinux file contexts library
 
+%if %{build_java}
+%define javaopts --enable-swig-java --with-java-prefix=/usr/lib/jvm/java
 %package libs-java
 License: LGPLv2
 Summary: Java bindings for SELinux policy analysis
@@ -99,6 +106,7 @@ This package includes Java bindings for the following libraries:
   libqpol       library that abstracts policy internals
   libseaudit    parse and filter SELinux audit messages in log files
   libsefs       SELinux file contexts library
+%endif
 
 %package libs-tcl
 License: LGPLv2
@@ -188,7 +196,7 @@ This package includes the following graphical tools:
 
 %build
 %configure --libdir=%{_libdir} --disable-bwidget-check --disable-selinux-check \
-    --enable-swig-python --enable-swig-java --enable-swig-tcl --with-java-prefix=/usr/lib/jvm/java
+    --enable-swig-python --enable-swig-tcl {?javaopts} 
 # work around issue with gcc 4.3 + gnu99 + swig-generated code:
 sed -i -e 's:$(CC):gcc -std=gnu89:' libseaudit/swig/python/Makefile
 %ifarch sparc sparcv9 sparc64 s390 s390x                                                                                                
@@ -213,12 +221,14 @@ install -p -m 644 seaudit/seaudit.png ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/seaud
 install -p -m 644 sediff/sediffx.png ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/sediffx.png
 desktop-file-install --dir ${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE2} %{SOURCE3} %{SOURCE4}
 ln -sf consolehelper ${RPM_BUILD_ROOT}/%{_bindir}/seaudit
+%if %{build_java}
 # replace absolute symlinks with relative symlinks
 ln -sf ../setools-%{setools_maj_ver}/qpol.jar ${RPM_BUILD_ROOT}/%{javajardir}/qpol.jar
 ln -sf ../setools-%{setools_maj_ver}/apol.jar ${RPM_BUILD_ROOT}/%{javajardir}/apol.jar
 ln -sf ../setools-%{setools_maj_ver}/poldiff.jar ${RPM_BUILD_ROOT}/%{javajardir}/poldiff.jar
 ln -sf ../setools-%{setools_maj_ver}/seaudit.jar ${RPM_BUILD_ROOT}/%{javajardir}/seaudit.jar
 ln -sf ../setools-%{setools_maj_ver}/sefs.jar ${RPM_BUILD_ROOT}/%{javajardir}/sefs.jar
+%endif
 # remove static libs
 rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a
 # ensure permissions are correct
@@ -251,6 +261,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %{pkg_py_arch}/
 %endif
 
+%if %{build_java}
 %files libs-java
 %defattr(-,root,root,-)
 %{_libdir}/libjqpol.so.*
@@ -260,6 +271,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_libdir}/libjsefs.so.*
 %{setoolsdir}/*.jar
 %{javajardir}/*.jar
+%endif
 
 %files libs-tcl
 %defattr(-,root,root,-)
@@ -335,15 +347,20 @@ rm -rf ${RPM_BUILD_ROOT}
 
 %postun libs -p /sbin/ldconfig
 
+%if %{build_java}
 %post libs-java -p /sbin/ldconfig
 
 %postun libs-java -p /sbin/ldconfig
+%endif
 
 %post libs-tcl -p /sbin/ldconfig
 
 %postun libs-tcl -p /sbin/ldconfig
 
 %changelog
+* Thu Jun 18 2009 Kedar Sovani <kedars@marvell.com> 3.3.5-8.fa1
+- disable java for ARM.
+
 * Sun Apr  5 2009 Dan Horák <dan[at]danny.cz> - 3.3.5-8
 - don't expect that java-devel resolves as gcj
 
-- 
1.5.5.6

