]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
up to 2016g
[packages/tzdata.git] / tzdata.spec
CommitLineData
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
b4225a0f
ER
12%define tzcode_ver 2016g
13%define tzdata_ver 2016g
f21a80a6 14Summary: Timezone data
e5477455 15Summary(pl.UTF-8): Dane o strefach czasowych
f21a80a6 16Name: tzdata
6b9abb55 17Version: %{tzdata_ver}
d71c58ab 18Release: 1
6b9abb55 19License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
3458d90a 20Group: 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 25Source0: %{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 29Source1: ftp://ftp.iana.org/tz/releases/%{name}%{tzdata_ver}.tar.gz
b4225a0f 30# Source1-md5: 3c7e97ec8527211104d27cc1d97a23de
8d9e5073 31#Source2Download: http://www.iana.org/time-zones/
dc58247d 32Source2: ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz
b4225a0f 33# Source2-md5: f89867013676e3cb9544be2df7d36a91
48f17b2c
ER
34Source3: timezone.init
35Source4: timezone.sysconfig
0eb7e566
ER
36Source5: javazic.tar.gz
37# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
7ad9890e 38Patch0: %{name}-test-update.patch
0eb7e566 39Patch1: javazic-fixup.patch
1f4e4169 40Patch2: install.patch
6b9abb55 41URL: http://www.twinsun.com/tz/tz-link.htm
55eefd52 42BuildRequires: rpm >= 4.4.9-56
9c28425c 43BuildRequires: rpmbuild(macros) >= 1.623
df36f3e7 44%if %{with java}
fd501718 45BuildRequires: jdk
df36f3e7
ER
46BuildRequires: jpackage-utils
47BuildRequires: rpm-javaprov
48%endif
9c28425c 49Requires(post,preun,postun): systemd-units >= 38
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
33e5a5b5
ER
76%package zoneinfo_right
77Summary: Non-POSIX (real) time zones
e5477455
ER
78Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
79Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
33e5a5b5 80Group: Libraries
37e6efaa 81Obsoletes: glibc-zoneinfo_right
33e5a5b5
ER
82
83%description zoneinfo_right
84You 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
88No 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
92Nie 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
96Summary: tzfile header file
97Summary(pl.UTF-8): Plik nagłówkowy tzfile
85de48d2 98Group: Development/Libraries
9550cc22 99
100%description devel
85de48d2
AG
101Header file for timezone database.
102
103%description devel -l pl.UTF-8
104Plik nagłówkowy bazy danych stref czasowych.
9550cc22 105
f21a80a6 106%prep
8d8e88cb
ER
107%setup -qc
108mv 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 115install -d tzcode
8d8e88cb 116%{__tar} xzf %{SOURCE2} -C tzcode
1f4e4169 117%patch2 -p1
f21a80a6 118
1f4e4169 119%{__sed} -e "
0b5f1229
ER
120s|@objpfx@|`pwd`/obj/|
121s|@datadir@|%{_datadir}|
122s|@install_root@|$RPM_BUILD_ROOT|
463fb3cd 123" 'Makeconfig.in' > Makeconfig
0b5f1229 124
8d8e88cb 125grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
0b5f1229 126
0eb7e566
ER
127%if %{with java}
128install -d javazic
129tar zxf %{SOURCE5} -C javazic
130cd 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'?
140mv sun rht
141find . -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'
144cd -
145%endif
146
f21a80a6 147%build
3458d90a 148%{__make}
f21a80a6 149
0eb7e566
ER
150%if %{with java}
151cd javazic
152%javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
153cd ../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
159cd ..
160%endif
161
f21a80a6 162%install
95a1ed16 163rm -rf $RPM_BUILD_ROOT
95a3c0b6 164install -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
179ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
180ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
181ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
182
50d7b850
AM
183> $RPM_BUILD_ROOT/etc/localtime
184
85de48d2 185# header file
1f4e4169
ER
186cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
187cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 188
463fb3cd 189install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
1f4e4169 190cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
48f17b2c 191
5763ae29 192ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
95a3c0b6 193
0eb7e566
ER
194%if %{with java}
195cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
196%endif
197
f21a80a6 198%clean
95a1ed16 199rm -rf $RPM_BUILD_ROOT
f21a80a6 200
48f17b2c
ER
201%post
202/sbin/chkconfig --add timezone
203%service timezone restart
204
205%preun
206if [ "$1" = "0" ]; then
207 /sbin/chkconfig --del timezone
e32f56d0
ER
208
209 # save for postun
8f291ac0
ER
210 localtime=$(readlink -f /etc/localtime)
211 # cp has no dereference target option, so remove link first
212 test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave
213 cp -pf $localtime /etc/localtime.rpmsave
e32f56d0
ER
214fi
215
216%postun
217if [ "$1" = "0" ]; then
218 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
1903f4d5 219 echo >&2 "Preserving /etc/localtime"
e32f56d0
ER
220 mv -f /etc/localtime{.rpmsave,}
221 fi
48f17b2c
ER
222fi
223
64a9089d
ER
224%triggerpostun -- rc-scripts < 0.4.1.4
225/sbin/chkconfig --add timezone
226
72e063bb
MB
227%triggerpostun -- tzdata < 2008b-4
228if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
229 . /etc/sysconfig/timezone
230
231 if [ -z $ZONE_INFO_AREA ]; then
232 TIMEZONE=$TIME_ZONE
233 else
234 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
235 fi
236
237 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
238
239 %service timezone restart
240fi
241
5763ae29
JR
242%triggerpostun -- tzdata < 2015f-2
243%systemd_service_disable timezone.service
244%systemd_service_stop timezone.service
95a3c0b6 245
f21a80a6
PZ
246%files
247%defattr(644,root,root,755)
8d8e88cb 248%doc tzcode/README tzcode/Theory tzcode/tz-link.html
50d7b850 249%ghost /etc/localtime
48f17b2c
ER
250%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
251%attr(754,root,root) /etc/rc.d/init.d/timezone
95a3c0b6 252%{systemdunitdir}/timezone.service
4747911d 253
3458d90a 254%{_datadir}/zoneinfo
33e5a5b5
ER
255%exclude %{_datadir}/zoneinfo/right
256
0eb7e566 257%if %{with java}
00ab1294 258%files -n java-tzdata
0eb7e566
ER
259%defattr(644,root,root,755)
260%{_datadir}/javazi
261%endif
262
33e5a5b5
ER
263%files zoneinfo_right
264%defattr(644,root,root,755)
265%{_datadir}/zoneinfo/right
9550cc22 266
267%files devel
85de48d2
AG
268%defattr(644,root,root,755)
269%doc tzcode/tzfile.5.txt
9550cc22 270%{_includedir}/tzfile.h
85de48d2 271%{_mandir}/man5/tzfile.5*
This page took 0.196487 seconds and 4 git commands to generate.