3 %bcond_without tests # make check
4 %bcond_without java # build java subpackage
6 %if "%{pld_release}" == "ac"
7 %ifnarch i586 i686 pentium3 pentium4 athlon %{x8664}
12 %define tzcode_ver 2020a
13 %define tzdata_ver 2020a
14 Summary: Timezone data
15 Summary(pl.UTF-8): Dane o strefach czasowych
17 Version: %{tzdata_ver}
19 License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
21 # ftp://elsie.nci.nih.gov/pub/ has been shut down because of lawsuit
22 #Source1Download: http://www.iana.org/time-zones/
23 Source1: ftp://ftp.iana.org/tz/releases/%{name}%{tzdata_ver}.tar.gz
24 # Source1-md5: 96a985bb8eeab535fb8aa2132296763a
25 #Source2Download: http://www.iana.org/time-zones/
26 Source2: ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz
27 # Source2-md5: f87c3477e85a5c4b00df0def6c6a0055
28 Source3: timezone.init
29 Source4: timezone.sysconfig
30 Source5: javazic.tar.gz
31 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
32 Patch1: javazic-fixup.patch
34 URL: http://www.twinsun.com/tz/tz-link.htm
35 BuildRequires: rpm >= 4.4.9-56
36 BuildRequires: rpmbuild(macros) >= 1.623
39 BuildRequires: jpackage-utils
40 BuildRequires: rpm-javaprov
42 Requires(post,preun,postun): systemd-units >= 38
43 Requires: %{name}-zoneinfo = %{version}-%{release}
44 Requires: /sbin/chkconfig
45 Requires: rc-scripts >= 0.4.3.0
46 Requires: systemd-units >= 38
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 This package contains data files with rules for various timezones
54 %description -l pl.UTF-8
55 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
58 %package -n java-tzdata
59 Summary: Timezone data for Java
60 Summary(pl.UTF-8): Dane stref czasowych dla Javy
63 %description -n java-tzdata
64 This package contains timezone information for use by Java runtimes.
66 %description -n java-tzdata -l pl.UTF-8
67 Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
71 Summary: Timezone data
72 Summary(pl.UTF-8): Dane stref czasowych
78 %description zoneinfo -l pl.UTF-8
81 %package zoneinfo_right
82 Summary: Non-POSIX (real) time zones
83 Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
84 Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
86 Obsoletes: glibc-zoneinfo_right
88 %description zoneinfo_right
89 You don't want this. Details at:
90 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
92 %description zoneinfo_right -l es.UTF-8
93 No lo necesita. Encontrará los detalles en:
94 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
96 %description zoneinfo_right -l pl.UTF-8
97 Nie potrzebujesz tego. Szczegóły pod:
98 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
101 Summary: tzfile header file
102 Summary(pl.UTF-8): Plik nagłówkowy tzfile
103 Group: Development/Libraries
106 Header file for timezone database.
108 %description devel -l pl.UTF-8
109 Plik nagłówkowy bazy danych stref czasowych.
114 sed -i -e '/tz-art.html/d' tz-link.html
118 tar zxf %{SOURCE5} -C javazic
122 # Hack alert! sun.tools may be defined and installed in the
123 # VM. In order to guarantee that we are using IcedTea/OpenJDK
124 # for creating the zoneinfo files, rebase all the packages
125 # from "sun." to "rht.". Unfortunately, gcj does not support
126 # any of the -Xclasspath options, so we must go this route
127 # to ensure the greatest compatibility.
128 # XXX: do we want 'pld' instead of 'rht'?
130 find . -type f -name '*.java' -print0 \
131 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
132 -e 's:sun\.util\.:rht.util.:g'
138 CFLAGS="%{rpmcflags}" \
139 LDFLAGS="%{rpmldflags}" \
144 %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
147 %java -classpath javazic/ rht.tools.javazic.Main -V %{version} \
149 africa antarctica asia australasia europe northamerica pacificnew \
150 southamerica backward etcetera factory systemv \
151 javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward
155 rm -rf $RPM_BUILD_ROOT
156 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
158 DESTDIR=$RPM_BUILD_ROOT
160 rm $RPM_BUILD_ROOT%{_bindir}/tzselect
161 rm $RPM_BUILD_ROOT%{_bindir}/zdump
162 rm $RPM_BUILD_ROOT%{_sbindir}/zic
163 rm $RPM_BUILD_ROOT%{_mandir}/man3/newctime.3*
164 rm $RPM_BUILD_ROOT%{_mandir}/man3/newtzset.3*
165 rm $RPM_BUILD_ROOT%{_mandir}/man8/tzselect.8*
166 rm $RPM_BUILD_ROOT%{_mandir}/man8/zdump.8*
167 rm $RPM_BUILD_ROOT%{_mandir}/man8/zic.8*
168 rm $RPM_BUILD_ROOT%{_prefix}/lib/libtz.a
169 rm $RPM_BUILD_ROOT%{_datadir}/zoneinfo-posix
170 rm $RPM_BUILD_ROOT%{_datadir}/zoneinfo/leapseconds
171 rm $RPM_BUILD_ROOT%{_datadir}/zoneinfo/tzdata.zi
172 rm $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab
173 mv $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right
176 # test needs to be ran after "make install", as it uses installed files
177 : ====================TESTING=========================
180 CFLAGS="%{rpmcflags} %{rpmldflags}"
181 : ====================TESTING END=====================
184 # behave more like glibc.spec
185 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
186 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
187 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
189 > $RPM_BUILD_ROOT/etc/localtime
192 cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
193 cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
195 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
196 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
197 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
200 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
204 rm -rf $RPM_BUILD_ROOT
207 /sbin/chkconfig --add timezone
208 %service timezone restart
211 if [ "$1" = "0" ]; then
212 /sbin/chkconfig --del timezone
215 localtime=$(readlink -f /etc/localtime)
216 # cp has no dereference target option, so remove link first
217 test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave
218 cp -pf $localtime /etc/localtime.rpmsave
222 if [ "$1" = "0" ]; then
223 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
224 echo >&2 "Preserving /etc/localtime"
225 mv -f /etc/localtime{.rpmsave,}
229 %triggerpostun -- rc-scripts < 0.4.1.4
230 /sbin/chkconfig --add timezone
232 %triggerpostun -- tzdata < 2008b-4
233 if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
234 . /etc/sysconfig/timezone
236 if [ -z $ZONE_INFO_AREA ]; then
239 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
242 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
244 %service timezone restart
247 %triggerpostun -- tzdata < 2015f-2
248 %systemd_service_disable timezone.service
249 %systemd_service_stop timezone.service
252 %defattr(644,root,root,755)
253 %doc README tz-link.html
254 %ghost /etc/localtime
255 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
256 %attr(754,root,root) /etc/rc.d/init.d/timezone
257 %{systemdunitdir}/timezone.service
258 %{_datadir}/zoneinfo/localtime
259 %{_datadir}/zoneinfo/posixrules
260 %{_datadir}/zoneinfo/posixtime
263 %files -n java-tzdata
264 %defattr(644,root,root,755)
269 %defattr(644,root,root,755)
271 %exclude %{_datadir}/zoneinfo/right
272 %exclude %{_datadir}/zoneinfo/localtime
273 %exclude %{_datadir}/zoneinfo/posixrules
274 %exclude %{_datadir}/zoneinfo/posixtime
276 %files zoneinfo_right
277 %defattr(644,root,root,755)
278 %{_datadir}/zoneinfo/right
281 %defattr(644,root,root,755)
283 %{_includedir}/tzfile.h
284 %{_mandir}/man5/tzfile.5*