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