]> git.pld-linux.org Git - packages/tzdata.git/blob - tzdata.spec
- added tests bcond
[packages/tzdata.git] / tzdata.spec
1 %define _tzdata_ver     2007i
2 %define _tzcode_ver     2007h
3 %bcond_without  tests
4 Summary:        Timezone data
5 Summary(pl.UTF-8):      Dane o strefach czasowych
6 Name:           tzdata
7 Version:        %{_tzdata_ver}
8 Release:        1
9 License:        GPL
10 Group:          Base
11 Source0:        %{name}-base-0.tar.bz2
12 # Source0-md5:  906a4c98cc5240f416524a256b039c42
13 Source1:        ftp://elsie.nci.nih.gov/pub/%{name}%{_tzdata_ver}.tar.gz
14 # Source1-md5:  bfe68c92dbe3726676063bdb14931b8b
15 Source2:        ftp://elsie.nci.nih.gov/pub/tzcode%{_tzcode_ver}.tar.gz
16 # Source2-md5:  e3d9b770e2a74bcddb6aac57f699c961
17 Source3:        timezone.init
18 Source4:        timezone.sysconfig
19 BuildRequires:  gawk
20 BuildRequires:  perl-base
21 BuildRequires:  rpmbuild(macros) >= 1.228
22 Requires(post,preun):   /sbin/chkconfig
23 Requires:       rc-scripts >= 0.4.1.4
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 This package contains data files with rules for various timezones
29 around the world.
30
31 %description -l pl.UTF-8
32 Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na
33 całym świecie.
34
35 %package zoneinfo_right
36 Summary:        Non-POSIX (real) time zones
37 Summary(es.UTF-8):      Zonas de tiempo reales (no de POSIX)
38 Summary(pl.UTF-8):      Nie-POSIX-owe (prawdziwe) strefy czasowe
39 Group:          Libraries
40 Obsoletes:      glibc-zoneinfo_right
41
42 %description zoneinfo_right
43 You don't want this. Details at:
44 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
45
46 %description zoneinfo_right -l es.UTF-8
47 No lo necesita. Encontrará los detalles en:
48 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
49
50 %description zoneinfo_right -l pl.UTF-8
51 Nie potrzebujesz tego. Szczegóły pod:
52 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
53
54 %prep
55 %setup -q -n %{name}
56 mkdir %{name}%{version}
57 %{__tar} xzf %{SOURCE1} -C %{name}%{version}
58 mkdir tzcode%{version}
59 %{__tar} xzf %{SOURCE2} -C tzcode%{version}
60
61 sed -e "
62 s|@objpfx@|`pwd`/obj/|
63 s|@datadir@|%{_datadir}|
64 s|@install_root@|$RPM_BUILD_ROOT|
65 " Makeconfig.in > Makeconfig
66
67 grep -v tz-art.htm tzcode%{version}/tz-link.htm > tzcode%{version}/tz-link.html
68
69 %build
70 %{__make}
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
74 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
75
76 %{__make} install
77
78 %if %{with tests}
79 : ====================TESTING=========================
80 %{__make} check \
81         CC="%{__cc}" \
82         CFLAGS="%{rpmcflags} %{rpmldflags}"
83 : ====================TESTING END=====================
84 %endif
85
86
87 # glibc.spec didn't keep it. so won't here either.
88 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
89 # behave more like glibc.spec
90 ln -sf %{_sysconfdir}/localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
91 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
92 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
93
94 > $RPM_BUILD_ROOT/etc/localtime
95
96 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
97 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %post
103 /sbin/chkconfig --add timezone
104 %service timezone restart
105
106 %preun
107 if [ "$1" = "0" ]; then
108         /sbin/chkconfig --del timezone
109 fi
110
111 %triggerpostun -- rc-scripts < 0.4.1.4
112 /sbin/chkconfig --add timezone
113
114 %files
115 %defattr(644,root,root,755)
116 %doc tzcode%{version}/README tzcode%{version}/Theory tzcode%{version}/tz-link.html
117 %ghost /etc/localtime
118 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
119 %attr(754,root,root) /etc/rc.d/init.d/timezone
120
121 %{_datadir}/zoneinfo
122 %exclude %{_datadir}/zoneinfo/right
123
124 %files zoneinfo_right
125 %defattr(644,root,root,755)
126 %{_datadir}/zoneinfo/right
This page took 0.089013 seconds and 3 git commands to generate.