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 2011i
13 %define tzdata_ver 2011i
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 Source1: ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz
28 # Source1-md5: c7a86ec34f30f8d6aa77ef94902a3047
29 Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz
30 # Source2-md5: cf7f4335b7c8682899fa2814e711c1b2
31 Source3: timezone.init
32 Source4: timezone.sysconfig
33 Source5: javazic.tar.gz
34 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
35 Source6: timezone.upstart
36 Patch1: javazic-fixup.patch
38 URL: http://www.twinsun.com/tz/tz-link.htm
39 BuildRequires: rpm >= 4.4.9-56
40 BuildRequires: rpmbuild(macros) >= 1.300
43 BuildRequires: jpackage-utils
44 BuildRequires: rpm-javaprov
46 Requires(post,preun): /sbin/chkconfig
47 Requires: rc-scripts >= 0.4.3.0
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 This package contains data files with rules for various timezones
55 %description -l pl.UTF-8
56 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
59 %package -n java-tzdata
60 Summary: Timezone data for Java
61 Summary(pl.UTF-8): Dane stref czasowych dla Javy
64 %description -n java-tzdata
65 This package contains timezone information for use by Java runtimes.
67 %description -n java-tzdata -l pl.UTF-8
68 Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
71 %package zoneinfo_right
72 Summary: Non-POSIX (real) time zones
73 Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
74 Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
76 Obsoletes: glibc-zoneinfo_right
78 %description zoneinfo_right
79 You don't want this. Details at:
80 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
82 %description zoneinfo_right -l es.UTF-8
83 No lo necesita. Encontrará los detalles en:
84 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
86 %description zoneinfo_right -l pl.UTF-8
87 Nie potrzebujesz tego. Szczegóły pod:
88 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
91 Summary: tzfile header file
92 Summary(pl.UTF-8): Plik nagłówkowy tzfile
93 Group: Development/Libraries
96 Header file for timezone database.
98 %description devel -l pl.UTF-8
99 Plik nagłówkowy bazy danych stref czasowych.
104 %{__tar} xzf %{SOURCE1} -C tzdata
106 %{__tar} xzf %{SOURCE2} -C tzcode
110 s|@objpfx@|`pwd`/obj/|
111 s|@datadir@|%{_datadir}|
112 s|@install_root@|$RPM_BUILD_ROOT|
113 " 'Makeconfig.in' > Makeconfig
115 grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
119 tar zxf %{SOURCE5} -C javazic
123 # Hack alert! sun.tools may be defined and installed in the
124 # VM. In order to guarantee that we are using IcedTea/OpenJDK
125 # for creating the zoneinfo files, rebase all the packages
126 # from "sun." to "rht.". Unfortunately, gcj does not support
127 # any of the -Xclasspath options, so we must go this route
128 # to ensure the greatest compatibility.
129 # XXX: do we want 'pld' instead of 'rht'?
131 find . -type f -name '*.java' -print0 \
132 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
133 -e 's:sun\.util\.:rht.util.:g'
142 %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
144 %java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
145 -d ../zoneinfo/java \
146 africa antarctica asia australasia europe northamerica pacificnew \
147 southamerica backward etcetera solar87 solar88 solar89 systemv \
148 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir}}
158 # test needs to be ran after "make install", as it uses installed files
159 : ====================TESTING=========================
162 CFLAGS="%{rpmcflags} %{rpmldflags}"
163 : ====================TESTING END=====================
166 # glibc.spec didn't keep it. so won't here either.
167 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
168 # behave more like glibc.spec
169 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
170 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
171 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
173 > $RPM_BUILD_ROOT/etc/localtime
176 cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
177 cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
179 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
180 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
182 install -d $RPM_BUILD_ROOT/etc/init
183 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf
186 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
190 rm -rf $RPM_BUILD_ROOT
193 /sbin/chkconfig --add timezone
194 %service timezone restart
197 if [ "$1" = "0" ]; then
198 /sbin/chkconfig --del timezone
201 cp -f /etc/localtime /etc/localtime.rpmsave
205 if [ "$1" = "0" ]; then
206 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
207 mv -f /etc/localtime{.rpmsave,}
211 %triggerpostun -- rc-scripts < 0.4.1.4
212 /sbin/chkconfig --add timezone
214 %triggerpostun -- tzdata < 2008b-4
215 if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
216 . /etc/sysconfig/timezone
218 if [ -z $ZONE_INFO_AREA ]; then
221 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
224 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
226 %service timezone restart
230 %defattr(644,root,root,755)
231 %doc tzcode/README tzcode/Theory tzcode/tz-link.html
232 %ghost /etc/localtime
233 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
234 %attr(754,root,root) /etc/rc.d/init.d/timezone
235 %config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf
238 %exclude %{_datadir}/zoneinfo/right
241 %files -n java-tzdata
242 %defattr(644,root,root,755)
246 %files zoneinfo_right
247 %defattr(644,root,root,755)
248 %{_datadir}/zoneinfo/right
251 %defattr(644,root,root,755)
252 %doc tzcode/tzfile.5.txt
253 %{_includedir}/tzfile.h
254 %{_mandir}/man5/tzfile.5*