]>
Commit | Line | Data |
---|---|---|
6b9abb55 JB |
1 | # |
2 | # Conditional build | |
3 | %bcond_without tests # make check | |
4 | # | |
d09d7cb1 AG |
5 | %define tzcode_ver 2008g |
6 | %define tzdata_ver 2008g | |
f21a80a6 | 7 | Summary: Timezone data |
e5477455 | 8 | Summary(pl.UTF-8): Dane o strefach czasowych |
f21a80a6 | 9 | Name: tzdata |
6b9abb55 | 10 | Version: %{tzdata_ver} |
de62f835 | 11 | Release: 1 |
6b9abb55 | 12 | License: Public Domain (database), BSD/LGPL v2.1+ (code/test suite) |
3458d90a | 13 | Group: Base |
0b5f1229 ER |
14 | Source0: %{name}-base-0.tar.bz2 |
15 | # Source0-md5: 906a4c98cc5240f416524a256b039c42 | |
6b9abb55 | 16 | Source1: ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz |
d09d7cb1 | 17 | # Source1-md5: 47d63b6f3b8ea7bd770a32dbe3c5f7a0 |
6b9abb55 | 18 | Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz |
d09d7cb1 | 19 | # Source2-md5: 1af9daa24d9f9c0ace7f9b67dc8753fa |
48f17b2c ER |
20 | Source3: timezone.init |
21 | Source4: timezone.sysconfig | |
25404fb0 | 22 | Patch0: %{name}-test-update.patch |
6b9abb55 | 23 | URL: http://www.twinsun.com/tz/tz-link.htm |
f21a80a6 | 24 | BuildRequires: gawk |
3458d90a | 25 | BuildRequires: perl-base |
48f17b2c ER |
26 | BuildRequires: rpmbuild(macros) >= 1.228 |
27 | Requires(post,preun): /sbin/chkconfig | |
0db057c4 | 28 | Requires: /sbin/chkconfig |
48f17b2c | 29 | Requires: rc-scripts >= 0.4.1.4 |
f21a80a6 | 30 | BuildArch: noarch |
95a1ed16 | 31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
f21a80a6 PZ |
32 | |
33 | %description | |
3458d90a JB |
34 | This package contains data files with rules for various timezones |
35 | around the world. | |
36 | ||
151d1751 JR |
37 | %description -l pl.UTF-8 |
38 | Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na | |
39 | całym świecie. | |
f21a80a6 | 40 | |
33e5a5b5 ER |
41 | %package zoneinfo_right |
42 | Summary: Non-POSIX (real) time zones | |
e5477455 ER |
43 | Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX) |
44 | Summary(pl.UTF-8): Nie-POSIX-owe (prawdziwe) strefy czasowe | |
33e5a5b5 | 45 | Group: Libraries |
37e6efaa | 46 | Obsoletes: glibc-zoneinfo_right |
33e5a5b5 ER |
47 | |
48 | %description zoneinfo_right | |
49 | You don't want this. Details at: | |
e3ed8f87 | 50 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 51 | |
151d1751 JR |
52 | %description zoneinfo_right -l es.UTF-8 |
53 | No lo necesita. Encontrará los detalles en: | |
e3ed8f87 | 54 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 55 | |
151d1751 JR |
56 | %description zoneinfo_right -l pl.UTF-8 |
57 | Nie potrzebujesz tego. Szczegóły pod: | |
e3ed8f87 | 58 | <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>. |
33e5a5b5 | 59 | |
f21a80a6 | 60 | %prep |
8d8e88cb ER |
61 | %setup -qc |
62 | mv tzdata/* . | |
63 | %{__tar} xzf %{SOURCE1} -C tzdata | |
64 | mkdir tzcode | |
65 | %{__tar} xzf %{SOURCE2} -C tzcode | |
25404fb0 | 66 | %patch0 -p1 |
f21a80a6 | 67 | |
0b5f1229 ER |
68 | sed -e " |
69 | s|@objpfx@|`pwd`/obj/| | |
70 | s|@datadir@|%{_datadir}| | |
71 | s|@install_root@|$RPM_BUILD_ROOT| | |
72 | " Makeconfig.in > Makeconfig | |
73 | ||
8d8e88cb | 74 | grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html |
0b5f1229 | 75 | |
f21a80a6 | 76 | %build |
3458d90a | 77 | %{__make} |
f21a80a6 PZ |
78 | |
79 | %install | |
95a1ed16 | 80 | rm -rf $RPM_BUILD_ROOT |
48f17b2c | 81 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} |
4747911d | 82 | |
3458d90a | 83 | %{__make} install |
a360159e | 84 | |
aa82ac7a | 85 | %if %{with tests} |
48f17b2c | 86 | : ====================TESTING========================= |
5db5c79b | 87 | %{__make} check \ |
88 | CC="%{__cc}" \ | |
89 | CFLAGS="%{rpmcflags} %{rpmldflags}" | |
48f17b2c | 90 | : ====================TESTING END===================== |
aa82ac7a | 91 | %endif |
48f17b2c | 92 | |
f21a80a6 | 93 | |
0f163d2c ER |
94 | # glibc.spec didn't keep it. so won't here either. |
95 | rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix | |
96 | # behave more like glibc.spec | |
97 | ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime | |
98 | ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime | |
99 | ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules | |
100 | ||
50d7b850 AM |
101 | > $RPM_BUILD_ROOT/etc/localtime |
102 | ||
48f17b2c ER |
103 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone |
104 | cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone | |
105 | ||
f21a80a6 | 106 | %clean |
95a1ed16 | 107 | rm -rf $RPM_BUILD_ROOT |
f21a80a6 | 108 | |
48f17b2c ER |
109 | %post |
110 | /sbin/chkconfig --add timezone | |
111 | %service timezone restart | |
112 | ||
113 | %preun | |
114 | if [ "$1" = "0" ]; then | |
115 | /sbin/chkconfig --del timezone | |
e32f56d0 ER |
116 | |
117 | # save for postun | |
118 | cp -f /etc/localtime /etc/localtime.rpmsave | |
119 | fi | |
120 | ||
121 | %postun | |
122 | if [ "$1" = "0" ]; then | |
123 | if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then | |
124 | mv -f /etc/localtime{.rpmsave,} | |
125 | fi | |
48f17b2c ER |
126 | fi |
127 | ||
64a9089d ER |
128 | %triggerpostun -- rc-scripts < 0.4.1.4 |
129 | /sbin/chkconfig --add timezone | |
130 | ||
72e063bb MB |
131 | %triggerpostun -- tzdata < 2008b-4 |
132 | if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then | |
133 | . /etc/sysconfig/timezone | |
134 | ||
135 | if [ -z $ZONE_INFO_AREA ]; then | |
136 | TIMEZONE=$TIME_ZONE | |
137 | else | |
138 | TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE | |
139 | fi | |
140 | ||
141 | echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone | |
142 | ||
143 | %service timezone restart | |
144 | fi | |
145 | ||
f21a80a6 PZ |
146 | %files |
147 | %defattr(644,root,root,755) | |
8d8e88cb | 148 | %doc tzcode/README tzcode/Theory tzcode/tz-link.html |
50d7b850 | 149 | %ghost /etc/localtime |
48f17b2c ER |
150 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone |
151 | %attr(754,root,root) /etc/rc.d/init.d/timezone | |
4747911d | 152 | |
3458d90a | 153 | %{_datadir}/zoneinfo |
33e5a5b5 ER |
154 | %exclude %{_datadir}/zoneinfo/right |
155 | ||
156 | %files zoneinfo_right | |
157 | %defattr(644,root,root,755) | |
158 | %{_datadir}/zoneinfo/right |