]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
- up to 2011d
[packages/tzdata.git] / tzdata.spec
CommitLineData
6b9abb55
JB
1#
2# Conditional build
0eb7e566 3%bcond_without tests # make check
6496acd7 4%bcond_with java # build java subpackage
0eb7e566 5
1772efcb
ER
6%define tzcode_ver 2011d
7%define tzdata_ver 2011d
f21a80a6 8Summary: Timezone data
e5477455 9Summary(pl.UTF-8): Dane o strefach czasowych
f21a80a6 10Name: tzdata
6b9abb55 11Version: %{tzdata_ver}
0deae7a6 12Release: 1
6b9abb55 13License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
3458d90a 14Group: Base
892193c1
ER
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.
0b5f1229 19Source0: %{name}-base-0.tar.bz2
892193c1 20# Source0-md5: e36d2f742c22f8c8dbf0686ac9769b55
6b9abb55 21Source1: ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz
1772efcb 22# Source1-md5: 03c5793502b7c41985edd73146bf7e36
6b9abb55 23Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz
1772efcb 24# Source2-md5: 95095242ee368e6a7e107f154590ac11
48f17b2c
ER
25Source3: timezone.init
26Source4: timezone.sysconfig
0eb7e566
ER
27Source5: javazic.tar.gz
28# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
eb9404d2 29Source6: timezone.upstart
0eb7e566 30Patch1: javazic-fixup.patch
6b9abb55 31URL: http://www.twinsun.com/tz/tz-link.htm
df36f3e7
ER
32BuildRequires: rpmbuild(macros) >= 1.300
33%if %{with java}
34BuildRequires: jpackage-utils
35BuildRequires: rpm-javaprov
36%endif
48f17b2c 37Requires(post,preun): /sbin/chkconfig
0db057c4 38Requires: /sbin/chkconfig
48f17b2c 39Requires: rc-scripts >= 0.4.1.4
f21a80a6 40BuildArch: noarch
95a1ed16 41BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
f21a80a6
PZ
42
43%description
3458d90a
JB
44This package contains data files with rules for various timezones
45around the world.
46
151d1751
JR
47%description -l pl.UTF-8
48Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
49całym świecie.
f21a80a6 50
0eb7e566
ER
51%package java
52Summary: Timezone data for Java
6496acd7 53Summary(pl.UTF-8): Dane stref czasowych dla Javy
0eb7e566
ER
54Group: Base
55
56%description java
57This package contains timezone information for use by Java runtimes.
58
6496acd7
JB
59%description java -l pl.UTF-8
60Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
61programów w Javie.
62
33e5a5b5
ER
63%package zoneinfo_right
64Summary: Non-POSIX (real) time zones
e5477455
ER
65Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
66Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
33e5a5b5 67Group: Libraries
37e6efaa 68Obsoletes: glibc-zoneinfo_right
33e5a5b5
ER
69
70%description zoneinfo_right
71You don't want this. Details at:
e3ed8f87 72<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 73
151d1751
JR
74%description zoneinfo_right -l es.UTF-8
75No lo necesita. Encontrará los detalles en:
e3ed8f87 76<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 77
151d1751
JR
78%description zoneinfo_right -l pl.UTF-8
79Nie potrzebujesz tego. Szczegóły pod:
e3ed8f87 80<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 81
9550cc22 82%package devel
caed056f
JB
83Summary: tzfile header file
84Summary(pl.UTF-8): Plik nagłówkowy tzfile
85de48d2 85Group: Development/Libraries
9550cc22 86
87%description devel
85de48d2
AG
88Header file for timezone database.
89
90%description devel -l pl.UTF-8
91Plik nagłówkowy bazy danych stref czasowych.
9550cc22 92
f21a80a6 93%prep
8d8e88cb
ER
94%setup -qc
95mv tzdata/* .
96%{__tar} xzf %{SOURCE1} -C tzdata
97mkdir tzcode
98%{__tar} xzf %{SOURCE2} -C tzcode
f21a80a6 99
0b5f1229
ER
100sed -e "
101s|@objpfx@|`pwd`/obj/|
102s|@datadir@|%{_datadir}|
103s|@install_root@|$RPM_BUILD_ROOT|
463fb3cd 104" 'Makeconfig.in' > Makeconfig
0b5f1229 105
8d8e88cb 106grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
0b5f1229 107
0eb7e566
ER
108%if %{with java}
109install -d javazic
110tar zxf %{SOURCE5} -C javazic
111cd javazic
112%patch1
113
114# Hack alert! sun.tools may be defined and installed in the
115# VM. In order to guarantee that we are using IcedTea/OpenJDK
116# for creating the zoneinfo files, rebase all the packages
117# from "sun." to "rht.". Unfortunately, gcj does not support
118# any of the -Xclasspath options, so we must go this route
119# to ensure the greatest compatibility.
120# XXX: do we want 'pld' instead of 'rht'?
121mv sun rht
122find . -type f -name '*.java' -print0 \
123 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
124 -e 's:sun\.util\.:rht.util.:g'
125cd -
126%endif
127
f21a80a6 128%build
3458d90a 129%{__make}
f21a80a6 130
0eb7e566
ER
131%if %{with java}
132cd javazic
133%javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
134cd ../tzdata
135%java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
136 -d ../zoneinfo/java \
137 africa antarctica asia australasia europe northamerica pacificnew \
138 southamerica backward etcetera solar87 solar88 solar89 systemv \
139 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
140cd ..
141%endif
142
f21a80a6 143%install
95a1ed16 144rm -rf $RPM_BUILD_ROOT
cf62b8f3 145install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir}}
3458d90a 146%{__make} install
a360159e 147
aa82ac7a 148%if %{with tests}
cf62b8f3 149# test needs to be ran after "make install", as it uses installed files
48f17b2c 150: ====================TESTING=========================
5db5c79b 151%{__make} check \
152 CC="%{__cc}" \
153 CFLAGS="%{rpmcflags} %{rpmldflags}"
48f17b2c 154: ====================TESTING END=====================
aa82ac7a 155%endif
48f17b2c 156
0f163d2c
ER
157# glibc.spec didn't keep it. so won't here either.
158rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
159# behave more like glibc.spec
160ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
161ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
162ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
163
50d7b850
AM
164> $RPM_BUILD_ROOT/etc/localtime
165
85de48d2 166# header file
463fb3cd
ER
167cp -a tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
168cp -a tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 169
463fb3cd 170install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
48f17b2c
ER
171cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
172
eb9404d2
ER
173install -d $RPM_BUILD_ROOT/etc/init
174cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf
175
0eb7e566
ER
176%if %{with java}
177cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
178%endif
179
f21a80a6 180%clean
95a1ed16 181rm -rf $RPM_BUILD_ROOT
f21a80a6 182
48f17b2c
ER
183%post
184/sbin/chkconfig --add timezone
185%service timezone restart
186
187%preun
188if [ "$1" = "0" ]; then
189 /sbin/chkconfig --del timezone
e32f56d0
ER
190
191 # save for postun
192 cp -f /etc/localtime /etc/localtime.rpmsave
193fi
194
195%postun
196if [ "$1" = "0" ]; then
197 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
198 mv -f /etc/localtime{.rpmsave,}
199 fi
48f17b2c
ER
200fi
201
64a9089d
ER
202%triggerpostun -- rc-scripts < 0.4.1.4
203/sbin/chkconfig --add timezone
204
72e063bb
MB
205%triggerpostun -- tzdata < 2008b-4
206if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
207 . /etc/sysconfig/timezone
208
209 if [ -z $ZONE_INFO_AREA ]; then
210 TIMEZONE=$TIME_ZONE
211 else
212 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
213 fi
214
215 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
216
217 %service timezone restart
218fi
219
f21a80a6
PZ
220%files
221%defattr(644,root,root,755)
8d8e88cb 222%doc tzcode/README tzcode/Theory tzcode/tz-link.html
50d7b850 223%ghost /etc/localtime
48f17b2c
ER
224%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
225%attr(754,root,root) /etc/rc.d/init.d/timezone
eb9404d2 226%config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf
4747911d 227
3458d90a 228%{_datadir}/zoneinfo
33e5a5b5
ER
229%exclude %{_datadir}/zoneinfo/right
230
0eb7e566
ER
231%if %{with java}
232%files java
233%defattr(644,root,root,755)
234%{_datadir}/javazi
235%endif
236
33e5a5b5
ER
237%files zoneinfo_right
238%defattr(644,root,root,755)
239%{_datadir}/zoneinfo/right
9550cc22 240
241%files devel
85de48d2
AG
242%defattr(644,root,root,755)
243%doc tzcode/tzfile.5.txt
9550cc22 244%{_includedir}/tzfile.h
85de48d2 245%{_mandir}/man5/tzfile.5*
This page took 0.082753 seconds and 4 git commands to generate.