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