X-Git-Url: http://git.pld-linux.org/?p=packages%2Ftzdata.git;a=blobdiff_plain;f=tzdata.spec;h=eabe5d459ad33cde3a170dd1cfbbf07f070b4044;hp=af4ff7e70df7aab4e2fe2ccab27621883cdb9ca3;hb=b62e173;hpb=9550cc22c652417259387dd3380e114a9b0a6413 diff --git a/tzdata.spec b/tzdata.spec index af4ff7e..eabe5d4 100644 --- a/tzdata.spec +++ b/tzdata.spec @@ -1,9 +1,16 @@ # # Conditional build -%bcond_without tests # make check -# -%define tzcode_ver 2009a -%define tzdata_ver 2009a +%bcond_without tests # make check +%bcond_without java # build java subpackage + +%if "%{pld_release}" == "ac" +%ifnarch i586 i686 pentium3 pentium4 athlon %{x8664} +%undefine with_java +%endif +%endif + +%define tzcode_ver 2016d +%define tzdata_ver 2016d Summary: Timezone data Summary(pl.UTF-8): Dane o strefach czasowych Name: tzdata @@ -11,22 +18,38 @@ Version: %{tzdata_ver} 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: 906a4c98cc5240f416524a256b039c42 -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 +# 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: 14bf84b6c2cdab0a9428991e0150ebe6 +#Source2Download: http://www.iana.org/time-zones/ +Source2: ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz +# Source2-md5: 06fc6fc111cd8dd681abdc5326529afd Source3: timezone.init Source4: timezone.sysconfig +Source5: javazic.tar.gz +# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91 Patch0: %{name}-test-update.patch +Patch1: javazic-fixup.patch +Patch2: install.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 +BuildRequires: rpm >= 4.4.9-56 +BuildRequires: rpmbuild(macros) >= 1.623 +%if %{with java} +BuildRequires: jdk +BuildRequires: jpackage-utils +BuildRequires: rpm-javaprov +%endif +Requires(post,preun,postun): systemd-units >= 38 Requires: /sbin/chkconfig -Requires: rc-scripts >= 0.4.1.4 +Requires: rc-scripts >= 0.4.3.0 +Requires: systemd-units >= 38 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -38,6 +61,18 @@ around the world. Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na całym świecie. +%package -n java-tzdata +Summary: Timezone data for Java +Summary(pl.UTF-8): Dane stref czasowych dla Javy +Group: Base + +%description -n java-tzdata +This package contains timezone information for use by Java runtimes. + +%description -n java-tzdata -l pl.UTF-8 +Ten pakiet zawiera informacje o strefach czasowych przeznaczone dla +programów w Javie. + %package zoneinfo_right Summary: Non-POSIX (real) time zones Summary(es.UTF-8): Zonas de tiempo reales (no de POSIX) @@ -58,38 +93,79 @@ Nie potrzebujesz tego. Szczegóły pod: . %package devel -Summary: tzfile header -Group: Development/Libraries +Summary: tzfile header file +Summary(pl.UTF-8): Plik nagłówkowy tzfile +Group: Development/Libraries %description devel +Header file for timezone database. + +%description devel -l pl.UTF-8 +Plik nagłówkowy bazy danych stref czasowych. %prep %setup -qc mv tzdata/* . +%patch0 -p1 + %{__tar} xzf %{SOURCE1} -C tzdata -mkdir tzcode +# don't override Makefile from base tar +%{__mv} tzdata/Makefile{,.tzdata} + +install -d tzcode %{__tar} xzf %{SOURCE2} -C tzcode -%patch0 -p1 +%patch2 -p1 -sed -e " +%{__sed} -e " s|@objpfx@|`pwd`/obj/| s|@datadir@|%{_datadir}| s|@install_root@|$RPM_BUILD_ROOT| -" Makeconfig.in > Makeconfig +" 'Makeconfig.in' > Makeconfig grep -v tz-art.htm tzcode/tz-link.htm > tzcode/tz-link.html +%if %{with java} +install -d javazic +tar zxf %{SOURCE5} -C javazic +cd javazic +%patch1 + +# Hack alert! sun.tools may be defined and installed in the +# VM. In order to guarantee that we are using IcedTea/OpenJDK +# for creating the zoneinfo files, rebase all the packages +# from "sun." to "rht.". Unfortunately, gcj does not support +# 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 +find . -type f -name '*.java' -print0 \ + | xargs -0 -- sed -i -e 's:sun\.tools\.:rht.tools.:g' \ + -e 's:sun\.util\.:rht.util.:g' +cd - +%endif + %build %{__make} +%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 .. +%endif + %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} -install -d $RPM_BUILD_ROOT%{_includedir} - +install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}} %{__make} install %if %{with tests} +# test needs to be ran after "make install", as it uses installed files : ====================TESTING========================= %{__make} check \ CC="%{__cc}" \ @@ -97,9 +173,8 @@ install -d $RPM_BUILD_ROOT%{_includedir} : ====================TESTING END===================== %endif - # glibc.spec didn't keep it. so won't here either. -rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix +%{__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 @@ -107,10 +182,18 @@ ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules > $RPM_BUILD_ROOT/etc/localtime -install tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h +# header file +cp -p tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h +cp -p tzcode/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 -install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone -cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone +ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service + +%if %{with java} +cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -124,12 +207,13 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del timezone # save for postun - cp -f /etc/localtime /etc/localtime.rpmsave + cp -af /etc/localtime /etc/localtime.rpmsave fi %postun if [ "$1" = "0" ]; then if [ ! -f /etc/localtime -a -f /etc/localtime.rpmsave ]; then + echo >&2 "Preserving /etc/localtime" mv -f /etc/localtime{.rpmsave,} fi fi @@ -152,19 +236,33 @@ if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then %service timezone restart fi +%triggerpostun -- tzdata < 2015f-2 +%systemd_service_disable timezone.service +%systemd_service_stop timezone.service + %files %defattr(644,root,root,755) %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 +%{systemdunitdir}/timezone.service %{_datadir}/zoneinfo %exclude %{_datadir}/zoneinfo/right +%if %{with java} +%files -n java-tzdata +%defattr(644,root,root,755) +%{_datadir}/javazi +%endif + %files zoneinfo_right %defattr(644,root,root,755) %{_datadir}/zoneinfo/right %files devel +%defattr(644,root,root,755) +%doc tzcode/tzfile.5.txt %{_includedir}/tzfile.h +%{_mandir}/man5/tzfile.5*