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