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