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