]> git.pld-linux.org Git - packages/tzdata.git/blobdiff - tzdata.spec
up to 2021e
[packages/tzdata.git] / tzdata.spec
index 633162ba7fb62c8f099a0c860a9d3bcf7998fea3..58443e175107bbd17fe3351cc47a432ff8eba49d 100644 (file)
@@ -3,42 +3,37 @@
 %bcond_without tests           # make check
 %bcond_without java            # build java subpackage
 
+%ifnarch %{x8664}
+# TODO: add more archs which pass tests
+# tests fail with 32-bit time_t; reenable after transition to 64-bit everywhere
+%undefine      with_tests
+%endif
+
 %if "%{pld_release}" == "ac"
 %ifnarch i586 i686 pentium3 pentium4 athlon %{x8664}
 %undefine      with_java
 %endif
 %endif
 
-%define                tzcode_ver      2018c
-%define                tzdata_ver      2018c
 Summary:       Timezone data
 Summary(pl.UTF-8):     Dane o strefach czasowych
 Name:          tzdata
-Version:       %{tzdata_ver}
+Version:       2021e
 Release:       1
 License:       Public Domain (database), BSD/LGPL v2.1+ (code/test suite)
 Group:         Base
-# The tzdata-base-0.tar.bz2 is a simple building infrastructure and
-# a test suite. It is occasionally updated from glibc sources, and as
-# such is under LGPL v2+, but none of this ever gets to be part of
-# final zoneinfo files.
-Source0:       %{name}-base-0.tar.bz2
-# Source0-md5: e36d2f742c22f8c8dbf0686ac9769b55
-# ftp://elsie.nci.nih.gov/pub/ has been shut down because of lawsuit
-#Source1Download: http://www.iana.org/time-zones/
-Source1:       ftp://ftp.iana.org/tz/releases/%{name}%{tzdata_ver}.tar.gz
-# Source1-md5: c412b1531adef1be7a645ab734f86acc
-#Source2Download: http://www.iana.org/time-zones/
-Source2:       ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz
-# Source2-md5: e6e0d4b2ce3fa6906f303157bed2612e
+#Source0Download: https://www.iana.org/time-zones
+Source0:       https://www.iana.org/time-zones/repository/releases/tzdb-%{version}.tar.lz
+# Source0-md5: bfd660014a16d652ebc914d88b696efc
 Source3:       timezone.init
 Source4:       timezone.sysconfig
 Source5:       javazic.tar.gz
 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
-Patch0:                %{name}-test-update.patch
+Patch0:                disable-network-tests.patch
 Patch1:                javazic-fixup.patch
 Patch2:                install.patch
 URL:           http://www.twinsun.com/tz/tz-link.htm
+BuildRequires: lzip
 BuildRequires: rpm >= 4.4.9-56
 BuildRequires: rpmbuild(macros) >= 1.623
 %if %{with java}
@@ -116,29 +111,14 @@ Header file for timezone database.
 Plik nagłówkowy bazy danych stref czasowych.
 
 %prep
-%setup -qc
-mv tzdata/* .
+%setup -qn tzdb-%{version}
 %patch0 -p1
 
-%{__tar} xzf %{SOURCE1} -C tzdata
-# don't override Makefile from base tar
-%{__mv} tzdata/Makefile{,.tzdata}
-
-install -d tzcode
-%{__tar} xzf %{SOURCE2} -C tzcode
-%patch2 -p1
-
-%{__sed} -e "
-s|@objpfx@|`pwd`/obj/|
-s|@datadir@|%{_datadir}|
-s|@install_root@|$RPM_BUILD_ROOT|
-" 'Makeconfig.in' > Makeconfig
-
-grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html
+sed -i -e '/tz-art.html/d' tz-link.html
 
 %if %{with java}
 install -d javazic
-tar zxf %{SOURCE5} -C javazic
+tar zxf %{SOURCE5} -C javazic --no-same-owner
 cd javazic
 %patch1
 
@@ -149,7 +129,7 @@ cd javazic
 # any of the -Xclasspath options, so we must go this route
 # to ensure the greatest compatibility.
 # XXX: do we want 'pld' instead of 'rht'?
-mv sun rht
+%{__mv} sun rht
 find . -type f -name '*.java' -print0 \
        | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \
                                                 -e 's:sun\.util\.:rht.util.:g'
@@ -157,24 +137,48 @@ cd -
 %endif
 
 %build
-%{__make}
+# build "fat" zoneinfo files for older parsers (like pytz)
+# which can't parse "slim" 64-bit files
+%{__make} \
+       CFLAGS="%{rpmcflags}" \
+       LDFLAGS="%{rpmldflags}" \
+       ZFLAGS="-b fat" \
+       cc="%{__cc}"
 
 %if %{with java}
 cd javazic
 %javac -source 1.5 -target 1.5 -classpath . $(find -name '*.java')
-cd ../tzdata
-%java -classpath ../javazic/ rht.tools.javazic.Main -V %{version} \
-       -d ../zoneinfo/java \
-       africa antarctica asia australasia europe northamerica pacificnew \
-       southamerica backward etcetera factory systemv \
-       ../javazic/tzdata_jdk/gmt ../javazic/tzdata_jdk/jdk11_backward
 cd ..
+
+%java -classpath javazic/ rht.tools.javazic.Main -V %{version} \
+       -d zoneinfo/java \
+       africa antarctica asia australasia europe northamerica \
+       southamerica backward etcetera factory \
+       javazic/tzdata_jdk/gmt javazic/tzdata_jdk/jdk11_backward
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
-%{__make} install
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT \
+       ZFLAGS="-b fat"
+
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/tzselect
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/zdump
+%{__rm} $RPM_BUILD_ROOT%{_sbindir}/zic
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newctime.3*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/newtzset.3*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tzselect.8*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zdump.8*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/zic.8*
+%{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/libtz.a
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-posix
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/leapseconds
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/tzdata.zi
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/zoneinfo/zone1970.tab
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/zoneinfo-leaps $RPM_BUILD_ROOT%{_datadir}/zoneinfo/right
 
 %if %{with tests}
 # test needs to be ran after "make install", as it uses installed files
@@ -185,22 +189,21 @@ install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_inclu
 : ====================TESTING END=====================
 %endif
 
-# glibc.spec didn't keep it. so won't here either.
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix
 # behave more like glibc.spec
 ln -sf %{_sysconfdir}/localtime        $RPM_BUILD_ROOT%{_datadir}/zoneinfo/localtime
 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixtime
 ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules
 
+# zic>=2020b installs localtime as hardlink to GMT, so remove first not break GMT zone files
+%{__rm} $RPM_BUILD_ROOT/etc/localtime
 > $RPM_BUILD_ROOT/etc/localtime
 
 # header file
-cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
-cp -p tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
+cp -p tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h
+cp -p tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5
 
 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone
 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone
-
 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
 
 %if %{with java}
@@ -257,7 +260,7 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc tzcode/README tzcode/tz-link.html
+%doc README 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
@@ -286,6 +289,6 @@ fi
 
 %files devel
 %defattr(644,root,root,755)
-%doc tzcode/tzfile.5.txt
+%doc tzfile.5.txt
 %{_includedir}/tzfile.h
 %{_mandir}/man5/tzfile.5*
This page took 0.112527 seconds and 4 git commands to generate.