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