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