- Add support for building java's zoneinfo files in new tzdata-java RPM.

This commit is contained in:
Petr Machata 2007-09-25 11:36:06 +00:00
parent 49aba38bda
commit 151b4cc4cf
2 changed files with 86 additions and 1 deletions

34
javazic-fixup.patch Normal file
View File

@ -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";
}

View File

@ -3,7 +3,7 @@ Name: tzdata
Version: 2007g Version: 2007g
%define tzdata_version %{version} %define tzdata_version %{version}
%define tzcode_version %{version} %define tzcode_version %{version}
Release: 1%{?dist} Release: 2%{?dist}
License: Public Domain, LGPLv2+ License: Public Domain, LGPLv2+
Group: System Environment/Base Group: System Environment/Base
URL: ftp://elsie.nci.nih.gov/pub/ URL: ftp://elsie.nci.nih.gov/pub/
@ -20,6 +20,18 @@ BuildArchitectures: noarch
This package contains data files with rules for various timezones around This package contains data files with rules for various timezones around
the world. 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 %prep
%setup -q -n tzdata %setup -q -n tzdata
mkdir tzdata%{tzdata_version} mkdir tzdata%{tzdata_version}
@ -30,15 +42,46 @@ sed -e 's|@objpfx@|'`pwd`'/obj/|' \
-e 's|@datadir@|%{_datadir}|' \ -e 's|@datadir@|%{_datadir}|' \
Makeconfig.in > Makeconfig 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 %build
make make
grep -v tz-art.htm tzcode%{tzcode_version}/tz-link.htm > tzcode%{tzcode_version}/tz-link.html 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 %install
rm -fr $RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT
sed -i 's|@install_root@|%{buildroot}|' Makeconfig sed -i 's|@install_root@|%{buildroot}|' Makeconfig
make install make install
cp -pr zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
%check %check
echo ====================TESTING========================= echo ====================TESTING=========================
make check make check
@ -54,7 +97,15 @@ rm -rf %{buildroot}
%doc tzcode%{tzcode_version}/Theory %doc tzcode%{tzcode_version}/Theory
%doc tzcode%{tzcode_version}/tz-link.html %doc tzcode%{tzcode_version}/tz-link.html
%files java
%defattr(-,root,root)
%{_datadir}/javazi
%changelog %changelog
* Thu Sep 25 2007 Keith Seitz <keiths@redhat.com> - 2007g-2
- Add support for building java's zoneinfo files in new
tzdata-java RPM.
* Wed Aug 22 2007 Petr Machata <pmachata@redhat.com> - 2007g-1 * Wed Aug 22 2007 Petr Machata <pmachata@redhat.com> - 2007g-1
- Fix licensing tag. - Fix licensing tag.
- Upstream 2007g - Upstream 2007g