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