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