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