3 %bcond_without tests # make check
4 %bcond_with java # build java subpackage
6 %define tzcode_ver 2010n
7 %define tzdata_ver 2010n
9 Summary(pl.UTF-8): Dane o strefach czasowych
11 Version: %{tzdata_ver}
13 License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
15 # The tzdata-base-0.tar.bz2 is a simple building infrastructure and
16 # a test suite. It is occasionally updated from glibc sources, and as
17 # such is under LGPL v2+, but none of this ever gets to be part of
18 # final zoneinfo files.
19 Source0: %{name}-base-0.tar.bz2
20 # Source0-md5: e36d2f742c22f8c8dbf0686ac9769b55
21 Source1: ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz
22 # Source1-md5: b5eefb4986866895ab84f52220f1dfa6
23 Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz
24 # Source2-md5: a7a776a5713831993e814fe0c05f9fd5
25 Source3: timezone.init
26 Source4: timezone.sysconfig
27 Source5: javazic.tar.gz
28 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
29 Patch1: javazic-fixup.patch
30 URL: http://www.twinsun.com/tz/tz-link.htm
31 BuildRequires: rpmbuild(macros) >= 1.300
33 BuildRequires: jpackage-utils
34 BuildRequires: rpm-javaprov
36 Requires(post,preun): /sbin/chkconfig
37 Requires: /sbin/chkconfig
38 Requires: rc-scripts >= 0.4.1.4
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 This package contains data files with rules for various timezones
46 %description -l pl.UTF-8
47 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
51 Summary: Timezone data for Java
52 Summary(pl.UTF-8): Dane stref czasowych dla Javy
56 This package contains timezone information for use by Java runtimes.
58 %description java -l pl.UTF-8
59 Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
62 %package zoneinfo_right
63 Summary: Non-POSIX (real) time zones
64 Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
65 Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
67 Obsoletes: glibc-zoneinfo_right
69 %description zoneinfo_right
70 You don't want this. Details at:
71 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
73 %description zoneinfo_right -l es.UTF-8
74 No lo necesita. Encontrará los detalles en:
75 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
77 %description zoneinfo_right -l pl.UTF-8
78 Nie potrzebujesz tego. Szczegóły pod:
79 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
82 Summary: tzfile header file
83 Summary(pl.UTF-8): Plik nagłówkowy tzfile
84 Group: Development/Libraries
87 Header file for timezone database.
89 %description devel -l pl.UTF-8
90 Plik nagłówkowy bazy danych stref czasowych.
95 %{__tar} xzf %{SOURCE1} -C tzdata
97 %{__tar} xzf %{SOURCE2} -C tzcode
100 s|@objpfx@|`pwd`/obj/|
101 s|@datadir@|%{_datadir}|
102 s|@install_root@|$RPM_BUILD_ROOT|
103 " 'Makeconfig.in' > Makeconfig
105 grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
109 tar zxf %{SOURCE5} -C javazic
113 # Hack alert! sun.tools may be defined and installed in the
114 # VM. In order to guarantee that we are using IcedTea/OpenJDK
115 # for creating the zoneinfo files, rebase all the packages
116 # from "sun." to "rht.". Unfortunately, gcj does not support
117 # any of the -Xclasspath options, so we must go this route
118 # to ensure the greatest compatibility.
119 # XXX: do we want 'pld' instead of 'rht'?
121 find . -type f -name '*.java' -print0 \
122 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
123 -e 's:sun\.util\.:rht.util.:g'
132 %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
134 %java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
135 -d ../zoneinfo/java \
136 africa antarctica asia australasia europe northamerica pacificnew \
137 southamerica backward etcetera solar87 solar88 solar89 systemv \
138 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
143 rm -rf $RPM_BUILD_ROOT
144 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
145 install -d $RPM_BUILD_ROOT%{_includedir}
146 install -d $RPM_BUILD_ROOT%{_mandir}/man5
151 : ====================TESTING=========================
154 CFLAGS="%{rpmcflags} %{rpmldflags}"
155 TZDIR=$(pwd)/obj ./obj/test-tz
156 TZDIR=$(pwd)/obj ./obj/tst-timezone
157 : ====================TESTING END=====================
160 # glibc.spec didn't keep it. so won't here either.
161 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
162 # behave more like glibc.spec
163 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
164 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
165 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
167 > $RPM_BUILD_ROOT/etc/localtime
170 cp -a tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
171 cp -a tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
173 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
174 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
177 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
181 rm -rf $RPM_BUILD_ROOT
184 /sbin/chkconfig --add timezone
185 %service timezone restart
188 if [ "$1" = "0" ]; then
189 /sbin/chkconfig --del timezone
192 cp -f /etc/localtime /etc/localtime.rpmsave
196 if [ "$1" = "0" ]; then
197 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
198 mv -f /etc/localtime{.rpmsave,}
202 %triggerpostun -- rc-scripts < 0.4.1.4
203 /sbin/chkconfig --add timezone
205 %triggerpostun -- tzdata < 2008b-4
206 if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
207 . /etc/sysconfig/timezone
209 if [ -z $ZONE_INFO_AREA ]; then
212 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
215 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
217 %service timezone restart
221 %defattr(644,root,root,755)
222 %doc tzcode/README tzcode/Theory tzcode/tz-link.html
223 %ghost /etc/localtime
224 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
225 %attr(754,root,root) /etc/rc.d/init.d/timezone
228 %exclude %{_datadir}/zoneinfo/right
232 %defattr(644,root,root,755)
236 %files zoneinfo_right
237 %defattr(644,root,root,755)
238 %{_datadir}/zoneinfo/right
241 %defattr(644,root,root,755)
242 %doc tzcode/tzfile.5.txt
243 %{_includedir}/tzfile.h
244 %{_mandir}/man5/tzfile.5*