SPECS (AC-branch): java-sun.spec - RPATH fix merge from HEAD; rel 6

glen glen at pld-linux.org
Wed Feb 28 02:11:12 CET 2007


Author: glen                         Date: Wed Feb 28 01:11:12 2007 GMT
Module: SPECS                         Tag: AC-branch
---- Log message:
- RPATH fix merge from HEAD; rel 6

---- Files affected:
SPECS:
   java-sun.spec (1.172 -> 1.172.2.1) 

---- Diffs:

================================================================
Index: SPECS/java-sun.spec
diff -u SPECS/java-sun.spec:1.172 SPECS/java-sun.spec:1.172.2.1
--- SPECS/java-sun.spec:1.172	Tue Jan 30 13:18:15 2007
+++ SPECS/java-sun.spec	Wed Feb 28 02:11:07 2007
@@ -9,7 +9,7 @@
 Summary(pl):	Sun JDK - środowisko programistyczne Javy dla Linuksa
 Name:		java-sun
 Version:	1.6.0
-Release:	5
+Release:	6
 License:	restricted, distributable
 Group:		Development/Languages/Java
 Source0:	http://download.java.net/dlj/binaries/jdk-%{_src_ver}-dlj-linux-i586.bin
@@ -315,7 +315,7 @@
 %endif
 
 # make sure all tools are available under $(JDK_HOME)/bin
-for i in ControlPanel keytool kinit klist orbd policytool rmid \
+for i in ControlPanel keytool orbd policytool rmid \
 		rmiregistry servertool tnameserv pack200 unpack200 java javaws; do
 	ln -sf ../jre/bin/$i $RPM_BUILD_ROOT%{javadir}/bin/$i
 done
@@ -374,6 +374,48 @@
 ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_jvmjardir}/jre
 ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_jvmjardir}/jsse
 
+# modify RPATH so that javac and friends are able to work when /proc is not
+# mounted and we can't append to RPATH (for example to keep previous lookup
+# path) as RPATH can't be longer than original
+#
+# for example:
+# old javac: RPATH=$ORIGIN/../lib/i386/jli:$ORIGIN/../jre/lib/i386/jli
+# new javac: RPATH=/usr/lib/jvm/java-sun-1.6.0/jre/lib/i386/jli
+
+# silly rpath: jre/bin/unpack200: RPATH=$ORIGIN
+chrpath -d $RPM_BUILD_ROOT%{jredir}/bin/unpack200
+
+fixrpath() {
+	execlist=$(find $RPM_BUILD_ROOT%{javadir} -type f -perm +1 | xargs file | awk -F: '/ELF.*executable/{print $1}')
+	for f in $execlist; do
+		rpath=$(chrpath -l $f | awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }')
+		[ "$rpath" ] || continue
+
+		# file
+		file=${f#$RPM_BUILD_ROOT}
+		origin=${file%/*}
+
+		new=
+		for a in $rpath; do
+			t=$(echo $a | sed -e "s,\$ORIGIN,$origin,g")
+			# get rid of ../../
+			t=$(set -e; t=$RPM_BUILD_ROOT$t; [ -d $t ] || exit 0; cd $t; pwd)
+			# skip inexistent paths
+			[ "$t" ] || continue
+
+			t=${t#$RPM_BUILD_ROOT}
+
+			if [[ "$new" != *$t* ]]; then
+				# append it now
+				new=${new}${new:+:}$t
+			fi
+		done
+		chrpath -r ${new} $f
+	done
+}
+
+fixrpath
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -775,6 +817,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.172.2.1  2007/02/28 01:11:07  glen
+- RPATH fix merge from HEAD; rel 6
+
 Revision 1.172  2007/01/30 12:18:15  glen
 - fix broken apt symlink; rel 5
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/java-sun.spec?r1=1.172&r2=1.172.2.1&f=u



More information about the pld-cvs-commit mailing list