]>
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 | ||
b10cca7f ER |
12 | %define tzcode_ver 2015f |
13 | %define tzdata_ver 2015f | |
f21a80a6 | 14 | Summary: Timezone data |
e5477455 | 15 | Summary(pl.UTF-8): Dane o strefach czasowych |
f21a80a6 | 16 | Name: tzdata |
6b9abb55 | 17 | Version: %{tzdata_ver} |
81d0589d | 18 | Release: 3 |
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 |
b10cca7f | 30 | # Source1-md5: e3b82732d20e973e48af1c6f13df9a1d |
8d9e5073 | 31 | #Source2Download: http://www.iana.org/time-zones/ |
dc58247d | 32 | Source2: ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz |
b10cca7f | 33 | # Source2-md5: 19578d432ba8b92f73406a17a9bc268d |
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 | ||
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 | |
33e5a5b5 | 80 | Group: Libraries |
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 |
8d8e88cb ER |
107 | %setup -qc |
108 | mv tzdata/* . | |
7ad9890e JB |
109 | %patch0 -p1 |
110 | ||
8d8e88cb | 111 | %{__tar} xzf %{SOURCE1} -C tzdata |
94d8c216 | 112 | # don't override Makefile from base tar |
7ad9890e JB |
113 | %{__mv} tzdata/Makefile{,.tzdata} |
114 | ||
1f4e4169 | 115 | install -d tzcode |
8d8e88cb | 116 | %{__tar} xzf %{SOURCE2} -C tzcode |
1f4e4169 | 117 | %patch2 -p1 |
f21a80a6 | 118 | |
1f4e4169 | 119 | %{__sed} -e " |
0b5f1229 ER |
120 | s|@objpfx@|`pwd`/obj/| |
121 | s|@datadir@|%{_datadir}| | |
122 | s|@install_root@|$RPM_BUILD_ROOT| | |
463fb3cd | 123 | " 'Makeconfig.in' > Makeconfig |
0b5f1229 | 124 | |
8d8e88cb | 125 | grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html |
0b5f1229 | 126 | |
0eb7e566 ER |
127 | %if %{with java} |
128 | install -d javazic | |
129 | tar zxf %{SOURCE5} -C javazic | |
130 | cd javazic | |
131 | %patch1 | |
132 | ||
133 | # Hack alert! sun.tools may be defined and installed in the | |
134 | # VM. In order to guarantee that we are using IcedTea/OpenJDK | |
135 | # for creating the zoneinfo files, rebase all the packages | |
136 | # from "sun." to "rht.". Unfortunately, gcj does not support | |
137 | # any of the -Xclasspath options, so we must go this route | |
138 | # to ensure the greatest compatibility. | |
139 | # XXX: do we want 'pld' instead of 'rht'? | |
140 | mv sun rht | |
141 | find . -type f -name '*.java' -print0 \ | |
142 | | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \ | |
143 | -e 's:sun\.util\.:rht.util.:g' | |
144 | cd - | |
145 | %endif | |
146 | ||
f21a80a6 | 147 | %build |
3458d90a | 148 | %{__make} |
f21a80a6 | 149 | |
0eb7e566 ER |
150 | %if %{with java} |
151 | cd javazic | |
152 | %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java') | |
153 | cd ../tzdata | |
154 | %java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \ | |
155 | -d ../zoneinfo/java \ | |
156 | africa antarctica asia australasia europe northamerica pacificnew \ | |
cc6b8172 | 157 | southamerica backward etcetera factory systemv \ |
0eb7e566 ER |
158 | ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward |
159 | cd .. | |
160 | %endif | |
161 | ||
f21a80a6 | 162 | %install |
95a1ed16 | 163 | rm -rf $RPM_BUILD_ROOT |
95a3c0b6 | 164 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}} |
3458d90a | 165 | %{__make} install |
a360159e | 166 | |
aa82ac7a | 167 | %if %{with tests} |
cf62b8f3 | 168 | # test needs to be ran after "make install", as it uses installed files |
48f17b2c | 169 | : ====================TESTING========================= |
5db5c79b | 170 | %{__make} check \ |
171 | CC="%{__cc}" \ | |
172 | CFLAGS="%{rpmcflags} %{rpmldflags}" | |
48f17b2c | 173 | : ====================TESTING END===================== |
aa82ac7a | 174 | %endif |
48f17b2c | 175 | |
0f163d2c | 176 | # glibc.spec didn't keep it. so won't here either. |
94d8c216 | 177 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix |
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 |
1f4e4169 ER |
186 | cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h |
187 | cp -p tzcode/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 |
48f17b2c | 191 | |
5763ae29 | 192 | ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service |
95a3c0b6 | 193 | |
0eb7e566 ER |
194 | %if %{with java} |
195 | cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi | |
196 | %endif | |
197 | ||
f21a80a6 | 198 | %clean |
95a1ed16 | 199 | rm -rf $RPM_BUILD_ROOT |
f21a80a6 | 200 | |
48f17b2c ER |
201 | %post |
202 | /sbin/chkconfig --add timezone | |
203 | %service timezone restart | |
204 | ||
205 | %preun | |
206 | if [ "$1" = "0" ]; then | |
207 | /sbin/chkconfig --del timezone | |
e32f56d0 ER |
208 | |
209 | # save for postun | |
1903f4d5 | 210 | cp -af /etc/localtime /etc/localtime.rpmsave |
e32f56d0 ER |
211 | fi |
212 | ||
213 | %postun | |
214 | if [ "$1" = "0" ]; then | |
215 | if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then | |
1903f4d5 | 216 | echo >&2 "Preserving /etc/localtime" |
e32f56d0 ER |
217 | mv -f /etc/localtime{.rpmsave,} |
218 | fi | |
48f17b2c ER |
219 | fi |
220 | ||
64a9089d ER |
221 | %triggerpostun -- rc-scripts < 0.4.1.4 |
222 | /sbin/chkconfig --add timezone | |
223 | ||
72e063bb MB |
224 | %triggerpostun -- tzdata < 2008b-4 |
225 | if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then | |
226 | . /etc/sysconfig/timezone | |
227 | ||
228 | if [ -z $ZONE_INFO_AREA ]; then | |
229 | TIMEZONE=$TIME_ZONE | |
230 | else | |
231 | TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE | |
232 | fi | |
233 | ||
234 | echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone | |
235 | ||
236 | %service timezone restart | |
237 | fi | |
238 | ||
5763ae29 JR |
239 | %triggerpostun -- tzdata < 2015f-2 |
240 | %systemd_service_disable timezone.service | |
241 | %systemd_service_stop timezone.service | |
95a3c0b6 | 242 | |
f21a80a6 PZ |
243 | %files |
244 | %defattr(644,root,root,755) | |
8d8e88cb | 245 | %doc tzcode/README tzcode/Theory tzcode/tz-link.html |
50d7b850 | 246 | %ghost /etc/localtime |
48f17b2c ER |
247 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone |
248 | %attr(754,root,root) /etc/rc.d/init.d/timezone | |
95a3c0b6 | 249 | %{systemdunitdir}/timezone.service |
4747911d | 250 | |
3458d90a | 251 | %{_datadir}/zoneinfo |
33e5a5b5 ER |
252 | %exclude %{_datadir}/zoneinfo/right |
253 | ||
0eb7e566 | 254 | %if %{with java} |
00ab1294 | 255 | %files -n java-tzdata |
0eb7e566 ER |
256 | %defattr(644,root,root,755) |
257 | %{_datadir}/javazi | |
258 | %endif | |
259 | ||
33e5a5b5 ER |
260 | %files zoneinfo_right |
261 | %defattr(644,root,root,755) | |
262 | %{_datadir}/zoneinfo/right | |
9550cc22 | 263 | |
264 | %files devel | |
85de48d2 AG |
265 | %defattr(644,root,root,755) |
266 | %doc tzcode/tzfile.5.txt | |
9550cc22 | 267 | %{_includedir}/tzfile.h |
85de48d2 | 268 | %{_mandir}/man5/tzfile.5* |