X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=tzdata.spec;h=ba6ae90e8829a188690ede24e5e480358a9fb2cd;hb=a152ccbcc14726f8b6a278586f721738312556e4;hp=991b8662be86d4e5a145450b3417a45d15d0fed5;hpb=85de48d260fb522a1f6df4a6590ed0664151d0f4;p=packages%2Ftzdata.git diff --git a/tzdata.spec b/tzdata.spec index 991b866..ba6ae90 100644 --- a/tzdata.spec +++ b/tzdata.spec @@ -1,29 +1,35 @@ # # Conditional build -%bcond_without tests # make check -# -%define tzcode_ver 2009a -%define tzdata_ver 2009a +%bcond_without tests # make check +%bcond_with java # build java subpackage + +%define tzcode_ver 2010n +%define tzdata_ver 2010n Summary: Timezone data Summary(pl.UTF-8): Dane o strefach czasowych Name: tzdata Version: %{tzdata_ver} -Release: 1 +Release: 0.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}%{tzdata_ver}.tar.gz -# Source1-md5: 979cb227a83d7fbb954611a4fb5b1949 +# Source1-md5: b5eefb4986866895ab84f52220f1dfa6 Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz -# Source2-md5: 6a20a58704c779e3006394cf38a1dc0a +# Source2-md5: a7a776a5713831993e814fe0c05f9fd5 Source3: timezone.init Source4: timezone.sysconfig +Source5: javazic.tar.gz +# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91 Patch0: %{name}-test-update.patch +Patch1: javazic-fixup.patch URL: http://www.twinsun.com/tz/tz-link.htm -BuildRequires: gawk -BuildRequires: perl-base -BuildRequires: rpmbuild(macros) >= 1.228 +BuildRequires: rpmbuild(macros) >= 1.300 +%if %{with java} +BuildRequires: jpackage-utils +BuildRequires: rpm-javaprov +%endif Requires(post,preun): /sbin/chkconfig Requires: /sbin/chkconfig Requires: rc-scripts >= 0.4.1.4 @@ -38,6 +44,18 @@ around the world. Ten pakiet zawiera pliki z danymi na temat reguł stref czasowych na całym świecie. +%package java +Summary: Timezone data for Java +Summary(pl.UTF-8): Dane stref czasowych dla Javy +Group: Base + +%description java +This package contains timezone information for use by Java runtimes. + +%description java -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,8 +76,8 @@ Nie potrzebujesz tego. Szczegóły pod: . %package devel -Summary: tzfile header -Summary(pl.UTF-8): nagłówek tzfile +Summary: tzfile header file +Summary(pl.UTF-8): Plik nagłówkowy tzfile Group: Development/Libraries %description devel @@ -80,13 +98,45 @@ 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 solar87 solar88 solar89 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} @@ -100,10 +150,11 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man5 %{__make} check \ CC="%{__cc}" \ CFLAGS="%{rpmcflags} %{rpmldflags}" +TZDIR=$(pwd)/obj ./obj/test-tz +TZDIR=$(pwd)/obj ./obj/tst-timezone : ====================TESTING END===================== %endif - # glibc.spec didn't keep it. so won't here either. rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posix # behave more like glibc.spec @@ -114,12 +165,16 @@ ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules > $RPM_BUILD_ROOT/etc/localtime # header file -install tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h -install tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5 +cp -a tzcode/tzfile.h $RPM_BUILD_ROOT%{_includedir}/tzfile.h +cp -a tzcode/tzfile.5 $RPM_BUILD_ROOT%{_mandir}/man5 -install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone +install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone +%if %{with java} +cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi +%endif + %clean rm -rf $RPM_BUILD_ROOT @@ -170,6 +225,12 @@ fi %{_datadir}/zoneinfo %exclude %{_datadir}/zoneinfo/right +%if %{with java} +%files java +%defattr(644,root,root,755) +%{_datadir}/javazi +%endif + %files zoneinfo_right %defattr(644,root,root,755) %{_datadir}/zoneinfo/right