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