3 %bcond_without tests # make check
4 %bcond_without java # build java subpackage
7 # TODO: add more archs which pass tests
8 # tests fail with 32-bit time_t; reenable after transition to 64-bit everywhere
12 %if "%{pld_release}" == "ac"
13 %ifnarch i586 i686 pentium3 pentium4 athlon %{x8664}
18 Summary: Timezone data
19 Summary(pl.UTF-8): Dane o strefach czasowych
23 License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
25 #Source0Download: https://www.iana.org/time-zones
26 Source0: https://www.iana.org/time-zones/repository/releases/tzdb-%{version}.tar.lz
27 # Source0-md5: 5997b431868adc23cf645bd7cdde203e
28 Source3: timezone.init
29 Source4: timezone.sysconfig
30 Source5: javazic.tar.gz
31 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
32 Patch0: disable-network-tests.patch
33 Patch1: javazic-fixup.patch
35 URL: http://www.twinsun.com/tz/tz-link.htm
37 BuildRequires: rpm >= 4.4.9-56
38 BuildRequires: rpmbuild(macros) >= 1.623
41 BuildRequires: jpackage-utils
42 BuildRequires: rpm-javaprov
44 Requires(post,preun,postun): systemd-units >= 38
45 Requires: %{name}-zoneinfo = %{version}-%{release}
46 Requires: /sbin/chkconfig
47 Requires: rc-scripts >= 0.4.3.0
48 Requires: systemd-units >= 38
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 This package contains data files with rules for various timezones
56 %description -l pl.UTF-8
57 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
60 %package -n java-tzdata
61 Summary: Timezone data for Java
62 Summary(pl.UTF-8): Dane stref czasowych dla Javy
65 %description -n java-tzdata
66 This package contains timezone information for use by Java runtimes.
68 %description -n java-tzdata -l pl.UTF-8
69 Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
73 Summary: Timezone data
74 Summary(pl.UTF-8): Dane stref czasowych
80 %description zoneinfo -l pl.UTF-8
83 %package zoneinfo_right
84 Summary: Non-POSIX (real) time zones
85 Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
86 Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
88 Obsoletes: glibc-zoneinfo_right
90 %description zoneinfo_right
91 You don't want this. Details at:
92 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
94 %description zoneinfo_right -l es.UTF-8
95 No lo necesita. Encontrará los detalles en:
96 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
98 %description zoneinfo_right -l pl.UTF-8
99 Nie potrzebujesz tego. Szczegóły pod:
100 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
103 Summary: tzfile header file
104 Summary(pl.UTF-8): Plik nagłówkowy tzfile
105 Group: Development/Libraries
108 Header file for timezone database.
110 %description devel -l pl.UTF-8
111 Plik nagłówkowy bazy danych stref czasowych.
114 %setup -qn tzdb-%{version}
117 sed -i -e '/tz-art.html/d' tz-link.html
121 tar zxf %{SOURCE5} -C javazic --no-same-owner
125 # Hack alert! sun.tools may be defined and installed in the
126 # VM. In order to guarantee that we are using IcedTea/OpenJDK
127 # for creating the zoneinfo files, rebase all the packages
128 # from "sun." to "rht.". Unfortunately, gcj does not support
129 # any of the -Xclasspath options, so we must go this route
130 # to ensure the greatest compatibility.
131 # XXX: do we want 'pld' instead of 'rht'?
133 find . -type f -name '*.java' -print0 \
134 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
135 -e 's:sun\.util\.:rht.util.:g'
140 # build "fat" zoneinfo files for older parsers (like pytz)
141 # which can't parse "slim" 64-bit files
143 CFLAGS="%{rpmcflags}" \
144 LDFLAGS="%{rpmldflags}" \
150 %javac -source 1.6 -target 1.6 -classpath . $(find -name '*.java')
153 %java -classpath javazic/ rht.tools.javazic.Main -V %{version} \
155 africa antarctica asia australasia europe northamerica \
156 southamerica backward etcetera factory \
157 javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward
161 rm -rf $RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
165 DESTDIR=$RPM_BUILD_ROOT \
168 %{__rm} $RPM_BUILD_ROOT%{_bindir}/tzselect
169 %{__rm} $RPM_BUILD_ROOT%{_bindir}/zdump
170 %{__rm} $RPM_BUILD_ROOT%{_sbindir}/zic
171 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newctime.3*
172 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newtzset.3*
173 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tzselect.8*
174 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zdump.8*
175 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zic.8*
176 %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/libtz.a
177 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-posix
178 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/leapseconds
179 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/tzdata.zi
180 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab
181 %{__mv} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right
184 # test needs to be ran after "make install", as it uses installed files
185 : ====================TESTING=========================
188 CFLAGS="%{rpmcflags} %{rpmldflags}"
189 : ====================TESTING END=====================
192 # behave more like glibc.spec
193 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
194 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
195 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
197 # zic>=2020b installs localtime as hardlink to GMT, so remove first not break GMT zone files
198 %{__rm} $RPM_BUILD_ROOT/etc/localtime
199 > $RPM_BUILD_ROOT/etc/localtime
202 cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
203 cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
205 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
206 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
207 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
210 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
214 rm -rf $RPM_BUILD_ROOT
217 /sbin/chkconfig --add timezone
218 %service timezone restart
221 if [ "$1" = "0" ]; then
222 /sbin/chkconfig --del timezone
225 localtime=$(readlink -f /etc/localtime)
226 # cp has no dereference target option, so remove link first
227 test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave
228 cp -pf $localtime /etc/localtime.rpmsave
232 if [ "$1" = "0" ]; then
233 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
234 echo >&2 "Preserving /etc/localtime"
235 mv -f /etc/localtime{.rpmsave,}
239 %triggerpostun -- rc-scripts < 0.4.1.4
240 /sbin/chkconfig --add timezone
242 %triggerpostun -- tzdata < 2008b-4
243 if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
244 . /etc/sysconfig/timezone
246 if [ -z $ZONE_INFO_AREA ]; then
249 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
252 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
254 %service timezone restart
257 %triggerpostun -- tzdata < 2015f-2
258 %systemd_service_disable timezone.service
259 %systemd_service_stop timezone.service
262 %defattr(644,root,root,755)
263 %doc README tz-link.html
264 %ghost /etc/localtime
265 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
266 %attr(754,root,root) /etc/rc.d/init.d/timezone
267 %{systemdunitdir}/timezone.service
268 %{_datadir}/zoneinfo/localtime
269 %{_datadir}/zoneinfo/posixrules
270 %{_datadir}/zoneinfo/posixtime
273 %files -n java-tzdata
274 %defattr(644,root,root,755)
279 %defattr(644,root,root,755)
281 %exclude %{_datadir}/zoneinfo/right
282 %exclude %{_datadir}/zoneinfo/localtime
283 %exclude %{_datadir}/zoneinfo/posixrules
284 %exclude %{_datadir}/zoneinfo/posixtime
286 %files zoneinfo_right
287 %defattr(644,root,root,755)
288 %{_datadir}/zoneinfo/right
291 %defattr(644,root,root,755)
293 %{_includedir}/tzfile.h
294 %{_mandir}/man5/tzfile.5*