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