Because there seems to be an increasing trend among packagers to drop the PostgreSQL-supplied time zone data and use the operating system's instead, I figured it would be good to define an official and documented way to do this. If we could get, say, the Linux, BSD, and Solaris packagers to adopt this, this would eliminate the bulk of essentially redundant efforts to upgrade the PostgreSQL packages whenever the time zone data changes.
Here is a proposed patch that you would use like this: ./configure ... --with-system-tzdata=/usr/share/zoneinfo I'm not sure to what extent the regression tests exercise the specifics of the time zone data, but when you specify something totally wrong some tests fail, so it would be easy to catch that. -- Peter Eisentraut http://developer.postgresql.org/~petere/
diff -ur cvs-pgsql/configure pgsql/configure --- cvs-pgsql/configure 2007-08-11 19:12:23.000000000 +0200 +++ pgsql/configure 2007-08-16 22:30:56.000000000 +0200 @@ -314,7 +314,7 @@ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug enable_profiling DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_gssapi with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl with_ossp_uuid XML2_CONFIG with_libxml with_libxslt with_zlib EGREP ELF_SYS LDFLAGS_SL LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB TAR LN_S AWK YACC YFLAGS FLEX FLEXFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug enable_profiling DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_gssapi with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl with_ossp_uuid XML2_CONFIG with_libxml with_libxslt with_system_tzdata with_zlib EGREP ELF_SYS LDFLAGS_SL LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB TAR LN_S AWK YACC YFLAGS FLEX FLEXFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -899,6 +899,7 @@ --with-ossp-uuid build with OSSP UUID library for UUID generation --with-libxml build with XML support --with-libxslt build with XSLT support + --with-system-tzdata=DIR use system time zone data in DIR --without-zlib do not use Zlib --with-gnu-ld assume the C compiler uses GNU ld [default=no] @@ -4501,6 +4502,37 @@ # +# tzdata +# + +pgac_args="$pgac_args with_system_tzdata" + + +# Check whether --with-system-tzdata or --without-system-tzdata was given. +if test "${with_system_tzdata+set}" = set; then + withval="$with_system_tzdata" + + case $withval in + yes) + { { echo "$as_me:$LINENO: error: argument required for --with-system-tzdata option" >&5 +echo "$as_me: error: argument required for --with-system-tzdata option" >&2;} + { (exit 1); exit 1; }; } + ;; + no) + { { echo "$as_me:$LINENO: error: argument required for --with-system-tzdata option" >&5 +echo "$as_me: error: argument required for --with-system-tzdata option" >&2;} + { (exit 1); exit 1; }; } + ;; + *) + + ;; + esac + +fi; + + + +# # Zlib # @@ -25237,6 +25269,7 @@ s,@XML2_CONFIG@,$XML2_CONFIG,;t t s,@with_libxml@,$with_libxml,;t t s,@with_libxslt@,$with_libxslt,;t t +s,@with_system_tzdata@,$with_system_tzdata,;t t s,@with_zlib@,$with_zlib,;t t s,@EGREP@,$EGREP,;t t s,@ELF_SYS@,$ELF_SYS,;t t diff -ur cvs-pgsql/configure.in pgsql/configure.in --- cvs-pgsql/configure.in 2007-08-11 19:12:23.000000000 +0200 +++ pgsql/configure.in 2007-08-16 22:30:21.000000000 +0200 @@ -607,6 +607,13 @@ AC_SUBST(with_libxslt) # +# tzdata +# +PGAC_ARG_REQ(with, system-tzdata, + [ --with-system-tzdata=DIR use system time zone data in DIR]) +AC_SUBST(with_system_tzdata) + +# # Zlib # PGAC_ARG_BOOL(with, zlib, yes, diff -ur cvs-pgsql/doc/src/sgml/installation.sgml pgsql/doc/src/sgml/installation.sgml --- cvs-pgsql/doc/src/sgml/installation.sgml 2007-08-11 19:12:24.000000000 +0200 +++ pgsql/doc/src/sgml/installation.sgml 2007-08-17 08:45:36.000000000 +0200 @@ -1022,6 +1022,44 @@ </varlistentry> <varlistentry> + <term><option>--with-system-tzdata=<replaceable>DIRECTORY</replaceable></option></term> + <indexterm> + <primary>time zone data</primary> + </indexterm> + <listitem> + <para> + PostgreSQL includes its own time zone database, which it + requires for date and time operations. This time zone + database is in fact compatible with the time zone database + provided by many operating systems such as FreeBSD, Linux, + and Solaris, so it would be redundant to install it again. + When this option is used, the operating system supplied time + zone database in <replaceable>DIRECTORY</replaceable> is used + instead of the one included in the PostgreSQL source + distribution. <filename>/usr/share/zoneinfo/</filename> is a + likely directory on some operating systems. Note that the + installation routine does not detect mismatching or erroneous + time zone data. You are advised to run the regression tests + to verify that the time zone data you have pointed to works + correctly. + </para> + + <para> + This option is mainly aimed at binary package distributors + who know their target operating system well. The main + advantage of using this option is that the PostgreSQL package + won't need to be upgraded whenever any of the many local + daylight-saving time rules changes. Another completely + incidental advantage is that PostgreSQL can be + cross-compiled<indexterm><primary>cross + compilation</primary></indexterm> straightforwardly if the + time-zone database does not need to be built during the + installation. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>--without-zlib</option></term> <listitem> <para> diff -ur cvs-pgsql/src/Makefile.global.in pgsql/src/Makefile.global.in --- cvs-pgsql/src/Makefile.global.in 2007-07-12 08:40:57.000000000 +0200 +++ pgsql/src/Makefile.global.in 2007-08-16 22:14:09.000000000 +0200 @@ -158,6 +158,7 @@ with_ossp_uuid = @with_ossp_uuid@ with_libxml = @with_libxml@ with_libxslt = @with_libxslt@ +with_system_tzdata = @with_system_tzdata@ with_zlib = @with_zlib@ enable_shared = @enable_shared@ enable_rpath = @enable_rpath@ diff -ur cvs-pgsql/src/timezone/Makefile pgsql/src/timezone/Makefile --- cvs-pgsql/src/timezone/Makefile 2007-03-25 17:24:18.000000000 +0200 +++ pgsql/src/timezone/Makefile 2007-08-16 22:21:56.000000000 +0200 @@ -32,11 +32,17 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) +ifeq (,$(with_system_tzdata)) zic: $(ZICOBJS) $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o [EMAIL PROTECTED](X) +endif install: all installdirs +ifeq (,$(with_system_tzdata)) ./zic -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES) +else + ln -s '$(with_system_tzdata)' '$(DESTDIR)$(datadir)/timezone' +endif $(MAKE) -C tznames $@ installdirs:
---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org