From 4646825baa087e2c071351e267513951d89cb7fe Mon Sep 17 00:00:00 2001 From: Alexpux Date: Tue, 5 Nov 2013 12:24:41 +0400 Subject: [PATCH] Add tzcode package --- tzcode/PKGBUILD | 72 +++++++++++++++++++++ tzcode/tzcode-cygwin.patch | 23 +++++++ tzcode/tzcode-makefile-exe-extensions.patch | 50 ++++++++++++++ tzcode/tzcode-makefile.patch | 72 +++++++++++++++++++++ tzcode/tzcode-man1.patch | 31 +++++++++ tzcode/tzcode-man3.patch | 60 +++++++++++++++++ tzcode/tzcode-man8.patch | 22 +++++++ tzcode/tzcode-tzfile.patch | 11 ++++ 8 files changed, 341 insertions(+) create mode 100644 tzcode/PKGBUILD create mode 100644 tzcode/tzcode-cygwin.patch create mode 100644 tzcode/tzcode-makefile-exe-extensions.patch create mode 100644 tzcode/tzcode-makefile.patch create mode 100644 tzcode/tzcode-man1.patch create mode 100644 tzcode/tzcode-man3.patch create mode 100644 tzcode/tzcode-man8.patch create mode 100644 tzcode/tzcode-tzfile.patch diff --git a/tzcode/PKGBUILD b/tzcode/PKGBUILD new file mode 100644 index 00000000..1d427ef0 --- /dev/null +++ b/tzcode/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Alexey Pavlov + +pkgname=tzcode +_ver=2013g +# use a pacman compatible version scheme +pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}} +pkgrel=1 +pkgdesc="Sources for time zone and daylight saving time data" +arch=('i686' 'x86_64') +url="http://www.iana.org/time-zones" +license=('GPL') +options=('!emptydirs') +groups=('base') +depends=('coreutils' 'gawk' 'sed') +source=(http://www.iana.org/time-zones/repository/releases/${pkgname}${_ver}.tar.gz + http://www.iana.org/time-zones/repository/releases/tzdata${_ver}.tar.gz + tzcode-makefile.patch + tzcode-makefile-exe-extensions.patch + tzcode-tzfile.patch + tzcode-cygwin.patch + tzcode-man1.patch + tzcode-man3.patch + tzcode-man8.patch) +sha1sums=('d5a8be5e2414c5f500de9ab2d3472009583ad9dc' + 'be5ec909a9ee363a80dc88b2d1ae9690cacac4b2' + '9d85e92e6fb8d823b48591508bcf77728dff2fa8' + '0e68dd20610f1b1807f34a9e681b772f1a00d3ff' + '46feb526f958e4cc027e253345fbe31b41dc5bf4' + '2095c6a471634cc9574b24a9b661d1f32952a11a' + '1a207233e2746933df6334f0316fb62a0505830b' + 'b3c0c389481fece1b00257e5c8ce73256448196b' + '39697816b3f3c37bd898ef7380af3b224b99545c') + +timezones=('africa' 'antarctica' 'asia' 'australasia' + 'europe' 'northamerica' 'southamerica' + 'pacificnew' 'etcetera' 'backward' + 'systemv' 'factory' + 'solar87' 'solar88' 'solar89') + +prepare() { + cd ${srcdir} + + patch -p1 -i ${srcdir}/tzcode-makefile.patch + patch -p1 -i ${srcdir}/tzcode-makefile-exe-extensions.patch + patch -p1 -i ${srcdir}/tzcode-tzfile.patch + patch -p1 -i ${srcdir}/tzcode-cygwin.patch + patch -p1 -i ${srcdir}/tzcode-man1.patch + patch -p1 -i ${srcdir}/tzcode-man3.patch + patch -p1 -i ${srcdir}/tzcode-man8.patch + +} + +build() { + cd ${srcdir} + + make CFLAGS='-O2 -std=gnu99' +} + +package() { + cd ${srcdir} + + make -j1 DESTDIR=${pkgdir} install + mv ${pkgdir}/usr/share/zoneinfo-leaps ${pkgdir}/usr/share/zoneinfo/right + mv ${pkgdir}/usr/share/zoneinfo-posix ${pkgdir}/usr/share/zoneinfo/posix + + /sbin/zic -y ./yearistype -d ${pkgdir}/usr/share/zoneinfo ${timezones[@]} + /sbin/zic -y ./yearistype -d ${pkgdir}/usr/share/zoneinfo/posix ${timezones[@]} + /sbin/zic -y ./yearistype -d ${pkgdir}/usr/share/zoneinfo/right -L leapseconds ${timezones[@]} + + /sbin/zic -y ./yearistype -d ${pkgdir}/usr/share/zoneinfo -p America/New_York + install -m444 -t ${pkgdir}/usr/share/zoneinfo iso3166.tab zone.tab +} diff --git a/tzcode/tzcode-cygwin.patch b/tzcode/tzcode-cygwin.patch new file mode 100644 index 00000000..d975e91b --- /dev/null +++ b/tzcode/tzcode-cygwin.patch @@ -0,0 +1,23 @@ +--- src/date.c.orig 2013-09-05 06:07:31.000000000 +0400 ++++ src/date.c 2013-11-05 11:45:24.396200000 +0400 +@@ -54,6 +54,8 @@ + #define SECSPERMIN 60 + #endif /* !defined SECSPERMIN */ + ++#undef OLD_TIME ++ + extern char ** environ; + extern char * optarg; + extern int optind; +@@ -437,9 +439,11 @@ + #include "netinet/in.h" + #include "netdb.h" + #define TSPTYPES ++#ifndef __CYGWIN__ + #include "protocols/timed.h" + + extern int logwtmp(); ++#endif + + #if HAVE_SETTIMEOFDAY == 1 + #define settimeofday(t, tz) (settimeofday)(t) diff --git a/tzcode/tzcode-makefile-exe-extensions.patch b/tzcode/tzcode-makefile-exe-extensions.patch new file mode 100644 index 00000000..fa617b43 --- /dev/null +++ b/tzcode/tzcode-makefile-exe-extensions.patch @@ -0,0 +1,50 @@ +--- src/Makefile.orig 2013-11-05 11:36:15.455800000 +0400 ++++ src/Makefile 2013-11-05 11:40:42.433600000 +0400 +@@ -350,9 +350,9 @@ + -rm -f $(DESTDIR)$(TZDIR)/iso3166.tab \ + $(DESTDIR)$(TZDIR)/zone.tab + cp iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/. +- -mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(ETCDIR) +- cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/. +- -mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \ ++ -mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(ETCDIR) ++ cp tzselect zic.exe zdump.exe $(DESTDIR)$(ETCDIR)/. ++ -mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \ + $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \ + $(DESTDIR)$(MANDIR)/man8 + -rm -f $(DESTDIR)$(MANDIR)/man3/newctime.3 \ +@@ -366,9 +366,9 @@ + cp tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/. + + INSTALL: ALL install date.1 +- -mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(BINDIR) +- cp date $(DESTDIR)$(BINDIR)/. +- -mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \ ++ -mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(BINDIR) ++ cp date.exe $(DESTDIR)$(BINDIR)/tz-date.exe ++ -mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \ + $(DESTDIR)$(MANDIR)/man1 + -rm -f $(DESTDIR)$(MANDIR)/man1/date.1 + cp date.1 $(DESTDIR)$(MANDIR)/man1/. +@@ -519,7 +519,7 @@ + check_public: $(ENCHILADA) + make maintainer-clean + make "CFLAGS=$(GCC_DEBUG_FLAGS)" $(ENCHILADA) all +- mkdir tzpublic ++ mkdir -p tzpublic + for i in $(TDATA) ; do \ + $(zic) -v -d tzpublic $$i 2>&1 || exit; \ + done +@@ -529,10 +529,10 @@ + # Check that the code works under various alternative + # implementations of time_t. + check_time_t_alternatives: +- mkdir tzpublic ++ mkdir -p tzpublic + zones=`$(AWK) '/^[^#]/ { print $$3 }'