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