X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=tzdata.spec;h=754afb8556eddbadbb49f3af7726977b092b9318;hb=1f4e4169474301c16d66dfd34d0f07265c463964;hp=401b7f7e73cd3bd3c013ddd3b04d6ce0f2ade65d;hpb=ab8e370433dccf6a047484e07bc265253dae39ed;p=packages%2Ftzdata.git diff --git a/tzdata.spec b/tzdata.spec index 401b7f7..754afb8 100644 --- a/tzdata.spec +++ b/tzdata.spec @@ -1,9 +1,16 @@ # # Conditional build -%bcond_without tests # make check -# -%define tzdata_ver 2008a -%define tzcode_ver 2008a +%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 2011i +%define tzdata_ver 2011i Summary: Timezone data Summary(pl.UTF-8): Dane o strefach czasowych Name: tzdata @@ -11,19 +18,31 @@ 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 +# Source0-md5: e36d2f742c22f8c8dbf0686ac9769b55 Source1: ftp://elsie.nci.nih.gov/pub/%{name}%{tzdata_ver}.tar.gz -# Source1-md5: 2100dec2f4958364d3307170e5102a6d +# Source1-md5: c7a86ec34f30f8d6aa77ef94902a3047 Source2: ftp://elsie.nci.nih.gov/pub/tzcode%{tzcode_ver}.tar.gz -# Source2-md5: 4a04c12a8ec50b0a8cfc9ebce96b07d3 +# Source2-md5: cf7f4335b7c8682899fa2814e711c1b2 Source3: timezone.init Source4: timezone.sysconfig -Patch0: %{name}-test-update.patch +Source5: javazic.tar.gz +# Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91 +Source6: timezone.upstart +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 +BuildRequires: rpm >= 4.4.9-56 +BuildRequires: rpmbuild(macros) >= 1.300 +%if %{with java} +BuildRequires: jdk +BuildRequires: jpackage-utils +BuildRequires: rpm-javaprov +%endif Requires(post,preun): /sbin/chkconfig Requires: /sbin/chkconfig Requires: rc-scripts >= 0.4.1.4 @@ -38,6 +57,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) @@ -57,32 +88,75 @@ No lo necesita. Encontrará los detalles en: Nie potrzebujesz tego. Szczegóły pod: . +%package devel +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 -q -n %{name} -mkdir %{name}%{version} -%{__tar} xzf %{SOURCE1} -C %{name}%{version} -mkdir tzcode%{version} -%{__tar} xzf %{SOURCE2} -C tzcode%{version} -%patch0 -p1 - -sed -e " +%setup -qc +mv tzdata/* . +%{__tar} xzf %{SOURCE1} -C 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%{version}/tz-link.htm > tzcode%{version}/tz-link.html +" '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} - +install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir}} %{__make} install %if %{with tests} +# test needs to be ran after "make install", as it uses installed files : ====================TESTING========================= %{__make} check \ CC="%{__cc}" \ @@ -90,7 +164,6 @@ install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} : ====================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 @@ -100,8 +173,19 @@ ln -sf localtime $RPM_BUILD_ROOT%{_datadir}/zoneinfo/posixrules > $RPM_BUILD_ROOT/etc/localtime -install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/timezone -cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/timezone +# 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 -d $RPM_BUILD_ROOT/etc/init +cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/timezone.conf + +%if %{with java} +cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -128,16 +212,44 @@ 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 +%config(noreplace) %verify(not md5 mtime size) /etc/init/timezone.conf %{_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*