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