]>
Commit | Line | Data |
---|---|---|
6b9abb55 JB |
1 | # |
2 | # Conditional build | |
6cac3b7d | 3 | %bcond_without tests # make check |
00ab1294 | 4 | %bcond_without java # build java subpackage |
0eb7e566 | 5 | |
6cac3b7d JB |
6 | %ifnarch %{x8664} |
7 | # TODO: add more archs which pass tests | |
8 | # tests fail with 32-bit time_t; reenable after transition to 64-bit everywhere | |
9 | %undefine with_tests | |
10 | %endif | |
11 | ||
55eefd52 ER |
12 | %if "%{pld_release}" == "ac" |
13 | %ifnarch i586 i686 pentium3 pentium4 athlon %{x8664} | |
14 | %undefine with_java | |
15 | %endif | |
16 | %endif | |
17 | ||
f21a80a6 | 18 | Summary: Timezone data |
e5477455 | 19 | Summary(pl.UTF-8): Dane o strefach czasowych |
f21a80a6 | 20 | Name: tzdata |
2e6e6a1e AM |
21 | Version: 2021a |
22 | Release: 1 | |
6b9abb55 | 23 | License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite) |
3458d90a | 24 | Group: Base |
cfa167f6 ER |
25 | #Source0Download: https://www.iana.org/time-zones |
26 | Source0: https://www.iana.org/time-zones/repository/releases/tzdb-%{version}.tar.lz | |
2e6e6a1e | 27 | # Source0-md5: 1a5ab08f40850d9d67aca333016c3b4f |
48f17b2c ER |
28 | Source3: timezone.init |
29 | Source4: timezone.sysconfig | |
0eb7e566 ER |
30 | Source5: javazic.tar.gz |
31 | # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91 | |
8650fa3d | 32 | Patch0: disable-network-tests.patch |
0eb7e566 | 33 | Patch1: javazic-fixup.patch |
1f4e4169 | 34 | Patch2: install.patch |
6b9abb55 | 35 | URL: http://www.twinsun.com/tz/tz-link.htm |
55eefd52 | 36 | BuildRequires: rpm >= 4.4.9-56 |
9c28425c | 37 | BuildRequires: rpmbuild(macros) >= 1.623 |
df36f3e7 | 38 | %if %{with java} |
fd501718 | 39 | BuildRequires: jdk |
df36f3e7 ER |
40 | BuildRequires: jpackage-utils |
41 | BuildRequires: rpm-javaprov | |
42 | %endif | |
9c28425c | 43 | Requires(post,preun,postun): systemd-units >= 38 |
7e1f4700 | 44 | Requires: %{name}-zoneinfo = %{version}-%{release} |
925acaa9 | 45 | Requires: /sbin/chkconfig |
a6f970d7 | 46 | Requires: rc-scripts >= 0.4.3.0 |
9c28425c | 47 | Requires: systemd-units >= 38 |
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 | ||
a796fb22 ER |
71 | %package zoneinfo |
72 | Summary: Timezone data | |
cdd299a1 | 73 | Summary(pl.UTF-8): Dane stref czasowych |
a796fb22 ER |
74 | Group: Base |
75 | ||
76 | %description zoneinfo | |
77 | Timezone data. | |
78 | ||
cdd299a1 JB |
79 | %description zoneinfo -l pl.UTF-8 |
80 | Dane stref czasowych. | |
81 | ||
33e5a5b5 ER |
82 | %package zoneinfo_right |
83 | Summary: Non-POSIX (real) time zones | |
e5477455 ER |
84 | Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX) |
85 | Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe | |
a796fb22 | 86 | Group: Base |
37e6efaa | 87 | Obsoletes: glibc-zoneinfo_right |
33e5a5b5 ER |
88 | |
89 | %description zoneinfo_right | |
90 | You don't want this. Details at: | |
e3ed8f87 | 91 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 92 | |
151d1751 JR |
93 | %description zoneinfo_right -l es.UTF-8 |
94 | No lo necesita. Encontrará los detalles en: | |
e3ed8f87 | 95 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 96 | |
151d1751 JR |
97 | %description zoneinfo_right -l pl.UTF-8 |
98 | Nie potrzebujesz tego. Szczegóły pod: | |
e3ed8f87 | 99 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 100 | |
9550cc22 | 101 | %package devel |
caed056f JB |
102 | Summary: tzfile header file |
103 | Summary(pl.UTF-8): Plik nagłówkowy tzfile | |
85de48d2 | 104 | Group: Development/Libraries |
9550cc22 | 105 | |
106 | %description devel | |
85de48d2 AG |
107 | Header file for timezone database. |
108 | ||
109 | %description devel -l pl.UTF-8 | |
110 | Plik nagłówkowy bazy danych stref czasowych. | |
9550cc22 | 111 | |
f21a80a6 | 112 | %prep |
cfa167f6 | 113 | %setup -qn tzdb-%{version} |
8650fa3d | 114 | %patch0 -p1 |
7ad9890e | 115 | |
316a7be9 | 116 | sed -i -e '/tz-art.html/d' 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'? | |
6cac3b7d | 131 | %{__mv} sun rht |
0eb7e566 ER |
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 |
6cac3b7d JB |
139 | # build "fat" zoneinfo files for older parsers (like pytz) |
140 | # which can't parse "slim" 64-bit files | |
316a7be9 ER |
141 | %{__make} \ |
142 | CFLAGS="%{rpmcflags}" \ | |
143 | LDFLAGS="%{rpmldflags}" \ | |
6cac3b7d | 144 | ZFLAGS="-b fat" \ |
316a7be9 | 145 | cc="%{__cc}" |
f21a80a6 | 146 | |
0eb7e566 ER |
147 | %if %{with java} |
148 | cd javazic | |
149 | %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java') | |
316a7be9 ER |
150 | cd .. |
151 | ||
152 | %java -classpath javazic/ rht.tools.javazic.Main -V %{version} \ | |
153 | -d zoneinfo/java \ | |
411bc50f ER |
154 | africa antarctica asia australasia europe northamerica \ |
155 | southamerica backward etcetera factory \ | |
316a7be9 | 156 | javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward |
0eb7e566 ER |
157 | %endif |
158 | ||
f21a80a6 | 159 | %install |
95a1ed16 | 160 | rm -rf $RPM_BUILD_ROOT |
95a3c0b6 | 161 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}} |
6cac3b7d | 162 | |
316a7be9 | 163 | %{__make} install \ |
6cac3b7d JB |
164 | DESTDIR=$RPM_BUILD_ROOT \ |
165 | ZFLAGS="-b fat" | |
166 | ||
167 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/tzselect | |
168 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/zdump | |
169 | %{__rm} $RPM_BUILD_ROOT%{_sbindir}/zic | |
170 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newctime.3* | |
171 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newtzset.3* | |
172 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tzselect.8* | |
173 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zdump.8* | |
174 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zic.8* | |
175 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/libtz.a | |
176 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-posix | |
177 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/leapseconds | |
178 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/tzdata.zi | |
179 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab | |
180 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right | |
a360159e | 181 | |
aa82ac7a | 182 | %if %{with tests} |
cf62b8f3 | 183 | # test needs to be ran after "make install", as it uses installed files |
48f17b2c | 184 | : ====================TESTING========================= |
5db5c79b | 185 | %{__make} check \ |
186 | CC="%{__cc}" \ | |
187 | CFLAGS="%{rpmcflags} %{rpmldflags}" | |
48f17b2c | 188 | : ====================TESTING END===================== |
aa82ac7a | 189 | %endif |
48f17b2c | 190 | |
0f163d2c ER |
191 | # behave more like glibc.spec |
192 | ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime | |
193 | ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime | |
194 | ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules | |
195 | ||
136ee967 JB |
196 | # zic>=2020b installs localtime as hardlink to GMT, so remove first not break GMT zone files |
197 | %{__rm} $RPM_BUILD_ROOT/etc/localtime | |
50d7b850 AM |
198 | > $RPM_BUILD_ROOT/etc/localtime |
199 | ||
85de48d2 | 200 | # header file |
316a7be9 ER |
201 | cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h |
202 | cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5 | |
9550cc22 | 203 | |
463fb3cd | 204 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone |
1f4e4169 | 205 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone |
5763ae29 | 206 | ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service |
95a3c0b6 | 207 | |
0eb7e566 ER |
208 | %if %{with java} |
209 | cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi | |
210 | %endif | |
211 | ||
f21a80a6 | 212 | %clean |
95a1ed16 | 213 | rm -rf $RPM_BUILD_ROOT |
f21a80a6 | 214 | |
48f17b2c ER |
215 | %post |
216 | /sbin/chkconfig --add timezone | |
217 | %service timezone restart | |
218 | ||
219 | %preun | |
220 | if [ "$1" = "0" ]; then | |
221 | /sbin/chkconfig --del timezone | |
e32f56d0 ER |
222 | |
223 | # save for postun | |
8f291ac0 ER |
224 | localtime=$(readlink -f /etc/localtime) |
225 | # cp has no dereference target option, so remove link first | |
226 | test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave | |
227 | cp -pf $localtime /etc/localtime.rpmsave | |
e32f56d0 ER |
228 | fi |
229 | ||
230 | %postun | |
231 | if [ "$1" = "0" ]; then | |
232 | if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then | |
1903f4d5 | 233 | echo >&2 "Preserving /etc/localtime" |
e32f56d0 ER |
234 | mv -f /etc/localtime{.rpmsave,} |
235 | fi | |
48f17b2c ER |
236 | fi |
237 | ||
64a9089d ER |
238 | %triggerpostun -- rc-scripts < 0.4.1.4 |
239 | /sbin/chkconfig --add timezone | |
240 | ||
72e063bb MB |
241 | %triggerpostun -- tzdata < 2008b-4 |
242 | if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then | |
243 | . /etc/sysconfig/timezone | |
244 | ||
245 | if [ -z $ZONE_INFO_AREA ]; then | |
246 | TIMEZONE=$TIME_ZONE | |
247 | else | |
248 | TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE | |
249 | fi | |
250 | ||
251 | echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone | |
252 | ||
253 | %service timezone restart | |
254 | fi | |
255 | ||
5763ae29 JR |
256 | %triggerpostun -- tzdata < 2015f-2 |
257 | %systemd_service_disable timezone.service | |
258 | %systemd_service_stop timezone.service | |
95a3c0b6 | 259 | |
f21a80a6 PZ |
260 | %files |
261 | %defattr(644,root,root,755) | |
316a7be9 | 262 | %doc README tz-link.html |
50d7b850 | 263 | %ghost /etc/localtime |
48f17b2c ER |
264 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone |
265 | %attr(754,root,root) /etc/rc.d/init.d/timezone | |
95a3c0b6 | 266 | %{systemdunitdir}/timezone.service |
2141fdbf JK |
267 | %{_datadir}/zoneinfo/localtime |
268 | %{_datadir}/zoneinfo/posixrules | |
269 | %{_datadir}/zoneinfo/posixtime | |
4747911d | 270 | |
0eb7e566 | 271 | %if %{with java} |
00ab1294 | 272 | %files -n java-tzdata |
0eb7e566 ER |
273 | %defattr(644,root,root,755) |
274 | %{_datadir}/javazi | |
275 | %endif | |
276 | ||
a796fb22 ER |
277 | %files zoneinfo |
278 | %defattr(644,root,root,755) | |
279 | %{_datadir}/zoneinfo | |
280 | %exclude %{_datadir}/zoneinfo/right | |
2141fdbf JK |
281 | %exclude %{_datadir}/zoneinfo/localtime |
282 | %exclude %{_datadir}/zoneinfo/posixrules | |
283 | %exclude %{_datadir}/zoneinfo/posixtime | |
a796fb22 | 284 | |
33e5a5b5 ER |
285 | %files zoneinfo_right |
286 | %defattr(644,root,root,755) | |
287 | %{_datadir}/zoneinfo/right | |
9550cc22 | 288 | |
289 | %files devel | |
85de48d2 | 290 | %defattr(644,root,root,755) |
316a7be9 | 291 | %doc tzfile.5.txt |
9550cc22 | 292 | %{_includedir}/tzfile.h |
85de48d2 | 293 | %{_mandir}/man5/tzfile.5* |