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