packages: tzdata/tzdata.spec, tzdata/javazic-fixup.patch (NEW) - java subpa...

glen glen at pld-linux.org
Tue Sep 14 23:33:26 CEST 2010


Author: glen                         Date: Tue Sep 14 21:33:26 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- java subpackage adopted from fc (disabled as needs testing and stuff)

---- Files affected:
packages/tzdata:
   tzdata.spec (1.85 -> 1.86) , javazic-fixup.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/tzdata/tzdata.spec
diff -u packages/tzdata/tzdata.spec:1.85 packages/tzdata/tzdata.spec:1.86
--- packages/tzdata/tzdata.spec:1.85	Sun May 23 20:28:39 2010
+++ packages/tzdata/tzdata.spec	Tue Sep 14 23:33:20 2010
@@ -1,8 +1,9 @@
 # $Revision$, $Date$
 #
 # Conditional build
-%bcond_without	tests			# make check
-#
+%bcond_without	tests		# make check
+%bcond_with		java		# build java subpackage
+
 %define		tzcode_ver	2010j
 %define		tzdata_ver	2010j
 Summary:	Timezone data
@@ -20,7 +21,10 @@
 # Source2-md5:	5ba8345720296d3a659b349b2052d139
 Source3:	timezone.init
 Source4:	timezone.sysconfig
+Source5:	javazic.tar.gz
+# Source5-md5:	6a3392cd5f1594d13c12c1a836ac8d91
 Patch0:		%{name}-test-update.patch
+Patch1:		javazic-fixup.patch
 URL:		http://www.twinsun.com/tz/tz-link.htm
 BuildRequires:	rpmbuild(macros) >= 1.228
 Requires(post,preun):	/sbin/chkconfig
@@ -37,6 +41,13 @@
 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
 całym świecie.
 
+%package java
+Summary:	Timezone data for Java
+Group:		Base
+
+%description java
+This package contains timezone information for use by Java runtimes.
+
 %package zoneinfo_right
 Summary:	Non-POSIX (real) time zones
 Summary(es.UTF-8):	Zonas de tiempo reales (no de POSIX)
@@ -83,9 +94,41 @@
 
 grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
 
+%if %{with java}
+install -d javazic
+tar zxf %{SOURCE5} -C javazic
+cd javazic
+%patch1
+
+# Hack alert! sun.tools may be defined and installed in the
+# VM. In order to guarantee that we are using IcedTea/OpenJDK
+# for creating the zoneinfo files, rebase all the packages
+# from "sun." to "rht.". Unfortunately, gcj does not support
+# any of the -Xclasspath options, so we must go this route
+# to ensure the greatest compatibility.
+# XXX: do we want 'pld' instead of 'rht'?
+mv sun rht
+find . -type f -name '*.java' -print0 \
+	| xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
+						 -e 's:sun\.util\.:rht.util.:g'
+cd -
+%endif
+
 %build
 %{__make}
 
+%if %{with java}
+cd javazic
+%javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
+cd ../tzdata
+%java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
+	-d ../zoneinfo/java \
+	africa antarctica asia australasia europe northamerica pacificnew \
+	southamerica backward etcetera solar87 solar88 solar89 systemv \
+	../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
+cd ..
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
@@ -102,7 +145,6 @@
 : ====================TESTING END=====================
 %endif
 
-
 # glibc.spec didn't keep it. so won't here either.
 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
 # behave more like glibc.spec
@@ -119,6 +161,10 @@
 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
 
+%if %{with java}
+cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -169,6 +215,12 @@
 %{_datadir}/zoneinfo
 %exclude %{_datadir}/zoneinfo/right
 
+%if %{with java}
+%files java
+%defattr(644,root,root,755)
+%{_datadir}/javazi
+%endif
+
 %files zoneinfo_right
 %defattr(644,root,root,755)
 %{_datadir}/zoneinfo/right
@@ -185,6 +237,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.86  2010/09/14 21:33:20  glen
+- java subpackage adopted from fc (disabled as needs testing and stuff)
+
 Revision 1.85  2010/05/23 18:28:39  arekm
 - up to 2010j
 

================================================================
Index: packages/tzdata/javazic-fixup.patch
diff -u /dev/null packages/tzdata/javazic-fixup.patch:1.1
--- /dev/null	Tue Sep 14 23:33:26 2010
+++ packages/tzdata/javazic-fixup.patch	Tue Sep 14 23:33:20 2010
@@ -0,0 +1,34 @@
+--- sun/util/calendar/LocalGregorianCalendar.java.keiths	2007-09-07 14:48:19.000000000 -0700
++++ sun/util/calendar/LocalGregorianCalendar.java	2007-09-07 14:52:58.000000000 -0700
+@@ -120,8 +120,7 @@ public class LocalGregorianCalendar exte
+     static LocalGregorianCalendar getLocalGregorianCalendar(String name) {
+ 	Properties calendarProps = null;
+ 	try {
+-	    String homeDir = (String) AccessController.doPrivileged(
+-				new sun.security.action.GetPropertyAction("java.home"));
++  	    String homeDir = (String) System.getProperty("java.home");
+ 	    final String fname = homeDir + File.separator + "lib" + File.separator
+ 				 + "calendars.properties";
+ 	    calendarProps = (Properties) AccessController.doPrivileged(new PrivilegedExceptionAction() {
+--- sun/util/calendar/ZoneInfoFile.java.keiths	2007-09-07 14:54:58.000000000 -0700
++++ sun/util/calendar/ZoneInfoFile.java	2007-09-07 14:55:36.000000000 -0700
+@@ -1021,8 +1021,7 @@ public class ZoneInfoFile {
+ 	byte[] buffer = null;
+ 
+ 	try {
+-	    String zi_dir = (String) AccessController.doPrivileged(
+-			        new sun.security.action.GetPropertyAction("user.zoneinfo.dir"));
++	    String zi_dir = (String) System.getProperty("user.zoneinfo.dir");
+ 	    File dir = null;
+ 	    if (zi_dir != null)
+ 	      dir = new File(zi_dir);
+@@ -1035,8 +1034,7 @@ public class ZoneInfoFile {
+ 	    }
+ 
+ 	    if (dir == null) {
+-	      String homeDir = (String) AccessController.doPrivileged(
+-				new sun.security.action.GetPropertyAction("java.home"));
++	      String homeDir = (String) System.getProperty("java.home");
+ 	      zi_dir = homeDir + File.separator + "lib" + File.separator
+ 		+ "zi";
+ 	    }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/tzdata/tzdata.spec?r1=1.85&r2=1.86&f=u



More information about the pld-cvs-commit mailing list