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