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 2014g
13 %define tzdata_ver 2014g
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 # The tzdata-base-0.tar.bz2 is a simple building infrastructure and
22 # a test suite. It is occasionally updated from glibc sources, and as
23 # such is under LGPL v2+, but none of this ever gets to be part of
24 # final zoneinfo files.
25 Source0: %{name}-base-0.tar.bz2
26 # Source0-md5: e36d2f742c22f8c8dbf0686ac9769b55
27 # ftp://elsie.nci.nih.gov/pub/ has been shut down because of lawsuit
28 #Source1Download: http://www.iana.org/time-zones/
29 Source1: ftp://ftp.iana.org/tz/releases/%{name}%{tzdata_ver}.tar.gz
30 # Source1-md5: f9f59425e55b21d2e52bb3a95fc17b8d
31 #Source2Download: http://www.iana.org/time-zones/
32 Source2: ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz
33 # Source2-md5: f154679d48b724fe191efc19b55abd24
34 Source3: timezone.init
35 Source4: timezone.sysconfig
36 Source5: javazic.tar.gz
37 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
38 Source6: timezone.upstart
39 Source7: timezone.service
41 Patch0: %{name}-test-update.patch
42 Patch1: javazic-fixup.patch
44 URL: http://www.twinsun.com/tz/tz-link.htm
45 BuildRequires: rpm >= 4.4.9-56
46 BuildRequires: rpmbuild(macros) >= 1.623
49 BuildRequires: jpackage-utils
50 BuildRequires: rpm-javaprov
52 Requires(post,preun,postun): systemd-units >= 38
53 Requires: /sbin/chkconfig
54 Requires: rc-scripts >= 0.4.3.0
55 Requires: systemd-units >= 38
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 This package contains data files with rules for various timezones
63 %description -l pl.UTF-8
64 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
67 %package -n java-tzdata
68 Summary: Timezone data for Java
69 Summary(pl.UTF-8): Dane stref czasowych dla Javy
72 %description -n java-tzdata
73 This package contains timezone information for use by Java runtimes.
75 %description -n java-tzdata -l pl.UTF-8
76 Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
79 %package zoneinfo_right
80 Summary: Non-POSIX (real) time zones
81 Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
82 Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
84 Obsoletes: glibc-zoneinfo_right
86 %description zoneinfo_right
87 You don't want this. Details at:
88 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
90 %description zoneinfo_right -l es.UTF-8
91 No lo necesita. Encontrará los detalles en:
92 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
94 %description zoneinfo_right -l pl.UTF-8
95 Nie potrzebujesz tego. Szczegóły pod:
96 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
99 Summary: tzfile header file
100 Summary(pl.UTF-8): Plik nagłówkowy tzfile
101 Group: Development/Libraries
104 Header file for timezone database.
106 %description devel -l pl.UTF-8
107 Plik nagłówkowy bazy danych stref czasowych.
114 %{__tar} xzf %{SOURCE1} -C tzdata
115 # don't override Makefile from base tar
116 %{__mv} tzdata/Makefile{,.tzdata}
119 %{__tar} xzf %{SOURCE2} -C tzcode
123 s|@objpfx@|`pwd`/obj/|
124 s|@datadir@|%{_datadir}|
125 s|@install_root@|$RPM_BUILD_ROOT|
126 " 'Makeconfig.in' > Makeconfig
128 grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
132 tar zxf %{SOURCE5} -C javazic
136 # Hack alert! sun.tools may be defined and installed in the
137 # VM. In order to guarantee that we are using IcedTea/OpenJDK
138 # for creating the zoneinfo files, rebase all the packages
139 # from "sun." to "rht.". Unfortunately, gcj does not support
140 # any of the -Xclasspath options, so we must go this route
141 # to ensure the greatest compatibility.
142 # XXX: do we want 'pld' instead of 'rht'?
144 find . -type f -name '*.java' -print0 \
145 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
146 -e 's:sun\.util\.:rht.util.:g'
155 %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
157 %java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
158 -d ../zoneinfo/java \
159 africa antarctica asia australasia europe northamerica pacificnew \
160 southamerica backward etcetera factory systemv \
161 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
171 # test needs to be ran after "make install", as it uses installed files
172 : ====================TESTING=========================
175 CFLAGS="%{rpmcflags} %{rpmldflags}"
176 : ====================TESTING END=====================
179 # glibc.spec didn't keep it. so won't here either.
180 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
181 # behave more like glibc.spec
182 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
183 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
184 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
186 > $RPM_BUILD_ROOT/etc/localtime
189 cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
190 cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
192 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
193 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
195 install -d $RPM_BUILD_ROOT/etc/init
196 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf
198 install -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
199 install -p %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/pld-timezone
202 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
206 rm -rf $RPM_BUILD_ROOT
209 /sbin/chkconfig --add timezone
210 %service timezone restart
211 %systemd_post timezone.service
214 if [ "$1" = "0" ]; then
215 /sbin/chkconfig --del timezone
218 cp -af /etc/localtime /etc/localtime.rpmsave
220 %systemd_preun timezone.service
223 if [ "$1" = "0" ]; then
224 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
225 echo >&2 "Preserving /etc/localtime"
226 mv -f /etc/localtime{.rpmsave,}
231 %triggerpostun -- rc-scripts < 0.4.1.4
232 /sbin/chkconfig --add timezone
234 %triggerpostun -- tzdata < 2008b-4
235 if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
236 . /etc/sysconfig/timezone
238 if [ -z $ZONE_INFO_AREA ]; then
241 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
244 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
246 %service timezone restart
249 %triggerpostun -- tzdata < 2012a-2
250 %systemd_trigger timezone.service
253 %defattr(644,root,root,755)
254 %doc tzcode/README tzcode/Theory tzcode/tz-link.html
255 %ghost /etc/localtime
256 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
257 %attr(754,root,root) /etc/rc.d/init.d/timezone
258 %config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf
259 %{systemdunitdir}/timezone.service
260 %attr(755,root,root) /lib/systemd/pld-timezone
263 %exclude %{_datadir}/zoneinfo/right
266 %files -n java-tzdata
267 %defattr(644,root,root,755)
271 %files zoneinfo_right
272 %defattr(644,root,root,755)
273 %{_datadir}/zoneinfo/right
276 %defattr(644,root,root,755)
277 %doc tzcode/tzfile.5.txt
278 %{_includedir}/tzfile.h
279 %{_mandir}/man5/tzfile.5*