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