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