]> git.pld-linux.org Git - packages/tzdata.git/blobdiff - tzdata.spec
- package tzfile.h
[packages/tzdata.git] / tzdata.spec
index 006f454ba472c5e09c1a97f24642ba97b7ac5f5a..af4ff7e70df7aab4e2fe2ccab27621883cdb9ca3 100644 (file)
@@ -1,22 +1,31 @@
+#
+# Conditional build
+%bcond_without tests                   # make check
+#
+%define                tzcode_ver      2009a
+%define                tzdata_ver      2009a
 Summary:       Timezone data
 Summary(pl.UTF-8):     Dane o strefach czasowych
 Name:          tzdata
-Version:       2007g
-Release:       2
-License:       GPL
+Version:       %{tzdata_ver}
+Release:       1
+License:       Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
 Group:         Base
 Source0:       %{name}-base-0.tar.bz2
 # Source0-md5: 906a4c98cc5240f416524a256b039c42
-Source1:       ftp://elsie.nci.nih.gov/pub/%{name}%{version}.tar.gz
-# Source1-md5: 04152531a69c07b6cb08bacfd425aae1
-Source2:       ftp://elsie.nci.nih.gov/pub/tzcode%{version}.tar.gz
-# Source2-md5: a5da1f7650c541fa61f9ddd0c10b5332
+Source1:       ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz
+# Source1-md5: 979cb227a83d7fbb954611a4fb5b1949
+Source2:       ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz
+# Source2-md5: 6a20a58704c779e3006394cf38a1dc0a
 Source3:       timezone.init
 Source4:       timezone.sysconfig
+Patch0:                %{name}-test-update.patch
+URL:           http://www.twinsun.com/tz/tz-link.htm
 BuildRequires: gawk
 BuildRequires: perl-base
 BuildRequires: rpmbuild(macros) >= 1.228
 Requires(post,preun):  /sbin/chkconfig
+Requires:      /sbin/chkconfig
 Requires:      rc-scripts >= 0.4.1.4
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -48,12 +57,19 @@ No lo necesita. Encontrará los detalles en:
 Nie potrzebujesz tego. Szczegóły pod:
 <http://sources.redhat.com/ml/libc-alpha/2000-12/msg00068.html>.
 
+%package devel
+Summary: tzfile header
+Group: Development/Libraries
+
+%description devel
+
 %prep
-%setup -q -n %{name}
-mkdir %{name}%{version}
-%{__tar} xzf %{SOURCE1} -C %{name}%{version}
-mkdir tzcode%{version}
-%{__tar} xzf %{SOURCE2} -C tzcode%{version}
+%setup -qc
+mv tzdata/* .
+%{__tar} xzf %{SOURCE1} -C tzdata
+mkdir tzcode
+%{__tar} xzf %{SOURCE2} -C tzcode
+%patch0 -p1
 
 sed -e "
 s|@objpfx@|`pwd`/obj/|
@@ -61,7 +77,7 @@ s|@datadir@|%{_datadir}|
 s|@install_root@|$RPM_BUILD_ROOT|
 " Makeconfig.in > Makeconfig
 
-grep -v tz-art.htm tzcode%{version}/tz-link.htm > tzcode%{version}/tz-link.html
+grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
 
 %build
 %{__make}
@@ -69,14 +85,17 @@ grep -v tz-art.htm tzcode%{version}/tz-link.htm > tzcode%{version}/tz-link.html
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
+install -d $RPM_BUILD_ROOT%{_includedir}
 
 %{__make} install
 
+%if %{with tests}
 : ====================TESTING=========================
 %{__make} check \
        CC="%{__cc}" \
        CFLAGS="%{rpmcflags} %{rpmldflags}"
 : ====================TESTING END=====================
+%endif
 
 
 # glibc.spec didn't keep it. so won't here either.
@@ -88,6 +107,8 @@ ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
 
 > $RPM_BUILD_ROOT/etc/localtime
 
+install tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
+
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
 
@@ -101,14 +122,39 @@ rm -rf $RPM_BUILD_ROOT
 %preun
 if [ "$1" = "0" ]; then
        /sbin/chkconfig --del timezone
+
+       # save for postun
+       cp -f /etc/localtime /etc/localtime.rpmsave
+fi
+
+%postun
+if [ "$1" = "0" ]; then
+       if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then
+               mv -f /etc/localtime{.rpmsave,}
+       fi
 fi
 
 %triggerpostun -- rc-scripts < 0.4.1.4
 /sbin/chkconfig --add timezone
 
+%triggerpostun -- tzdata < 2008b-4
+if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
+       . /etc/sysconfig/timezone
+
+       if [ -z $ZONE_INFO_AREA ]; then
+               TIMEZONE=$TIME_ZONE
+       else
+               TIMEZONE=$ZONE_INFO_AREA/$TIME_ZONE
+       fi
+
+       echo "TIMEZONE=\"$TIMEZONE\"" >> /etc/sysconfig/timezone
+
+       %service timezone restart
+fi
+
 %files
 %defattr(644,root,root,755)
-%doc tzcode%{version}/README tzcode%{version}/Theory tzcode%{version}/tz-link.html
+%doc tzcode/README tzcode/Theory tzcode/tz-link.html
 %ghost /etc/localtime
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/timezone
 %attr(754,root,root) /etc/rc.d/init.d/timezone
@@ -119,3 +165,6 @@ fi
 %files zoneinfo_right
 %defattr(644,root,root,755)
 %{_datadir}/zoneinfo/right
+
+%files devel
+%{_includedir}/tzfile.h
This page took 0.040032 seconds and 4 git commands to generate.