]> git.pld-linux.org Git - packages/tzdata.git/blame - tzdata.spec
- print note that /etc/localtime is preserved if you uninstall the package
[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
e996ee14
ER
12%define tzcode_ver 2012a
13%define tzdata_ver 2012a
f21a80a6 14Summary: Timezone data
e5477455 15Summary(pl.UTF-8): Dane o strefach czasowych
f21a80a6 16Name: tzdata
6b9abb55 17Version: %{tzdata_ver}
4ec0d6d1 18Release: 2
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
e996ee14 30# Source1-md5: cc43867f4768e5c2e8315d9b3cac62ed
8d9e5073 31#Source2Download: http://www.iana.org/time-zones/
fac32d1c 32Source2: http://www.iana.org/time-zones/repository/releases/tzcode%{tzcode_ver}.tar.gz
e996ee14 33# Source2-md5: a72bb8c29893ee3bfd1101aca29d4064
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
df36f3e7
ER
45BuildRequires: rpmbuild(macros) >= 1.300
46%if %{with java}
fd501718 47BuildRequires: jdk
df36f3e7
ER
48BuildRequires: jpackage-utils
49BuildRequires: rpm-javaprov
50%endif
925acaa9 51Requires: /sbin/chkconfig
a6f970d7 52Requires: rc-scripts >= 0.4.3.0
f21a80a6 53BuildArch: noarch
95a1ed16 54BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
f21a80a6
PZ
55
56%description
3458d90a
JB
57This package contains data files with rules for various timezones
58around the world.
59
151d1751
JR
60%description -l pl.UTF-8
61Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
62całym świecie.
f21a80a6 63
00ab1294 64%package -n java-tzdata
0eb7e566 65Summary: Timezone data for Java
6496acd7 66Summary(pl.UTF-8): Dane stref czasowych dla Javy
0eb7e566
ER
67Group: Base
68
00ab1294 69%description -n java-tzdata
0eb7e566
ER
70This package contains timezone information for use by Java runtimes.
71
00ab1294 72%description -n java-tzdata -l pl.UTF-8
6496acd7
JB
73Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla
74programów w Javie.
75
33e5a5b5
ER
76%package zoneinfo_right
77Summary: Non-POSIX (real) time zones
e5477455
ER
78Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX)
79Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe
33e5a5b5 80Group: Libraries
37e6efaa 81Obsoletes: glibc-zoneinfo_right
33e5a5b5
ER
82
83%description zoneinfo_right
84You don't want this. Details at:
e3ed8f87 85<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 86
151d1751
JR
87%description zoneinfo_right -l es.UTF-8
88No lo necesita. Encontrará los detalles en:
e3ed8f87 89<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 90
151d1751
JR
91%description zoneinfo_right -l pl.UTF-8
92Nie potrzebujesz tego. Szczegóły pod:
e3ed8f87 93<http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
33e5a5b5 94
9550cc22 95%package devel
caed056f
JB
96Summary: tzfile header file
97Summary(pl.UTF-8): Plik nagłówkowy tzfile
85de48d2 98Group: Development/Libraries
9550cc22 99
100%description devel
85de48d2
AG
101Header file for timezone database.
102
103%description devel -l pl.UTF-8
104Plik nagłówkowy bazy danych stref czasowych.
9550cc22 105
f21a80a6 106%prep
8d8e88cb
ER
107%setup -qc
108mv tzdata/* .
109%{__tar} xzf %{SOURCE1} -C tzdata
1f4e4169 110install -d tzcode
8d8e88cb 111%{__tar} xzf %{SOURCE2} -C tzcode
1f4e4169 112%patch2 -p1
f21a80a6 113
1f4e4169 114%{__sed} -e "
0b5f1229
ER
115s|@objpfx@|`pwd`/obj/|
116s|@datadir@|%{_datadir}|
117s|@install_root@|$RPM_BUILD_ROOT|
463fb3cd 118" 'Makeconfig.in' > Makeconfig
0b5f1229 119
8d8e88cb 120grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
0b5f1229 121
0eb7e566
ER
122%if %{with java}
123install -d javazic
124tar zxf %{SOURCE5} -C javazic
125cd javazic
126%patch1
127
128# Hack alert! sun.tools may be defined and installed in the
129# VM. In order to guarantee that we are using IcedTea/OpenJDK
130# for creating the zoneinfo files, rebase all the packages
131# from "sun." to "rht.". Unfortunately, gcj does not support
132# any of the -Xclasspath options, so we must go this route
133# to ensure the greatest compatibility.
134# XXX: do we want 'pld' instead of 'rht'?
135mv sun rht
136find . -type f -name '*.java' -print0 \
137 | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
138 -e 's:sun\.util\.:rht.util.:g'
139cd -
140%endif
141
f21a80a6 142%build
3458d90a 143%{__make}
f21a80a6 144
0eb7e566
ER
145%if %{with java}
146cd javazic
147%javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
148cd ../tzdata
149%java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
150 -d ../zoneinfo/java \
151 africa antarctica asia australasia europe northamerica pacificnew \
152 southamerica backward etcetera solar87 solar88 solar89 systemv \
153 ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
154cd ..
155%endif
156
f21a80a6 157%install
95a1ed16 158rm -rf $RPM_BUILD_ROOT
95a3c0b6 159install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
3458d90a 160%{__make} install
a360159e 161
aa82ac7a 162%if %{with tests}
cf62b8f3 163# test needs to be ran after "make install", as it uses installed files
48f17b2c 164: ====================TESTING=========================
5db5c79b 165%{__make} check \
166 CC="%{__cc}" \
167 CFLAGS="%{rpmcflags} %{rpmldflags}"
48f17b2c 168: ====================TESTING END=====================
aa82ac7a 169%endif
48f17b2c 170
0f163d2c
ER
171# glibc.spec didn't keep it. so won't here either.
172rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
173# behave more like glibc.spec
174ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
175ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
176ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
177
50d7b850
AM
178> $RPM_BUILD_ROOT/etc/localtime
179
85de48d2 180# header file
1f4e4169
ER
181cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
182cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
9550cc22 183
463fb3cd 184install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
1f4e4169 185cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
48f17b2c 186
eb9404d2
ER
187install -d $RPM_BUILD_ROOT/etc/init
188cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf
189
95a3c0b6
JR
190install -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
191install -p %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/pld-timezone
192
0eb7e566
ER
193%if %{with java}
194cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
195%endif
196
f21a80a6 197%clean
95a1ed16 198rm -rf $RPM_BUILD_ROOT
f21a80a6 199
48f17b2c
ER
200%post
201/sbin/chkconfig --add timezone
202%service timezone restart
95a3c0b6 203%systemd_post timezone.service
48f17b2c
ER
204
205%preun
206if [ "$1" = "0" ]; then
207 /sbin/chkconfig --del timezone
e32f56d0
ER
208
209 # save for postun
1903f4d5 210 cp -af /etc/localtime /etc/localtime.rpmsave
e32f56d0 211fi
95a3c0b6 212%systemd_preun timezone.service
e32f56d0
ER
213
214%postun
215if [ "$1" = "0" ]; then
216 if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
1903f4d5 217 echo >&2 "Preserving /etc/localtime"
e32f56d0
ER
218 mv -f /etc/localtime{.rpmsave,}
219 fi
48f17b2c 220fi
95a3c0b6 221%systemd_reload
48f17b2c 222
64a9089d
ER
223%triggerpostun -- rc-scripts < 0.4.1.4
224/sbin/chkconfig --add timezone
225
72e063bb
MB
226%triggerpostun -- tzdata < 2008b-4
227if ! 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
239fi
240
95a3c0b6
JR
241%triggerpostun -- tzdata < 2012a-2
242%systemd_trigger timezone.service
243
f21a80a6
PZ
244%files
245%defattr(644,root,root,755)
8d8e88cb 246%doc tzcode/README tzcode/Theory tzcode/tz-link.html
50d7b850 247%ghost /etc/localtime
48f17b2c
ER
248%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
249%attr(754,root,root) /etc/rc.d/init.d/timezone
eb9404d2 250%config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf
95a3c0b6
JR
251%{systemdunitdir}/timezone.service
252%attr(755,root,root) /lib/systemd/pld-timezone
4747911d 253
3458d90a 254%{_datadir}/zoneinfo
33e5a5b5
ER
255%exclude %{_datadir}/zoneinfo/right
256
0eb7e566 257%if %{with java}
00ab1294 258%files -n java-tzdata
0eb7e566
ER
259%defattr(644,root,root,755)
260%{_datadir}/javazi
261%endif
262
33e5a5b5
ER
263%files zoneinfo_right
264%defattr(644,root,root,755)
265%{_datadir}/zoneinfo/right
9550cc22 266
267%files devel
85de48d2
AG
268%defattr(644,root,root,755)
269%doc tzcode/tzfile.5.txt
9550cc22 270%{_includedir}/tzfile.h
85de48d2 271%{_mandir}/man5/tzfile.5*
This page took 0.12207 seconds and 4 git commands to generate.