]> git.pld-linux.org Git - packages/tzdata.git/blobdiff - tzdata.spec
up to 2013c
[packages/tzdata.git] / tzdata.spec
index ea5e9cc18a6d27b976025c27a72f15125e13385b..9f4ad9ab2cb136266c4e5486beb244fccecacdc4 100644 (file)
@@ -9,8 +9,8 @@
 %endif
 %endif
 
-%define                tzcode_ver      2011i
-%define                tzdata_ver      2011n
+%define                tzcode_ver      2013c
+%define                tzdata_ver      2013c
 Summary:       Timezone data
 Summary(pl.UTF-8):     Dane o strefach czasowych
 Name:          tzdata
@@ -26,28 +26,32 @@ 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:       http://www.iana.org/time-zones/repository/releases/%{name}%{tzdata_ver}.tar.gz
-# Source1-md5: 20dbfb28efa008ddbf6dd34601ea40fa
+Source1:       ftp://ftp.iana.org/tz/releases/%{name}%{tzdata_ver}.tar.gz
+# Source1-md5: b5062217a2dea6823dd69b4dda97b249
 #Source2Download: http://www.iana.org/time-zones/
-Source2:       http://www.iana.org/time-zones/repository/releases/tzcode%{tzcode_ver}.tar.gz
-# Source2-md5: cf7f4335b7c8682899fa2814e711c1b2
+Source2:       ftp://ftp.iana.org/tz/releases/tzcode%{tzcode_ver}.tar.gz
+# Source2-md5: 69d333d829802af4475707e32fa01681
 Source3:       timezone.init
 Source4:       timezone.sysconfig
 Source5:       javazic.tar.gz
 # Source5-md5: 6a3392cd5f1594d13c12c1a836ac8d91
 Source6:       timezone.upstart
+Source7:       timezone.service
+Source8:       timezone.sh
 Patch1:                javazic-fixup.patch
 Patch2:                install.patch
 URL:           http://www.twinsun.com/tz/tz-link.htm
 BuildRequires: rpm >= 4.4.9-56
-BuildRequires: rpmbuild(macros) >= 1.300
+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.3.0
+Requires:      systemd-units >= 38
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -105,6 +109,8 @@ Plik nagłówkowy bazy danych stref czasowych.
 %setup -qc
 mv tzdata/* .
 %{__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
@@ -154,7 +160,7 @@ cd ..
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir}}
+install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_includedir},%{systemdunitdir}}
 %{__make} install
 
 %if %{with tests}
@@ -167,7 +173,7 @@ install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_mandir}/man5,%{_inclu
 %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
@@ -185,6 +191,9 @@ 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
 
+install -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/timezone.service
+install -p %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/pld-timezone
+
 %if %{with java}
 cp -a zoneinfo/java $RPM_BUILD_ROOT%{_datadir}/javazi
 %endif
@@ -195,21 +204,25 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/chkconfig --add timezone
 %service timezone restart
+%systemd_post timezone.service
 
 %preun
 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
+%systemd_preun timezone.service
 
 %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
+%systemd_reload
 
 %triggerpostun -- rc-scripts < 0.4.1.4
 /sbin/chkconfig --add timezone
@@ -229,6 +242,9 @@ if ! grep -q '^TIMEZONE=' /etc/sysconfig/timezone; then
        %service timezone restart
 fi
 
+%triggerpostun -- tzdata < 2012a-2
+%systemd_trigger timezone.service
+
 %files
 %defattr(644,root,root,755)
 %doc tzcode/README tzcode/Theory tzcode/tz-link.html
@@ -236,6 +252,8 @@ fi
 %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
+%{systemdunitdir}/timezone.service
+%attr(755,root,root) /lib/systemd/pld-timezone
 
 %{_datadir}/zoneinfo
 %exclude %{_datadir}/zoneinfo/right
This page took 0.154889 seconds and 4 git commands to generate.