]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
up to 2023b
[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
0aaa57ae 25Version: 2023b
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
0aaa57ae 31# Source0-md5: ad922b3d13153e60abc63be6b9447ec1
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
9c28425c 42BuildRequires: rpmbuild(macros) >= 1.623
df36f3e7 43%if %{with java}
dc572f5d 44%{?use_jdk:%buildrequires_jdk}%{!?use_jdk: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
37e6efaa 92Obsoletes: glibc-zoneinfo_right
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" \
316a7be9 150 cc="%{__cc}"
f21a80a6 151
0eb7e566
ER
152%if %{with java}
153cd javazic
446a8df9 154%javac -source 1.6 -target 1.6 -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
183%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/tzdata.zi
184%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab
185%{__mv} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right
a360159e 186
aa82ac7a 187%if %{with tests}
cf62b8f3 188# test needs to be ran after "make install", as it uses installed files
48f17b2c 189: ====================TESTING=========================
5db5c79b 190%{__make} check \
191 CC="%{__cc}" \
192 CFLAGS="%{rpmcflags} %{rpmldflags}"
48f17b2c 193: ====================TESTING END=====================
aa82ac7a 194%endif
48f17b2c 195
0f163d2c
ER
196# behave more like glibc.spec
197ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
198ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
199ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
200
136ee967
JB
201# zic>=2020b installs localtime as hardlink to GMT, so remove first not break GMT zone files
202%{__rm} $RPM_BUILD_ROOT/etc/localtime
50d7b850
AM
203> $RPM_BUILD_ROOT/etc/localtime
204
85de48d2 205# header file
316a7be9
ER
206cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
207cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 208
463fb3cd 209install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
1f4e4169 210cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
5763ae29 211ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
95a3c0b6 212
0eb7e566
ER
213%if %{with java}
214cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
215%endif
216
f21a80a6 217%clean
95a1ed16 218rm -rf $RPM_BUILD_ROOT
f21a80a6 219
48f17b2c
ER
220%post
221/sbin/chkconfig --add timezone
222%service timezone restart
223
224%preun
225if [ "$1" = "0" ]; then
226 /sbin/chkconfig --del timezone
e32f56d0
ER
227
228 # save for postun
8f291ac0
ER
229 localtime=$(readlink -f /etc/localtime)
230 # cp has no dereference target option, so remove link first
231 test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave
232 cp -pf $localtime /etc/localtime.rpmsave
e32f56d0
ER
233fi
234
235%postun
236if [ "$1" = "0" ]; then
237 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
1903f4d5 238 echo >&2 "Preserving /etc/localtime"
e32f56d0
ER
239 mv -f /etc/localtime{.rpmsave,}
240 fi
48f17b2c
ER
241fi
242
64a9089d
ER
243%triggerpostun -- rc-scripts < 0.4.1.4
244/sbin/chkconfig --add timezone
245
72e063bb
MB
246%triggerpostun -- tzdata < 2008b-4
247if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
248 . /etc/sysconfig/timezone
249
250 if [ -z $ZONE_INFO_AREA ]; then
251 TIMEZONE=$TIME_ZONE
252 else
253 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
254 fi
255
256 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
257
258 %service timezone restart
259fi
260
5763ae29
JR
261%triggerpostun -- tzdata < 2015f-2
262%systemd_service_disable timezone.service
263%systemd_service_stop timezone.service
95a3c0b6 264
f21a80a6
PZ
265%files
266%defattr(644,root,root,755)
316a7be9 267%doc README tz-link.html
50d7b850 268%ghost /etc/localtime
48f17b2c
ER
269%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
270%attr(754,root,root) /etc/rc.d/init.d/timezone
95a3c0b6 271%{systemdunitdir}/timezone.service
2141fdbf
JK
272%{_datadir}/zoneinfo/localtime
273%{_datadir}/zoneinfo/posixrules
274%{_datadir}/zoneinfo/posixtime
4747911d 275
0eb7e566 276%if %{with java}
00ab1294 277%files -n java-tzdata
0eb7e566
ER
278%defattr(644,root,root,755)
279%{_datadir}/javazi
280%endif
281
a796fb22
ER
282%files zoneinfo
283%defattr(644,root,root,755)
284%{_datadir}/zoneinfo
285%exclude %{_datadir}/zoneinfo/right
2141fdbf
JK
286%exclude %{_datadir}/zoneinfo/localtime
287%exclude %{_datadir}/zoneinfo/posixrules
288%exclude %{_datadir}/zoneinfo/posixtime
a796fb22 289
33e5a5b5
ER
290%files zoneinfo_right
291%defattr(644,root,root,755)
292%{_datadir}/zoneinfo/right
9550cc22 293
294%files devel
85de48d2 295%defattr(644,root,root,755)
316a7be9 296%doc tzfile.5.txt
9550cc22 297%{_includedir}/tzfile.h
85de48d2 298%{_mandir}/man5/tzfile.5*
This page took 1.084932 seconds and 4 git commands to generate.