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