rpms/tzdata/devel javazic-fixup.patch, NONE, 1.1 tzdata.spec, 1.50, 1.51

Petr Machata (pmachata) fedora-extras-commits at redhat.com
Tue Sep 25 11:36:38 UTC 2007


Author: pmachata

Update of /cvs/pkgs/rpms/tzdata/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15274

Modified Files:
	tzdata.spec 
Added Files:
	javazic-fixup.patch 
Log Message:
- Add support for building java's zoneinfo files in new
  tzdata-java RPM.


javazic-fixup.patch:

--- NEW FILE javazic-fixup.patch ---
--- 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";
 	    }


Index: tzdata.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tzdata/devel/tzdata.spec,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- tzdata.spec	22 Aug 2007 16:06:54 -0000	1.50
+++ tzdata.spec	25 Sep 2007 11:36:06 -0000	1.51
@@ -3,7 +3,7 @@
 Version: 2007g
 %define tzdata_version %{version}
 %define tzcode_version %{version}
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: Public Domain, LGPLv2+
 Group: System Environment/Base
 URL: ftp://elsie.nci.nih.gov/pub/
@@ -20,6 +20,18 @@
 This package contains data files with rules for various timezones around
 the world.
 
+%package java
+Summary: Timzeone data for Java
+Group: System Environment/Base
+Source3: javazic.tar.gz
+BuildArchitectures: noarch
+BuildRequires: java-devel
+Patch0: javazic-fixup.patch
+
+%description java
+This package contains timezone information for use by Java runtimes.
+
+
 %prep
 %setup -q -n tzdata
 mkdir tzdata%{tzdata_version}
@@ -30,15 +42,46 @@
     -e 's|@datadir@|%{_datadir}|' \
   Makeconfig.in > Makeconfig
 
+mkdir javazic
+tar zxf %{SOURCE3} -C javazic
+pushd javazic
+%patch0
+
+# 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.
+mv sun rht
+for f in `find . -name '*.java'`; do
+	sed -i -e 's:sun\.tools\.:rht.tools.:g'\
+	       -e 's:sun\.util\.:rht.util.:g' $f
+done
+popd
+
 %build
 make
 grep -v tz-art.htm tzcode%{tzcode_version}/tz-link.htm > tzcode%{tzcode_version}/tz-link.html
 
+pushd javazic
+javac -source 1.5 -target 1.5 -classpath . `find . -name \*.java`
+popd
+pushd tzdata%{tzcode_version}
+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
+popd
+
 %install
 rm -fr $RPM_BUILD_ROOT
 sed -i 's|@install_root@|%{buildroot}|' Makeconfig
 make install
 
+cp -pr zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
+
 %check
 echo ====================TESTING=========================
 make check
@@ -54,7 +97,15 @@
 %doc tzcode%{tzcode_version}/Theory
 %doc tzcode%{tzcode_version}/tz-link.html
 
+%files java
+%defattr(-,root,root)
+%{_datadir}/javazi
+
 %changelog
+* Thu Sep 25 2007 Keith Seitz <keiths at redhat.com> - 2007g-2
+- Add support for building java's zoneinfo files in new
+  tzdata-java RPM.
+
 * Wed Aug 22 2007 Petr Machata <pmachata at redhat.com> - 2007g-1
 - Fix licensing tag.
 - Upstream 2007g




More information about the scm-commits mailing list