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