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