]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
- tzcode 2012b, tzdata 2012c
[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
6ef75a92
ER
12%define tzcode_ver 2012b
13%define tzdata_ver 2012c
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/
fac32d1c 29Source1: http://www.iana.org/time-zones/repository/releases/%{name}%{tzdata_ver}.tar.gz
6ef75a92 30# Source1-md5: cfdc2710bd05c26dbd624441d57028f6
8d9e5073 31#Source2Download: http://www.iana.org/time-zones/
fac32d1c 32Source2: http://www.iana.org/time-zones/repository/releases/tzcode%{tzcode_ver}.tar.gz
6ef75a92 33# Source2-md5: 6137322ffd36e1fd5128885be1c57008
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
1f4e4169 112install -d tzcode
8d8e88cb 113%{__tar} xzf %{SOURCE2} -C tzcode
1f4e4169 114%patch2 -p1
f21a80a6 115
1f4e4169 116%{__sed} -e "
0b5f1229
ER
117s|@objpfx@|`pwd`/obj/|
118s|@datadir@|%{_datadir}|
119s|@install_root@|$RPM_BUILD_ROOT|
463fb3cd 120" 'Makeconfig.in' > Makeconfig
0b5f1229 121
8d8e88cb 122grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
0b5f1229 123
0eb7e566
ER
124%if %{with java}
125install -d javazic
126tar zxf %{SOURCE5} -C javazic
127cd javazic
128%patch1
129
130# Hack alert! sun.tools may be defined and installed in the
131# VM. In order to guarantee that we are using IcedTea/OpenJDK
132# for creating the zoneinfo files, rebase all the packages
133# from "sun." to "rht.". Unfortunately, gcj does not support
134# any of the -Xclasspath options, so we must go this route
135# to ensure the greatest compatibility.
136# XXX: do we want 'pld' instead of 'rht'?
137mv sun rht
138find . -type f -name '*.java' -print0 \
139 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
140 -e 's:sun\.util\.:rht.util.:g'
141cd -
142%endif
143
f21a80a6 144%build
3458d90a 145%{__make}
f21a80a6 146
0eb7e566
ER
147%if %{with java}
148cd javazic
149%javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
150cd ../tzdata
151%java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
152 -d ../zoneinfo/java \
153 africa antarctica asia australasia europe northamerica pacificnew \
154 southamerica backward etcetera solar87 solar88 solar89 systemv \
155 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
156cd ..
157%endif
158
f21a80a6 159%install
95a1ed16 160rm -rf $RPM_BUILD_ROOT
95a3c0b6 161install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
3458d90a 162%{__make} install
a360159e 163
aa82ac7a 164%if %{with tests}
cf62b8f3 165# test needs to be ran after "make install", as it uses installed files
48f17b2c 166: ====================TESTING=========================
5db5c79b 167%{__make} check \
168 CC="%{__cc}" \
169 CFLAGS="%{rpmcflags} %{rpmldflags}"
48f17b2c 170: ====================TESTING END=====================
aa82ac7a 171%endif
48f17b2c 172
0f163d2c
ER
173# glibc.spec didn't keep it. so won't here either.
174rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
175# behave more like glibc.spec
176ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
177ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
178ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
179
50d7b850
AM
180> $RPM_BUILD_ROOT/etc/localtime
181
85de48d2 182# header file
1f4e4169
ER
183cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
184cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 185
463fb3cd 186install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
1f4e4169 187cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
48f17b2c 188
eb9404d2
ER
189install -d $RPM_BUILD_ROOT/etc/init
190cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf
191
95a3c0b6
JR
192install -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
193install -p %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/pld-timezone
194
0eb7e566
ER
195%if %{with java}
196cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
197%endif
198
f21a80a6 199%clean
95a1ed16 200rm -rf $RPM_BUILD_ROOT
f21a80a6 201
48f17b2c
ER
202%post
203/sbin/chkconfig --add timezone
204%service timezone restart
95a3c0b6 205%systemd_post timezone.service
48f17b2c
ER
206
207%preun
208if [ "$1" = "0" ]; then
209 /sbin/chkconfig --del timezone
e32f56d0
ER
210
211 # save for postun
1903f4d5 212 cp -af /etc/localtime /etc/localtime.rpmsave
e32f56d0 213fi
95a3c0b6 214%systemd_preun timezone.service
e32f56d0
ER
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 222fi
95a3c0b6 223%systemd_reload
48f17b2c 224
64a9089d
ER
225%triggerpostun -- rc-scripts < 0.4.1.4
226/sbin/chkconfig --add timezone
227
72e063bb
MB
228%triggerpostun -- tzdata < 2008b-4
229if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
230 . /etc/sysconfig/timezone
231
232 if [ -z $ZONE_INFO_AREA ]; then
233 TIMEZONE=$TIME_ZONE
234 else
235 TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
236 fi
237
238 echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
239
240 %service timezone restart
241fi
242
95a3c0b6
JR
243%triggerpostun -- tzdata < 2012a-2
244%systemd_trigger timezone.service
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
eb9404d2 252%config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf
95a3c0b6
JR
253%{systemdunitdir}/timezone.service
254%attr(755,root,root) /lib/systemd/pld-timezone
4747911d 255
3458d90a 256%{_datadir}/zoneinfo
33e5a5b5
ER
257%exclude %{_datadir}/zoneinfo/right
258
0eb7e566 259%if %{with java}
00ab1294 260%files -n java-tzdata
0eb7e566
ER
261%defattr(644,root,root,755)
262%{_datadir}/javazi
263%endif
264
33e5a5b5
ER
265%files zoneinfo_right
266%defattr(644,root,root,755)
267%{_datadir}/zoneinfo/right
9550cc22 268
269%files devel
85de48d2
AG
270%defattr(644,root,root,755)
271%doc tzcode/tzfile.5.txt
9550cc22 272%{_includedir}/tzfile.h
85de48d2 273%{_mandir}/man5/tzfile.5*
This page took 0.106481 seconds and 4 git commands to generate.