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