]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
- versioned Obsoletes
[packages/tzdata.git] / tzdata.spec
CommitLineData
6b9abb55
JB
1#
2# Conditional build
6cac3b7d 3%bcond_without tests # make check
00ab1294 4%bcond_without java # build java subpackage
0eb7e566 5
6cac3b7d
JB
6%ifnarch %{x8664}
7# TODO: add more archs which pass tests
8# tests fail with 32-bit time_t; reenable after transition to 64-bit everywhere
9%undefine with_tests
10%endif
11
55eefd52
ER
12%if "%{pld_release}" == "ac"
13%ifnarch i586 i686 pentium3 pentium4 athlon %{x8664}
14%undefine with_java
15%endif
16%endif
17
dc572f5d
JP
18%if %{with java}
19%{?use_default_jdk}
20%endif
21
f21a80a6 22Summary: Timezone data
e5477455 23Summary(pl.UTF-8): Dane o strefach czasowych
f21a80a6 24Name: tzdata
470bf21e 25Version: 2024a
2e6e6a1e 26Release: 1
6b9abb55 27License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
3458d90a 28Group: Base
cfa167f6
ER
29#Source0Download: https://www.iana.org/time-zones
30Source0: https://www.iana.org/time-zones/repository/releases/tzdb-%{version}.tar.lz
470bf21e 31# Source0-md5: 8e21c859fffa2839f5f8cdec3000b64e
48f17b2c
ER
32Source3: timezone.init
33Source4: timezone.sysconfig
0eb7e566
ER
34Source5: javazic.tar.gz
35# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
8650fa3d 36Patch0: disable-network-tests.patch
0eb7e566 37Patch1: javazic-fixup.patch
1f4e4169 38Patch2: install.patch
6b9abb55 39URL: http://www.twinsun.com/tz/tz-link.htm
af97ec11 40BuildRequires: lzip
55eefd52 41BuildRequires: rpm >= 4.4.9-56
a60bd286 42BuildRequires: rpmbuild(macros) >= 2.021
df36f3e7 43%if %{with java}
8e466b90 44%buildrequires_jdk
df36f3e7
ER
45BuildRequires: jpackage-utils
46BuildRequires: rpm-javaprov
47%endif
9c28425c 48Requires(post,preun,postun): systemd-units >= 38
7e1f4700 49Requires: %{name}-zoneinfo = %{version}-%{release}
925acaa9 50Requires: /sbin/chkconfig
a6f970d7 51Requires: rc-scripts >= 0.4.3.0
9c28425c 52Requires: systemd-units >= 38
f21a80a6 53BuildArch: noarch
95a1ed16 54BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
f21a80a6
PZ
55
56%description
3458d90a
JB
57This package contains data files with rules for various timezones
58around the world.
59
151d1751
JR
60%description -l pl.UTF-8
61Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
62całym świecie.
f21a80a6 63
00ab1294 64%package -n java-tzdata
0eb7e566 65Summary: Timezone data for Java
6496acd7 66Summary(pl.UTF-8): Dane stref czasowych dla Javy
0eb7e566
ER
67Group: Base
68
00ab1294 69%description -n java-tzdata
0eb7e566
ER
70This package contains timezone information for use by Java runtimes.
71
00ab1294 72%description -n java-tzdata -l pl.UTF-8
6496acd7
JB
73Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
74programów w Javie.
75
a796fb22
ER
76%package zoneinfo
77Summary: Timezone data
cdd299a1 78Summary(pl.UTF-8): Dane stref czasowych
a796fb22
ER
79Group: Base
80
81%description zoneinfo
82Timezone data.
83
cdd299a1
JB
84%description zoneinfo -l pl.UTF-8
85Dane stref czasowych.
86
33e5a5b5
ER
87%package zoneinfo_right
88Summary: Non-POSIX (real) time zones
e5477455
ER
89Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
90Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
a796fb22 91Group: Base
3aab72a3 92Obsoletes: glibc-zoneinfo_right < 6:2.3.6-6
33e5a5b5
ER
93
94%description zoneinfo_right
95You don't want this. Details at:
e3ed8f87 96<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 97
151d1751
JR
98%description zoneinfo_right -l es.UTF-8
99No lo necesita. Encontrará los detalles en:
e3ed8f87 100<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 101
151d1751
JR
102%description zoneinfo_right -l pl.UTF-8
103Nie potrzebujesz tego. Szczegóły pod:
e3ed8f87 104<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 105
9550cc22 106%package devel
caed056f
JB
107Summary: tzfile header file
108Summary(pl.UTF-8): Plik nagłówkowy tzfile
85de48d2 109Group: Development/Libraries
9550cc22 110
111%description devel
85de48d2
AG
112Header file for timezone database.
113
114%description devel -l pl.UTF-8
115Plik nagłówkowy bazy danych stref czasowych.
9550cc22 116
f21a80a6 117%prep
cfa167f6 118%setup -qn tzdb-%{version}
8650fa3d 119%patch0 -p1
7ad9890e 120
316a7be9 121sed -i -e '/tz-art.html/d' tz-link.html
0b5f1229 122
0eb7e566
ER
123%if %{with java}
124install -d javazic
af97ec11 125tar zxf %{SOURCE5} -C javazic --no-same-owner
0eb7e566
ER
126cd javazic
127%patch1
128
129# Hack alert! sun.tools may be defined and installed in the
130# VM. In order to guarantee that we are using IcedTea/OpenJDK
131# for creating the zoneinfo files, rebase all the packages
132# from "sun." to "rht.". Unfortunately, gcj does not support
133# any of the -Xclasspath options, so we must go this route
134# to ensure the greatest compatibility.
135# XXX: do we want 'pld' instead of 'rht'?
6cac3b7d 136%{__mv} sun rht
0eb7e566
ER
137find . -type f -name '*.java' -print0 \
138 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
139 -e 's:sun\.util\.:rht.util.:g'
140cd -
141%endif
142
f21a80a6 143%build
6cac3b7d
JB
144# build "fat" zoneinfo files for older parsers (like pytz)
145# which can't parse "slim" 64-bit files
316a7be9
ER
146%{__make} \
147 CFLAGS="%{rpmcflags}" \
148 LDFLAGS="%{rpmldflags}" \
6cac3b7d 149 ZFLAGS="-b fat" \
25517180 150 CC="%{__cc}"
f21a80a6 151
0eb7e566
ER
152%if %{with java}
153cd javazic
7a0a3cc2 154%javac -source 1.7 -target 1.7 -classpath . $(find -name '*.java')
316a7be9
ER
155cd ..
156
157%java -classpath javazic/ rht.tools.javazic.Main -V %{version} \
158 -d zoneinfo/java \
411bc50f
ER
159 africa antarctica asia australasia europe northamerica \
160 southamerica backward etcetera factory \
316a7be9 161 javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward
0eb7e566
ER
162%endif
163
f21a80a6 164%install
95a1ed16 165rm -rf $RPM_BUILD_ROOT
95a3c0b6 166install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
6cac3b7d 167
316a7be9 168%{__make} install \
6cac3b7d
JB
169 DESTDIR=$RPM_BUILD_ROOT \
170 ZFLAGS="-b fat"
171
172%{__rm} $RPM_BUILD_ROOT%{_bindir}/tzselect
173%{__rm} $RPM_BUILD_ROOT%{_bindir}/zdump
174%{__rm} $RPM_BUILD_ROOT%{_sbindir}/zic
175%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newctime.3*
176%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newtzset.3*
177%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tzselect.8*
178%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zdump.8*
179%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zic.8*
180%{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/libtz.a
181%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-posix
182%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/leapseconds
6cac3b7d
JB
183%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab
184%{__mv} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right
a360159e 185
aa82ac7a 186%if %{with tests}
cf62b8f3 187# test needs to be ran after "make install", as it uses installed files
48f17b2c 188: ====================TESTING=========================
5db5c79b 189%{__make} check \
190 CC="%{__cc}" \
191 CFLAGS="%{rpmcflags} %{rpmldflags}"
48f17b2c 192: ====================TESTING END=====================
aa82ac7a 193%endif
48f17b2c 194
0f163d2c
ER
195# behave more like glibc.spec
196ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
197ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
198ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
199
136ee967
JB
200# zic>=2020b installs localtime as hardlink to GMT, so remove first not break GMT zone files
201%{__rm} $RPM_BUILD_ROOT/etc/localtime
50d7b850
AM
202> $RPM_BUILD_ROOT/etc/localtime
203
85de48d2 204# header file
316a7be9
ER
205cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
206cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 207
463fb3cd 208install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
1f4e4169 209cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
5763ae29 210ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
95a3c0b6 211
0eb7e566
ER
212%if %{with java}
213cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
214%endif
215
f21a80a6 216%clean
95a1ed16 217rm -rf $RPM_BUILD_ROOT
f21a80a6 218
48f17b2c
ER
219%post
220/sbin/chkconfig --add timezone
221%service timezone restart
222
223%preun
224if [ "$1" = "0" ]; then
225 /sbin/chkconfig --del timezone
e32f56d0
ER
226
227 # save for postun
8f291ac0
ER
228 localtime=$(readlink -f /etc/localtime)
229 # cp has no dereference target option, so remove link first
230 test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave
231 cp -pf $localtime /etc/localtime.rpmsave
e32f56d0
ER
232fi
233
234%postun
235if [ "$1" = "0" ]; then
236 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
1903f4d5 237 echo >&2 "Preserving /etc/localtime"
e32f56d0
ER
238 mv -f /etc/localtime{.rpmsave,}
239 fi
48f17b2c
ER
240fi
241
64a9089d
ER
242%triggerpostun -- rc-scripts < 0.4.1.4
243/sbin/chkconfig --add timezone
244
72e063bb
MB
245%triggerpostun -- tzdata < 2008b-4
246if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
247 . /etc/sysconfig/timezone
248
249 if [ -z $ZONE_INFO_AREA ]; then
250 TIMEZONE=$TIME_ZONE
251 else
252 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
253 fi
254
255 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
256
257 %service timezone restart
258fi
259
5763ae29
JR
260%triggerpostun -- tzdata < 2015f-2
261%systemd_service_disable timezone.service
262%systemd_service_stop timezone.service
95a3c0b6 263
f21a80a6
PZ
264%files
265%defattr(644,root,root,755)
316a7be9 266%doc README tz-link.html
50d7b850 267%ghost /etc/localtime
48f17b2c
ER
268%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
269%attr(754,root,root) /etc/rc.d/init.d/timezone
95a3c0b6 270%{systemdunitdir}/timezone.service
2141fdbf
JK
271%{_datadir}/zoneinfo/localtime
272%{_datadir}/zoneinfo/posixrules
273%{_datadir}/zoneinfo/posixtime
4747911d 274
0eb7e566 275%if %{with java}
00ab1294 276%files -n java-tzdata
0eb7e566
ER
277%defattr(644,root,root,755)
278%{_datadir}/javazi
279%endif
280
a796fb22
ER
281%files zoneinfo
282%defattr(644,root,root,755)
283%{_datadir}/zoneinfo
284%exclude %{_datadir}/zoneinfo/right
2141fdbf
JK
285%exclude %{_datadir}/zoneinfo/localtime
286%exclude %{_datadir}/zoneinfo/posixrules
287%exclude %{_datadir}/zoneinfo/posixtime
a796fb22 288
33e5a5b5
ER
289%files zoneinfo_right
290%defattr(644,root,root,755)
291%{_datadir}/zoneinfo/right
9550cc22 292
293%files devel
85de48d2 294%defattr(644,root,root,755)
316a7be9 295%doc tzfile.5.txt
9550cc22 296%{_includedir}/tzfile.h
85de48d2 297%{_mandir}/man5/tzfile.5*
This page took 0.386142 seconds and 5 git commands to generate.