Package init

This commit is contained in:
overweight 2019-09-30 11:18:52 -04:00
commit 38fc206920
13 changed files with 582 additions and 0 deletions

View File

@ -0,0 +1,12 @@
diff -Nrup a/Makefile b/Makefile
--- a/Makefile 2017-10-23 18:03:40.237177646 -0400
+++ b/Makefile 2017-10-23 18:06:20.060683518 -0400
@@ -292,7 +292,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fn
# January's first Monday when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.
-CFLAGS=
+CFLAGS= -DHAVE_SNPRINTF=1
# Linker flags. Default to $(LFLAGS) for backwards compatibility
# to release 2012h and earlier.

44
7090844.patch Normal file
View File

@ -0,0 +1,44 @@
diff --git a/7090844.patch b/7090844.patch
new file mode 100644
index 0000000..fd5b531
--- /dev/null
+++ b/7090844.patch
@@ -0,0 +1,38 @@
+--- sun/tools/javazic/Mappings.java.orig 2015-04-13 12:42:30.000000000 -0400
++++ sun/tools/javazic/Mappings.java 2015-04-13 12:43:32.000000000 -0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -26,9 +26,6 @@
+ package sun.tools.javazic;
+
+ import java.util.ArrayList;
+-import java.util.HashMap;
+-import java.util.HashSet;
+-import java.util.Iterator;
+ import java.util.LinkedList;
+ import java.util.List;
+ import java.util.Map;
+@@ -79,8 +76,8 @@
+ // If the GMT offset of this Zone will change in some
+ // future time, this Zone is added to the exclude list.
+ boolean isExcluded = false;
+- if (zone.size() > 1) {
+- ZoneRec zrec = zone.get(zone.size()-2);
++ for (int i = 0; i < zone.size(); i++) {
++ ZoneRec zrec = zone.get(i);
+ if ((zrec.getGmtOffset() != rawOffset)
+ && (zrec.getUntilTime(0) > Time.getCurrentTime())) {
+ if (excludeList == null) {
+@@ -88,6 +85,7 @@
+ }
+ excludeList.add(zone.getName());
+ isExcluded = true;
++ break;
+ }
+ }
+

44
7133138.patch Normal file
View File

@ -0,0 +1,44 @@
diff --git a/7133138.patch b/7133138.patch
new file mode 100644
index 0000000..882f15f
--- /dev/null
+++ b/7133138.patch
@@ -0,0 +1,38 @@
+--- sun/tools/javazic/Mappings.java.orig 2015-04-13 12:44:10.000000000 -0400
++++ sun/tools/javazic/Mappings.java 2015-04-13 12:45:28.000000000 -0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -26,6 +26,7 @@
+ package sun.tools.javazic;
+
+ import java.util.ArrayList;
++import java.util.HashMap;
+ import java.util.LinkedList;
+ import java.util.List;
+ import java.util.Map;
+@@ -162,6 +163,20 @@
+ for (String key : toBeRemoved) {
+ aliases.remove(key);
+ }
++ // Eliminate any alias-to-alias mappings. For example, if
++ // there are A->B and B->C, A->B is changed to A->C.
++ Map<String, String> newMap = new HashMap<String, String>();
++ for (String key : aliases.keySet()) {
++ String realid = aliases.get(key);
++ String leaf = realid;
++ while (aliases.get(leaf) != null) {
++ leaf = aliases.get(leaf);
++ }
++ if (!realid.equals(leaf)) {
++ newMap.put(key, leaf);
++ }
++ }
++ aliases.putAll(newMap);
+ }
+
+ Map<String,String> getAliases() {

View File

@ -0,0 +1,54 @@
From d23da9b32cc3c591a54861eab4d15606ce2fea2c Mon Sep 17 00:00:00 2001
From: <linyanly.lin@huawei.com>
Date: Wed, 21 Jun 2017 16:35:40 +0800
Subject: [PATCH] add Beijing timezone
Signed-off-by: <linyanly.lin@huawei.com>
---
asia | 2 ++
backward | 2 +-
zone.tab | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/asia b/asia
index 35774c6..2514bbf 100644
--- a/asia
+++ b/asia
@@ -518,6 +518,8 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928
6:00 - +06
+# Nowadays, China Standard Time is known as "Beijing Time"
+Zone Asia/Beijing 8:00 PRC C%sT
# Hong Kong (Xianggang)
# Milne gives 7:36:41.7; round this.
diff --git a/backward b/backward
index 09f2a31..4af31d3 100644
--- a/backward
+++ b/backward
@@ -95,7 +95,7 @@ Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
-Link Asia/Shanghai PRC
+Link Asia/Beijing PRC
Link Pacific/Honolulu Pacific/Johnston
Link Pacific/Pohnpei Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
diff --git a/zone.tab b/zone.tab
index 204048c..9eea19e 100644
--- a/zone.tab
+++ b/zone.tab
@@ -145,7 +145,8 @@ CL -3327-07040 America/Santiago Chile (most areas)
CL -5309-07055 America/Punta_Arenas Region of Magallanes
CL -2709-10926 Pacific/Easter Easter Island
CM +0403+00942 Africa/Douala
-CN +3114+12128 Asia/Shanghai Beijing Time
+CN +3955+11626 Asia/Beijing China Standard Time
+CN +3114+12128 Asia/Shanghai Shanghai Time
CN +4348+08735 Asia/Urumqi Xinjiang Time
CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
--
1.8.3.1

Binary file not shown.

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

BIN
javazic.tar.gz Normal file

Binary file not shown.

37
rebase-01.patch Normal file
View File

@ -0,0 +1,37 @@
diff --git a/rebase-01.patch b/rebase-01.patch
new file mode 100644
index 0000000..bca6ed4
--- /dev/null
+++ b/rebase-01.patch
@@ -0,0 +1,31 @@
+--- sun/tools/javazic/Mappings.java.orig 2007-08-30 03:55:48.000000000 -0400
++++ sun/tools/javazic/Mappings.java 2015-04-13 12:39:44.000000000 -0400
+@@ -1,12 +1,12 @@
+ /*
+- * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
++ * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Sun designates this
++ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
++ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+@@ -18,9 +18,9 @@
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
+ */
+
+ package sun.tools.javazic;

42
rebase-02.patch Normal file
View File

@ -0,0 +1,42 @@
diff --git a/rebase-02.patch b/rebase-02.patch
new file mode 100644
index 0000000..0f57125
--- /dev/null
+++ b/rebase-02.patch
@@ -0,0 +1,36 @@
+--- sun/tools/javazic/Mappings.java.orig 2015-04-13 12:40:26.000000000 -0400
++++ sun/tools/javazic/Mappings.java 2015-04-13 12:42:11.000000000 -0400
+@@ -75,8 +75,10 @@
+ Zone zone = zones.get(zoneName);
+ String zonename = zone.getName();
+ int rawOffset = zone.get(zone.size()-1).getGmtOffset();
++
+ // If the GMT offset of this Zone will change in some
+ // future time, this Zone is added to the exclude list.
++ boolean isExcluded = false;
+ if (zone.size() > 1) {
+ ZoneRec zrec = zone.get(zone.size()-2);
+ if ((zrec.getGmtOffset() != rawOffset)
+@@ -85,7 +87,7 @@
+ excludeList = new ArrayList<String>();
+ }
+ excludeList.add(zone.getName());
+- continue;
++ isExcluded = true;
+ }
+ }
+
+@@ -101,9 +103,11 @@
+ rawOffsetsIndex.add(i, rawOffset);
+
+ Set<String> perRawOffset = new TreeSet<String>();
+- perRawOffset.add(zonename);
++ if (!isExcluded) {
++ perRawOffset.add(zonename);
++ }
+ rawOffsetsIndexTable.add(i, perRawOffset);
+- } else {
++ } else if (!isExcluded) {
+ int i = rawOffsetsIndex.indexOf(new Integer(rawOffset));
+ Set<String> perRawOffset = rawOffsetsIndexTable.get(i);
+ perRawOffset.add(zonename);

View File

@ -0,0 +1,136 @@
From 5832b4af2d049beec76ecd4513d5333d4a76cd91 Mon Sep 17 00:00:00 2001
From: hejingxian <hejingxian@huawei.com>
Date: Tue, 4 Sep 2019 15:19:46 +0800
Subject: [PATCH] Remove country select operation from tzselect steps.
For political reasons, avoid selecting country in tzselect.
---
tzselect.ksh | 90 +++++++++++-------------------------------------------------
1 file changed, 16 insertions(+), 74 deletions(-)
diff --git a/tzselect.ksh b/tzselect.ksh
index 18fce27..65fef55 100644
--- a/tzselect.ksh
+++ b/tzselect.ksh
@@ -51,7 +51,7 @@ say() {
coord=
location_limit=10
-zonetabtype=zone1970
+zonetabtype=zone
usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
Select a timezone interactively.
@@ -398,94 +398,36 @@ while
'`
;;
*)
- # Get list of names of countries in the continent or ocean.
- countries=`$AWK \
+ # Get list of names of timezones in the continent or ocean.
+ tmp_timezones=`$AWK \
-v continent="$continent" \
- -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
'
BEGIN { FS = "\t" }
/^#/ { next }
$3 ~ ("^" continent "/") {
- ncc = split($1, cc, /,/)
+ ncc = split($3, cc, /,/)
for (i = 1; i <= ncc; i++)
if (!cc_seen[cc[i]]++) cc_list[++ccs] = cc[i]
}
END {
- while (getline <TZ_COUNTRY_TABLE) {
- if ($0 !~ /^#/) cc_name[$1] = $2
- }
for (i = 1; i <= ccs; i++) {
- country = cc_list[i]
- if (cc_name[country]) {
- country = cc_name[country]
- }
- print country
+ print cc_list[i]
}
}
' <"$TZ_ZONE_TABLE" | sort -f`
+ timezones=[]
+ index=0
+ for item in $tmp_timezones; do
+ timezones[$index]=`echo $item | awk -F '/' '{print $2}'`
+ index=$(($index+1))
+ done
- # If there's more than one country, ask the user which one.
- case $countries in
- *"$newline"*)
- echo >&2 'Please select a country' \
- 'whose clocks agree with yours.'
- doselect $countries
- country=$select_result;;
- *)
- country=$countries
- esac
-
-
- # Get list of timezones in the country.
- regions=`$AWK \
- -v country="$country" \
- -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
- '
- BEGIN {
- FS = "\t"
- cc = country
- while (getline <TZ_COUNTRY_TABLE) {
- if ($0 !~ /^#/ && country == $2) {
- cc = $1
- break
- }
- }
- }
- /^#/ { next }
- $1 ~ cc { print $4 }
- ' <"$TZ_ZONE_TABLE"`
-
-
- # If there's more than one region, ask the user which one.
- case $regions in
- *"$newline"*)
- echo >&2 'Please select one of the following timezones.'
- doselect $regions
- region=$select_result;;
- *)
- region=$regions
- esac
-
- # Determine TZ from country and region.
- TZ=`$AWK \
- -v country="$country" \
- -v region="$region" \
- -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
- '
- BEGIN {
- FS = "\t"
- cc = country
- while (getline <TZ_COUNTRY_TABLE) {
- if ($0 !~ /^#/ && country == $2) {
- cc = $1
- break
- }
- }
- }
- /^#/ { next }
- $1 ~ cc && $4 == region { print $3 }
- ' <"$TZ_ZONE_TABLE"`
+ echo >&2 'Please select a timezone' \
+ 'whose clocks agree with yours.'
+ doselect ${timezones[@]}
+ timezone=$select_result
+ TZ=$continent/$timezone
esac
# Make sure the corresponding zoneinfo file exists.
--
1.8.3.1

BIN
tzcode2019b.tar.gz Normal file

Binary file not shown.

179
tzdata.spec Normal file
View File

@ -0,0 +1,179 @@
Name: tzdata
Version: 2019b
Release: 5
Summary: Timezone data
License: Public Domain
URL: https://www.iana.org/time-zones
Source0: https://data.iana.org/time-zones/releases/tzdata%{version}.tar.gz
Source1: https://data.iana.org/time-zones/releases/tzcode%{version}.tar.gz
Patch002: 0002-Fix-have-snprintf-error.patch
BuildRequires: gawk glibc perl-interpreter
BuildRequires: java-devel
BuildRequires: glibc-common >= 2.5.90-7
BuildArchitectures: noarch
%description
This package contains data files with rules for various timezones around
the world.
%package java
Summary: Timezone data for Java
Source3: javazic.tar.gz
Source4: javazic-1.8-37392f2f5d59.tar.xz
Patch100: javazic-fixup.patch
Patch101: rebase-01.patch
Patch102: rebase-02.patch
Patch103: 7090844.patch
Patch104: 7133138.patch
Patch9000: bugfix-0001-add-Beijing-timezone.patch
Patch9001: remove-country-selection-from-tzselect-steps.patch
%description java
This package contains timezone information for use by Java runtimes.
%prep
%setup -q -c -a 1
%patch002 -p1
make VERSION=%{version} tzdata%{version}-rearguard.tar.gz
tar zxf tzdata%{version}-rearguard.tar.gz
rm tzdata.zi
mkdir javazic
tar zxf %{SOURCE3} -C javazic
cd javazic
%patch100
%patch101
%patch102
%patch103
%patch104
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 ..
tar xf %{SOURCE4}
echo "%{name}%{version}" >> VERSION
%patch9000 -p1
%patch9001 -p1
%build
make VERSION=%{version} DATAFORM=rearguard tzdata.zi
FILES="africa antarctica asia australasia europe northamerica southamerica
pacificnew etcetera backward"
mkdir zoneinfo/{,posix,right}
zic -y ./yearistype -d zoneinfo -L /dev/null -p America/New_York $FILES
zic -y ./yearistype -d zoneinfo/posix -L /dev/null $FILES
zic -y ./yearistype -d zoneinfo/right -L leapseconds $FILES
cd javazic
javac -source 1.5 -target 1.5 -classpath . `find . -name \*.java`
cd ..
java -classpath javazic/ rht.tools.javazic.Main -V %{version} \
-d javazi \
$FILES javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward
cd javazic-1.8
javac -source 1.7 -target 1.7 -classpath . `find . -name \*.java`
cd ..
java -classpath javazic-1.8 build.tools.tzdb.TzdbZoneRulesCompiler \
-srcdir . -dstfile tzdb.dat \
-verbose \
$FILES javazic-1.8/tzdata_jdk/gmt javazic-1.8/tzdata_jdk/jdk11_backward
%install
rm -fr $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}
cp -prd zoneinfo $RPM_BUILD_ROOT%{_datadir}
install -p -m 644 zone.tab zone1970.tab iso3166.tab leapseconds tzdata.zi $RPM_BUILD_ROOT%{_datadir}/zoneinfo
cp -prd javazi $RPM_BUILD_ROOT%{_datadir}/javazi
mkdir -p $RPM_BUILD_ROOT%{_datadir}/javazi-1.8
install -p -m 644 tzdb.dat $RPM_BUILD_ROOT%{_datadir}/javazi-1.8/
%files
%{_datadir}/zoneinfo
%doc README
%doc theory.html
%doc tz-link.html
%doc tz-art.html
%license LICENSE
%files java
%{_datadir}/javazi
%{_datadir}/javazi-1.8
%changelog
* Mon Sep 23 2019 liuchao<liuchao173@huawei.com> -2019b-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: use rearguard data set to fix Casablance DST display error since 2019
* Wed Sep 4 2019 hejingxian<hejingxian@huawei.com> - 2019b-4
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: remove country select operation from tzselect steps.
* Fri Aug 23 2019 wuxu<wuxu.wu@huawei.com> - 2019b-3
- Type:recommended
- ID:NA
- SUG:NA
* Thu Jul 25 2019 luochunsheng<luochunsheng@huawei.com> - 2019b-2
- Type:recommended
- ID:NA
- SUG:NA
* Tue Jul 09 2019 openEuler Buildteam <buildteam@openeuler.com> - 2019b-1
- Rebase to tzdata-2019b
- Brazil will no longer observe DST going forward.
- The 2019 spring transition for Palestine occurred 03-29, not 03-30.
* Sun May 5 2019 luochunsheng<luochunsheng@huawei.com> - 2019a-4
- Type:fix
- ID:NA
- SUG:NA
- DESC: Bring back 2019-2037 Morocco Ramadan predictions
https://www.timeanddate.com/news/time/morocco-changes-clocks-2019.html
* Mon Apr 22 2019 luochunsheng<luochunsheng@huawei.com> - 2019a-3
- Type:NA
- ID:NA
- SUG:NA
- DESC: Revert "Bring back 2019-2037 Morocco Ramadan predictions" to
fix Morocco zoneinfo.
* Wed Apr 17 2019 luochunsheng<luochunsheng@huawei.com> - 2019a-2
- Type:NA
- ID:NA
- SUG:NA
- DESC:Quality enhance
* Fri Mar 29 2019 openEuler Buildteam <buildteam@openeuler.com> - 2019a-1
- Rebase to tzdata-2019a
- Palestine will start DST on 2019-03-30, rather than 2019-03-23 as
previously predicted.
- Metlakatla rejoined Alaska time on 2019-01-20, ending its observances
of Pacific standard time.
* Fri Mar 8 2019 wangjia<wangjia55@huawei.com> - 2018i-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add Beijing timezone
* Tue Jan 15 2019 openEuler Buildteam <buildteam@openeuler.org> - 2018i-1
- Package init

BIN
tzdata2019b.tar.gz Normal file

Binary file not shown.