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