- Add support for building java's zoneinfo files in new tzdata-java RPM.
This commit is contained in:
parent
49aba38bda
commit
151b4cc4cf
34
javazic-fixup.patch
Normal file
34
javazic-fixup.patch
Normal 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";
|
||||
}
|
53
tzdata.spec
53
tzdata.spec
@ -3,7 +3,7 @@ Name: tzdata
|
||||
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 @@ BuildArchitectures: noarch
|
||||
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 @@ sed -e 's|@objpfx@|'`pwd`'/obj/|' \
|
||||
-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 @@ rm -rf %{buildroot}
|
||||
%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@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
|
||||
- Fix licensing tag.
|
||||
- Upstream 2007g
|
||||
|
Loading…
Reference in New Issue
Block a user