packages: rpm-build-macros/rpm.macros - allow using %use_jdk macro to chang...

jajcus jajcus at pld-linux.org
Sun Apr 18 19:55:28 CEST 2010


Author: jajcus                       Date: Sun Apr 18 17:55:28 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- allow using %use_jdk macro to change JDK used for build

---- Files affected:
packages/rpm-build-macros:
   rpm.macros (1.555 -> 1.556) 

---- Diffs:

================================================================
Index: packages/rpm-build-macros/rpm.macros
diff -u packages/rpm-build-macros/rpm.macros:1.555 packages/rpm-build-macros/rpm.macros:1.556
--- packages/rpm-build-macros/rpm.macros:1.555	Thu Apr 15 00:44:59 2010
+++ packages/rpm-build-macros/rpm.macros	Sun Apr 18 19:55:22 2010
@@ -1205,13 +1205,25 @@
 # Directory where arch-specific (JNI) version-independent jars are installed.
 %_jnidir		%{_libdir}/java
 
-%java_home		%{expand:%%global java_home %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; unset JAVA_HOME; . %{_javadir}-utils/java-functions; set_jvm; echo ${JAVA_HOME:-ERROR})}%java_home
+
+# JDK selection. Set this to name of the JDK implementation to use
+# insead of the system default
+#%use_jdk		icedtea6
+
+# expands to the value with right jdk for BuildRequires header
+# 'jdk' if %%use_jdk is not defined,  jdk(%%use_jdk) otherwise
+# The requirement will not replace current 'default' JDK
+%required_jdk	jdk%{?use_jdk:(%{use_jdk})}
+
+%buildrequires_jdk BuildRequires: %required_jdk
+
+%java_home		%{expand:%%global java_home %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; %{!?use_jdk:unset JAVA_HOME; . %{_javadir}-utils/java-functions; set_jvm}%{?use_jdk:JAVA_HOME=%{_jvmdir}/%{use_jdk}}; echo ${JAVA_HOME:-ERROR})}%java_home
 
 %_javasrcdir	%{_usrsrc}/java
 
 %ant			JAVA_HOME=%{java_home} CLASSPATH=$CLASSPATH ant
 %jar			%{java_home}/bin/jar
-%java			%{expand:%%global java %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; unset JAVACMD; . %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)}%java
+%java			%{expand:%%global java %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; %{!?use_jdk:unset JAVACMD; . %{_javadir}-utils/java-functions; set_javacmd}%{?use_jdk:JAVACMD=%{java_home}/bin/java}; echo $JAVACMD)}%java
 %javac			%{java_home}/bin/javac
 %javadoc		%{java_home}/bin/javadoc
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-macros/rpm.macros?r1=1.555&r2=1.556&f=u



More information about the pld-cvs-commit mailing list