]> git.pld-linux.org Git - packages/tzdata.git/blob - tzdata.spec
401b7f7e73cd3bd3c013ddd3b04d6ce0f2ade65d
[packages/tzdata.git] / tzdata.spec
1 #
2 # Conditional build
3 %bcond_without  tests                   # make check
4 #
5 %define tzdata_ver      2008a
6 %define tzcode_ver      2008a
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:  2100dec2f4958364d3307170e5102a6d
18 Source2:        ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz
19 # Source2-md5:  4a04c12a8ec50b0a8cfc9ebce96b07d3
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:  gawk
25 BuildRequires:  perl-base
26 BuildRequires:  rpmbuild(macros) >= 1.228
27 Requires(post,preun):   /sbin/chkconfig
28 Requires:       /sbin/chkconfig
29 Requires:       rc-scripts >= 0.4.1.4
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 This package contains data files with rules for various timezones
35 around the world.
36
37 %description -l pl.UTF-8
38 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
39 całym świecie.
40
41 %package zoneinfo_right
42 Summary:        Non-POSIX (real) time zones
43 Summary(es.UTF-8):      Zonas de tiempo reales (no de POSIX)
44 Summary(pl.UTF-8):      Nie-POSIX-owe (prawdziwe) strefy czasowe
45 Group:          Libraries
46 Obsoletes:      glibc-zoneinfo_right
47
48 %description zoneinfo_right
49 You don't want this. Details at:
50 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
51
52 %description zoneinfo_right -l es.UTF-8
53 No lo necesita. Encontrará los detalles en:
54 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
55
56 %description zoneinfo_right -l pl.UTF-8
57 Nie potrzebujesz tego. Szczegóły pod:
58 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
59
60 %prep
61 %setup -q -n %{name}
62 mkdir %{name}%{version}
63 %{__tar} xzf %{SOURCE1} -C %{name}%{version}
64 mkdir tzcode%{version}
65 %{__tar} xzf %{SOURCE2} -C tzcode%{version}
66 %patch0 -p1
67
68 sed -e "
69 s|@objpfx@|`pwd`/obj/|
70 s|@datadir@|%{_datadir}|
71 s|@install_root@|$RPM_BUILD_ROOT|
72 " Makeconfig.in > Makeconfig
73
74 grep -v tz-art.htm tzcode%{version}/tz-link.htm > tzcode%{version}/tz-link.html
75
76 %build
77 %{__make}
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
82
83 %{__make} install
84
85 %if %{with tests}
86 : ====================TESTING=========================
87 %{__make} check \
88         CC="%{__cc}" \
89         CFLAGS="%{rpmcflags} %{rpmldflags}"
90 : ====================TESTING END=====================
91 %endif
92
93
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
101 > $RPM_BUILD_ROOT/etc/localtime
102
103 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
104 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %post
110 /sbin/chkconfig --add timezone
111 %service timezone restart
112
113 %preun
114 if [ "$1" = "0" ]; then
115         /sbin/chkconfig --del timezone
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
126 fi
127
128 %triggerpostun -- rc-scripts < 0.4.1.4
129 /sbin/chkconfig --add timezone
130
131 %files
132 %defattr(644,root,root,755)
133 %doc tzcode%{version}/README tzcode%{version}/Theory tzcode%{version}/tz-link.html
134 %ghost /etc/localtime
135 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
136 %attr(754,root,root) /etc/rc.d/init.d/timezone
137
138 %{_datadir}/zoneinfo
139 %exclude %{_datadir}/zoneinfo/right
140
141 %files zoneinfo_right
142 %defattr(644,root,root,755)
143 %{_datadir}/zoneinfo/right
This page took 0.086226 seconds and 2 git commands to generate.