From 73c856222edb8c22377bf9a1c81a724065e3a31c Mon Sep 17 00:00:00 2001 From: Palle Girgensohn Date: Mon, 18 Apr 2011 23:34:27 +0000 Subject: Update PostgreSQL to 9.0.4, 8.4.8, 8.3.15 and 8.2.21. This update contains a critical fix to the pg_upgrade utility which prevents significant downtime issues. Do not use pg_upgrade without installing this update first. The issue with pg_upgrade and the fix are detailed on the PostgreSQL wiki: http://wiki.postgresql.org/wiki/20110408pg_upgrade_fix Users who have already used pg_upgrade should run the database repair script given on that page on their databases as soon as possible. See the release notes for each version at http://www.postgresql.org/docs/current/static/release.html for a full list of changes with details. Allow the username of the postgresql user to configurable for 8.4 and 9.0. Largely inspired by the work of Jason Helfman [153668, 153136]. Change PGUSER knob to PG_USER not to clash with PGUSER environment. PR: 153668, 153136, 155493, 155137 --- databases/postgresql82-server/Makefile | 6 +- databases/postgresql82-server/distinfo | 4 +- .../files/pkg-message-client.in | 2 +- databases/postgresql82-server/pkg-plist-server | 3 + databases/postgresql83-server/Makefile | 6 +- databases/postgresql83-server/distinfo | 4 +- .../files/pkg-message-client.in | 2 +- databases/postgresql83-server/pkg-plist-server | 3 + databases/postgresql84-server/Makefile | 31 ++++-- databases/postgresql84-server/distinfo | 4 +- databases/postgresql84-server/files/502.pgsql | 112 --------------------- databases/postgresql84-server/files/502.pgsql.in | 112 +++++++++++++++++++++ .../files/pkg-install-server.in | 66 ++++++++++++ .../files/pkg-message-client.in | 2 +- databases/postgresql84-server/files/postgresql.in | 2 +- databases/postgresql84-server/pkg-install-server | 63 ------------ databases/postgresql84-server/pkg-plist-client | 1 + databases/postgresql84-server/pkg-plist-server | 5 +- databases/postgresql90-server/Makefile | 25 +++-- databases/postgresql90-server/distinfo | 4 +- databases/postgresql90-server/files/502.pgsql | 112 --------------------- databases/postgresql90-server/files/502.pgsql.in | 112 +++++++++++++++++++++ .../files/pkg-install-server.in | 66 ++++++++++++ .../files/pkg-message-client.in | 2 +- databases/postgresql90-server/files/postgresql.in | 2 +- databases/postgresql90-server/pkg-install-server | 63 ------------ databases/postgresql90-server/pkg-plist-server | 5 +- databases/postgresql91-server/Makefile | 25 +++-- databases/postgresql91-server/distinfo | 4 +- databases/postgresql91-server/files/502.pgsql | 112 --------------------- databases/postgresql91-server/files/502.pgsql.in | 112 +++++++++++++++++++++ .../files/pkg-install-server.in | 66 ++++++++++++ .../files/pkg-message-client.in | 2 +- databases/postgresql91-server/files/postgresql.in | 2 +- databases/postgresql91-server/pkg-install-server | 63 ------------ databases/postgresql91-server/pkg-plist-server | 5 +- databases/postgresql92-server/Makefile | 25 +++-- databases/postgresql92-server/distinfo | 4 +- databases/postgresql92-server/files/502.pgsql | 112 --------------------- databases/postgresql92-server/files/502.pgsql.in | 112 +++++++++++++++++++++ .../files/pkg-install-server.in | 66 ++++++++++++ .../files/pkg-message-client.in | 2 +- databases/postgresql92-server/files/postgresql.in | 2 +- databases/postgresql92-server/pkg-install-server | 63 ------------ databases/postgresql92-server/pkg-plist-server | 5 +- 45 files changed, 835 insertions(+), 766 deletions(-) delete mode 100644 databases/postgresql84-server/files/502.pgsql create mode 100644 databases/postgresql84-server/files/502.pgsql.in create mode 100644 databases/postgresql84-server/files/pkg-install-server.in delete mode 100644 databases/postgresql84-server/pkg-install-server delete mode 100644 databases/postgresql90-server/files/502.pgsql create mode 100644 databases/postgresql90-server/files/502.pgsql.in create mode 100644 databases/postgresql90-server/files/pkg-install-server.in delete mode 100644 databases/postgresql90-server/pkg-install-server delete mode 100644 databases/postgresql91-server/files/502.pgsql create mode 100644 databases/postgresql91-server/files/502.pgsql.in create mode 100644 databases/postgresql91-server/files/pkg-install-server.in delete mode 100644 databases/postgresql91-server/pkg-install-server delete mode 100644 databases/postgresql92-server/files/502.pgsql create mode 100644 databases/postgresql92-server/files/502.pgsql.in create mode 100644 databases/postgresql92-server/files/pkg-install-server.in delete mode 100644 databases/postgresql92-server/pkg-install-server diff --git a/databases/postgresql82-server/Makefile b/databases/postgresql82-server/Makefile index 221934ae63c5..ab69ca9e7555 100644 --- a/databases/postgresql82-server/Makefile +++ b/databases/postgresql82-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -PORTVERSION?= 8.2.20 +PORTVERSION?= 8.2.21 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${PORTVERSION} @@ -16,8 +16,8 @@ DISTFILES?= postgresql-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER?= girgen@FreeBSD.org COMMENT?= The most advanced open-source database available anywhere -CONFLICTS?= ${PORTNAME}-client-7.* \ - ${PORTNAME}${PKGNAMESUFFIX}-7.* \ +CONFLICTS?= ${PORTNAME}-client-[79].* \ + ${PORTNAME}${PKGNAMESUFFIX}-[79].* \ ${PORTNAME}-client-8.[0-13-9]* \ ${PORTNAME}${PKGNAMESUFFIX}-8.[0-13-9]* diff --git a/databases/postgresql82-server/distinfo b/databases/postgresql82-server/distinfo index e2a274b1a5ea..2d5cb196d2c1 100644 --- a/databases/postgresql82-server/distinfo +++ b/databases/postgresql82-server/distinfo @@ -1,2 +1,2 @@ -SHA256 (postgresql/postgresql-8.2.20.tar.bz2) = 77674a5804fb96ae28966c3950e38455720b23d9acfd87a092a6f2f3d7520a57 -SIZE (postgresql/postgresql-8.2.20.tar.bz2) = 12756288 +SHA256 (postgresql/postgresql-8.2.21.tar.bz2) = b3fd5345b751557a1153f98e104fb58d1519c10dac81dc013ff1eb46c7826faa +SIZE (postgresql/postgresql-8.2.21.tar.bz2) = 12768593 diff --git a/databases/postgresql82-server/files/pkg-message-client.in b/databases/postgresql82-server/files/pkg-message-client.in index 722d50cb4244..6ea9564c156d 100644 --- a/databases/postgresql82-server/files/pkg-message-client.in +++ b/databases/postgresql82-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql82-server/pkg-plist-server b/databases/postgresql82-server/pkg-plist-server index e9755aade602..4f2c1fcdcf32 100644 --- a/databases/postgresql82-server/pkg-plist-server +++ b/databases/postgresql82-server/pkg-plist-server @@ -283,6 +283,7 @@ share/postgresql/timezone/America/Mazatlan share/postgresql/timezone/America/Mendoza share/postgresql/timezone/America/Menominee share/postgresql/timezone/America/Merida +share/postgresql/timezone/America/Metlakatla share/postgresql/timezone/America/Mexico_City share/postgresql/timezone/America/Miquelon share/postgresql/timezone/America/Moncton @@ -295,6 +296,7 @@ share/postgresql/timezone/America/New_York share/postgresql/timezone/America/Nipigon share/postgresql/timezone/America/Nome share/postgresql/timezone/America/Noronha +share/postgresql/timezone/America/North_Dakota/Beulah share/postgresql/timezone/America/North_Dakota/Center share/postgresql/timezone/America/North_Dakota/New_Salem share/postgresql/timezone/America/Ojinaga @@ -321,6 +323,7 @@ share/postgresql/timezone/America/Santo_Domingo share/postgresql/timezone/America/Sao_Paulo share/postgresql/timezone/America/Scoresbysund share/postgresql/timezone/America/Shiprock +share/postgresql/timezone/America/Sitka share/postgresql/timezone/America/St_Barthelemy share/postgresql/timezone/America/St_Johns share/postgresql/timezone/America/St_Kitts diff --git a/databases/postgresql83-server/Makefile b/databases/postgresql83-server/Makefile index 5f09e8aa7a82..99e01933a334 100644 --- a/databases/postgresql83-server/Makefile +++ b/databases/postgresql83-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -DISTVERSION?= 8.3.14 +DISTVERSION?= 8.3.15 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${DISTVERSION} @@ -15,8 +15,8 @@ PKGNAMESUFFIX?= -server MAINTAINER?= girgen@FreeBSD.org COMMENT?= The most advanced open-source database available anywhere -CONFLICTS?= ${PORTNAME}-client-7.* \ - ${PORTNAME}${PKGNAMESUFFIX}-7.* \ +CONFLICTS?= ${PORTNAME}-client-[79].* \ + ${PORTNAME}${PKGNAMESUFFIX}-[79].* \ ${PORTNAME}-client-8.[0-24-9]* \ ${PORTNAME}${PKGNAMESUFFIX}-8.[0-24-9]* diff --git a/databases/postgresql83-server/distinfo b/databases/postgresql83-server/distinfo index 6dd407529c0d..c064be0cd87a 100644 --- a/databases/postgresql83-server/distinfo +++ b/databases/postgresql83-server/distinfo @@ -1,4 +1,4 @@ -SHA256 (postgresql/postgresql-8.3.14.tar.bz2) = 5673e0191f623a2f6607808e63c5290d5f33de6da7d9c2b15cb9e8817fa93c99 -SIZE (postgresql/postgresql-8.3.14.tar.bz2) = 14345092 +SHA256 (postgresql/postgresql-8.3.15.tar.bz2) = 433bfad5c9ccca38029be193d3c4ff47d394f4c678be41ef709063255c97cf16 +SIZE (postgresql/postgresql-8.3.15.tar.bz2) = 14344586 SHA256 (postgresql/pg-8311-icu-xx-2010-05-14.diff.gz) = 44146bdb29a5a7d51c70911096ed6d265bdf09f74f0084ee7ad1883bea2f852a SIZE (postgresql/pg-8311-icu-xx-2010-05-14.diff.gz) = 5064 diff --git a/databases/postgresql83-server/files/pkg-message-client.in b/databases/postgresql83-server/files/pkg-message-client.in index 3183bc136aa6..ff486a635645 100644 --- a/databases/postgresql83-server/files/pkg-message-client.in +++ b/databases/postgresql83-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql83-server/pkg-plist-server b/databases/postgresql83-server/pkg-plist-server index d1fe2532b92e..8abc4498a995 100644 --- a/databases/postgresql83-server/pkg-plist-server +++ b/databases/postgresql83-server/pkg-plist-server @@ -294,6 +294,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Mendoza %%TZDATA%%share/postgresql/timezone/America/Menominee %%TZDATA%%share/postgresql/timezone/America/Merida +%%TZDATA%%share/postgresql/timezone/America/Metlakatla %%TZDATA%%share/postgresql/timezone/America/Mexico_City %%TZDATA%%share/postgresql/timezone/America/Miquelon %%TZDATA%%share/postgresql/timezone/America/Moncton @@ -306,6 +307,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Nipigon %%TZDATA%%share/postgresql/timezone/America/Nome %%TZDATA%%share/postgresql/timezone/America/Noronha +%%TZDATA%%share/postgresql/timezone/America/North_Dakota/Beulah %%TZDATA%%share/postgresql/timezone/America/North_Dakota/Center %%TZDATA%%share/postgresql/timezone/America/North_Dakota/New_Salem %%TZDATA%%share/postgresql/timezone/America/Ojinaga @@ -332,6 +334,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Sao_Paulo %%TZDATA%%share/postgresql/timezone/America/Scoresbysund %%TZDATA%%share/postgresql/timezone/America/Shiprock +%%TZDATA%%share/postgresql/timezone/America/Sitka %%TZDATA%%share/postgresql/timezone/America/St_Barthelemy %%TZDATA%%share/postgresql/timezone/America/St_Johns %%TZDATA%%share/postgresql/timezone/America/St_Kitts diff --git a/databases/postgresql84-server/Makefile b/databases/postgresql84-server/Makefile index 8a6581f83390..d9800aa8e6c7 100644 --- a/databases/postgresql84-server/Makefile +++ b/databases/postgresql84-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -DISTVERSION?= 8.4.7 +DISTVERSION?= 8.4.8 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${DISTVERSION} @@ -15,8 +15,8 @@ PKGNAMESUFFIX?= -server MAINTAINER?= girgen@FreeBSD.org COMMENT?= The most advanced open-source database available anywhere -CONFLICTS?= ${PORTNAME}-client-7.* \ - ${PORTNAME}${PKGNAMESUFFIX}-7.* \ +CONFLICTS?= ${PORTNAME}-client-[79].* \ + ${PORTNAME}${PKGNAMESUFFIX}-[79].* \ ${PORTNAME}-client-8.[0-35-9]* \ ${PORTNAME}${PKGNAMESUFFIX}-8.[0-35-9]* @@ -26,7 +26,6 @@ DIST_SUBDIR= postgresql UNIQUENAME?= ${PORTNAME}84 LATEST_LINK?= ${PKGNAMEPREFIX}${UNIQUENAME}${PKGNAMESUFFIX} -PKGINSTALL?= ${PKGDIR}/pkg-install${PKGNAMESUFFIX} USE_BZIP2= YES USE_GMAKE= YES GNU_CONFIGURE= YES @@ -35,8 +34,9 @@ GNU_CONFIGURE= YES .undef GNU_CONFIGURE .endif -PGUSER= pgsql -PGGROUP= pgsql +PG_USER?= pgsql +PG_GROUP?= pgsql +PG_UID?= 70 LDFLAGS+= -L${LOCALBASE}/lib INCLUDES+= -I${LOCALBASE}/include @@ -61,6 +61,7 @@ SERVER_ONLY= yes USE_RC_SUBR= postgresql USE_PGSQL= yes WANT_PGSQL_VER= ${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g} +SUB_FILES+= 502.pgsql .endif .if !defined(SLAVE_ONLY) @@ -93,7 +94,7 @@ OPTIONS+= OPTIMIZED_CFLAGS "Builds with compiler optimizations (-O3)" off OPTIONS+= XML "Build with XML data type (server)" on OPTIONS+= TZDATA "Use internal timezone database (server)" on OPTIONS+= DEBUG "Builds with debugging symbols" off -OPTIONS+= GSSAPI "BUild with GSSAPI support" on +OPTIONS+= GSSAPI "BUild with GSSAPI support" off # See http://people.freebsd.org/~girgen/postgresql-icu/README.html for more info OPTIONS+= ICU "Use ICU for unicode collation (server)" off @@ -252,7 +253,7 @@ MAN7= abort.7 alter_aggregate.7 alter_conversion.7 alter_database.7 \ .if defined(SERVER_ONLY) pre-everything:: - @${SH} ${PKGINSTALL} ${PORTNAME} BACKUPWARNING + @${SH} ${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in ${PORTNAME} BACKUPWARNING .endif .if !defined(NO_BUILD) @@ -274,11 +275,21 @@ do-build: SUB_FILES+= pkg-message${PKGNAMESUFFIX} PKGMESSAGE= ${WRKSRC}/pkg-message${PKGNAMESUFFIX} . endif + +. if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in) +SUB_FILES+= pkg-install${PKGNAMESUFFIX} +SUB_LIST= PG_GROUP=$(PG_GROUP) \ + PG_USER=$(PG_USER) \ + PG_UID=$(PG_UID) +PLIST_SUB+= PG_USER=$(PG_USER) +PKGINSTALL= ${WRKDIR}/pkg-install${PKGNAMESUFFIX} +. endif + .endif .if defined(SERVER_ONLY) pre-su-install: - @ ${SETENV} PKG_PREFIX=${PREFIX} PGUSER=${PGUSER} PGGROUP=${PGGROUP} \ + @ ${SETENV} PKG_PREFIX=${PREFIX} PG_USER=$(PG_USER) PG_GROUP=$(PG_GROUP) \ ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL .endif @@ -299,7 +310,7 @@ do-install: . if defined(SERVER_ONLY) @ ${MKDIR} ${PREFIX}/share/postgresql ;\ ${MKDIR} ${PREFIX}/etc/periodic/daily ;\ - ${INSTALL_SCRIPT} ${FILESDIR}/502.pgsql \ + ${INSTALL_SCRIPT} ${WRKDIR}/502.pgsql \ ${PREFIX}/etc/periodic/daily . endif # SERVER_ONLY . if defined(CLIENT_ONLY) diff --git a/databases/postgresql84-server/distinfo b/databases/postgresql84-server/distinfo index 9055ecd8fdbc..3e969fbbef77 100644 --- a/databases/postgresql84-server/distinfo +++ b/databases/postgresql84-server/distinfo @@ -1,4 +1,4 @@ -SHA256 (postgresql/postgresql-8.4.7.tar.bz2) = 08032849da121e67e318f7ff4e68d3ac88f29050e242641f717c4270839b597b -SIZE (postgresql/postgresql-8.4.7.tar.bz2) = 14133535 +SHA256 (postgresql/postgresql-8.4.8.tar.bz2) = 3e90ef2a86a9f4831e21ff4a574fbfb8e1b8c097af637c93ec43c64c684a0938 +SIZE (postgresql/postgresql-8.4.8.tar.bz2) = 14136376 SHA256 (postgresql/pg-840-icu-2009-09-15.diff.gz) = c09d3b59340a3bb6ea754e985739d4fbb47f730d1e48a357c5585825034fc72e SIZE (postgresql/pg-840-icu-2009-09-15.diff.gz) = 4321 diff --git a/databases/postgresql84-server/files/502.pgsql b/databases/postgresql84-server/files/502.pgsql deleted file mode 100644 index 281189a59c46..000000000000 --- a/databases/postgresql84-server/files/502.pgsql +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# Maintenance shell script to vacuum and backup database -# Put this in /usr/local/etc/periodic/daily, and it will be run -# every night -# -# Written by Palle Girgensohn -# -# In public domain, do what you like with it, -# and use it at your own risk... :) -# - -# Define these variables in either /etc/periodic.conf or -# /etc/periodic.conf.local to override the default values. -# -# daily_pgsql_backup_enable="YES" # do backup of all databases -# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases -# daily_pgsql_vacuum_enable="YES" # do vacuum - -daily_pgsql_vacuum_args="-z" -daily_pgsql_pgdump_args="-b -F c" -# backupdir is relative to ~pgsql home directory unless it begins with a slash: -daily_pgsql_backupdir="~pgsql/backups" -daily_pgsql_savedays="7" - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -# allow '~´ in dir name -eval backupdir=${daily_pgsql_backupdir} - -rc=0 - -pgsql_backup() { - # daily_pgsql_backupdir must be writeable by user pgsql - # ~pgsql is just that under normal circumstances, - # but this might not be where you want the backups... - if [ ! -d ${backupdir} ] ; then - echo Creating ${backupdir} - mkdir -m 700 ${backupdir}; chown pgsql ${backupdir} - fi - - echo - echo "PostgreSQL backups" - - # Protect the data - umask 077 - rc=$? - now=`date "+%Y-%m-%dT%H:%M:%S"` - file=${daily_pgsql_backupdir}/pgglobals_${now} - su -l pgsql -c "umask 077; pg_dumpall -g | gzip -9 > ${file}.gz" - - db=$1 - while shift; do - echo -n " $db" - file=${backupdir}/pgdump_${db}_${now} - su -l pgsql -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}" - [ $? -gt 0 ] && rc=3 - db=$1 - done - - if [ $rc -gt 0 ]; then - echo - echo "Errors were reported during backup." - fi - - # cleaning up old data - find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ - -a -mtime +${daily_pgsql_savedays} -delete - echo -} - -case "$daily_pgsql_backup_enable" in - [Yy][Ee][Ss]) - dbnames=`su -l pgsql -c "umask 077; psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` - pgsql_backup $dbnames - ;; - - [Nn][Oo]) - ;; - - "") - ;; - - *) - pgsql_backup $daily_pgsql_backup_enable - ;; -esac - -case "$daily_pgsql_vacuum_enable" in - [Yy][Ee][Ss]) - - echo - echo "PostgreSQL vacuum" - su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}" - if [ $? -gt 0 ] - then - echo - echo "Errors were reported during vacuum." - rc=3 - fi - ;; -esac - -exit $rc diff --git a/databases/postgresql84-server/files/502.pgsql.in b/databases/postgresql84-server/files/502.pgsql.in new file mode 100644 index 000000000000..9fcd98cce81a --- /dev/null +++ b/databases/postgresql84-server/files/502.pgsql.in @@ -0,0 +1,112 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql84-server/files/502.pgsql.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ +# +# Maintenance shell script to vacuum and backup database +# Put this in /usr/local/etc/periodic/daily, and it will be run +# every night +# +# Written by Palle Girgensohn +# +# In public domain, do what you like with it, +# and use it at your own risk... :) +# + +# Define these variables in either /etc/periodic.conf or +# /etc/periodic.conf.local to override the default values. +# +# daily_pgsql_backup_enable="YES" # do backup of all databases +# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases +# daily_pgsql_vacuum_enable="YES" # do vacuum + +daily_pgsql_vacuum_args="-z" +daily_pgsql_pgdump_args="-b -F c" +# backupdir is relative to ~pgsql home directory unless it begins with a slash: +daily_pgsql_backupdir="~%%PG_USER%%/backups" +daily_pgsql_savedays="7" + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +# allow '~´ in dir name +eval backupdir=${daily_pgsql_backupdir} + +rc=0 + +pgsql_backup() { + # daily_pgsql_backupdir must be writeable by user %%PG_USER%% + # ~%%PG_USER%% is just that under normal circumstances, + # but this might not be where you want the backups... + if [ ! -d ${backupdir} ] ; then + echo Creating ${backupdir} + mkdir -m 700 ${backupdir}; chown %%PG_USER%% ${backupdir} + fi + + echo + echo "PostgreSQL backups" + + # Protect the data + umask 077 + rc=$? + now=`date "+%Y-%m-%dT%H:%M:%S"` + file=${daily_pgsql_backupdir}/pgglobals_${now} + su -l %%PG_USER%% -c "umask 077; pg_dumpall -g -U %%PG_USER%% | gzip -9 > ${file}.gz" + + db=$1 + while shift; do + echo -n " $db" + file=${backupdir}/pgdump_${db}_${now} + su -l %%PG_USER%% -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -U %%PG_USER%% -f ${file} ${db}" + [ $? -gt 0 ] && rc=3 + db=$1 + done + + if [ $rc -gt 0 ]; then + echo + echo "Errors were reported during backup." + fi + + # cleaning up old data + find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ + -a -mtime +${daily_pgsql_savedays} -delete + echo +} + +case "$daily_pgsql_backup_enable" in + [Yy][Ee][Ss]) + dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` + pgsql_backup $dbnames + ;; + + [Nn][Oo]) + ;; + + "") + ;; + + *) + pgsql_backup $daily_pgsql_backup_enable + ;; +esac + +case "$daily_pgsql_vacuum_enable" in + [Yy][Ee][Ss]) + + echo + echo "PostgreSQL vacuum" + su -l %%PG_USER%% -c "vacuumdb -a -q -U %%PG_USER%% ${daily_pgsql_vacuum_args}" + if [ $? -gt 0 ] + then + echo + echo "Errors were reported during vacuum." + rc=3 + fi + ;; +esac + +exit $rc diff --git a/databases/postgresql84-server/files/pkg-install-server.in b/databases/postgresql84-server/files/pkg-install-server.in new file mode 100644 index 000000000000..a9651cfa6156 --- /dev/null +++ b/databases/postgresql84-server/files/pkg-install-server.in @@ -0,0 +1,66 @@ +#! /bin/sh + +# $FreeBSD$ + +PATH=/bin:/usr/bin:/usr/sbin +PG_USER=%%PG_USER%% +PG_GROUP=%%PG_GROUP%% +PG_UID=%%PG_UID%% + +backupwarning() { echo " + + =========== BACKUP YOUR DATA! ============= + As always, backup your data before + upgrading. If the upgrade leads to a higher + minor revision (e.g. 7.3.x -> 7.4), a dump + and restore of all databases is + required. This is *NOT* done by the port! + + Press ctrl-C *now* if you need to pg_dump. + =========================================== +" + sleep 5 +} + +case $2 in +PRE-INSTALL) + backupwarning + PGUSER=${PGUSER:-${PG_USER}} + PGGROUP=${PGGROUP:-${PG_GROUP}} + DB_DIR=${PKG_PREFIX}/${PG_USER} + UID=${PG_UID} + GID=${PG_UID} + + if pw group show "${PGGROUP}" 2>/dev/null; then + echo "You already have a group \"${PGGROUP}\", so I will use it." + else + if pw groupadd ${PGGROUP} -g ${GID}; then + echo "Added group \"${PGGROUP}\"." + else + echo "Adding group \"${PGGROUP}\" failed..." + exit 1 + fi + fi + + if pw user show "${PGUSER}" 2>/dev/null; then + echo "You already have a user \"${PGUSER}\", so I will use it." + else + if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ + -d ${DB_DIR} -c "PostgreSQL Daemon" + then + echo "Added user \"${PGUSER}\"." + else + echo "Adding user \"${PGUSER}\" failed..." + exit 1 + fi + fi + + if ! [ -x ~${PGUSER} ] ; then + install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} + fi + ;; + +BACKUPWARNING) + backupwarning + ;; +esac diff --git a/databases/postgresql84-server/files/pkg-message-client.in b/databases/postgresql84-server/files/pkg-message-client.in index 3183bc136aa6..ff486a635645 100644 --- a/databases/postgresql84-server/files/pkg-message-client.in +++ b/databases/postgresql84-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql84-server/files/postgresql.in b/databases/postgresql84-server/files/postgresql.in index 405d2efaa4d3..d1e3c763f8da 100644 --- a/databases/postgresql84-server/files/postgresql.in +++ b/databases/postgresql84-server/files/postgresql.in @@ -32,7 +32,7 @@ load_rc_config postgresql # set defaults postgresql_enable=${postgresql_enable:-"NO"} postgresql_flags=${postgresql_flags:-"-w -s -m fast"} -postgresql_user=pgsql +postgresql_user=${postgresql_user:-"%%PG_USER%%"} eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"} postgresql_class=${postgresql_class:-"default"} postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc-collate=C"} diff --git a/databases/postgresql84-server/pkg-install-server b/databases/postgresql84-server/pkg-install-server deleted file mode 100644 index 6dc3b6fdbd67..000000000000 --- a/databases/postgresql84-server/pkg-install-server +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh - -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -backupwarning() { echo " - - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. If the upgrade leads to a higher - minor revision (e.g. 7.3.x -> 7.4), a dump - and restore of all databases is - required. This is *NOT* done by the port! - - Press ctrl-C *now* if you need to pg_dump. - =========================================== -" - sleep 5 -} - -case $2 in -PRE-INSTALL) - backupwarning - PGUSER=${PGUSER:-pgsql} - PGGROUP=${PGGROUP:-pgsql} - DB_DIR=${PKG_PREFIX}/${PGUSER} - UID=70 - GID=70 - - if pw group show "${PGGROUP}" 2>/dev/null; then - echo "You already have a group \"${PGGROUP}\", so I will use it." - else - if pw groupadd ${PGGROUP} -g ${GID}; then - echo "Added group \"${PGGROUP}\"." - else - echo "Adding group \"${PGGROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${PGUSER}" 2>/dev/null; then - echo "You already have a user \"${PGUSER}\", so I will use it." - else - if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ - -d ${DB_DIR} -c "PostgreSQL Daemon" - then - echo "Added user \"${PGUSER}\"." - else - echo "Adding user \"${PGUSER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~${PGUSER} ] ; then - install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} - fi - ;; - -BACKUPWARNING) - backupwarning - ;; -esac diff --git a/databases/postgresql84-server/pkg-plist-client b/databases/postgresql84-server/pkg-plist-client index 702575d6b8fa..715b496896bb 100644 --- a/databases/postgresql84-server/pkg-plist-client +++ b/databases/postgresql84-server/pkg-plist-client @@ -40,6 +40,7 @@ include/postgresql/server/access/slru.h include/postgresql/server/access/subtrans.h include/postgresql/server/access/sysattr.h include/postgresql/server/access/transam.h +include/postgresql/server/access/tupconvert.h include/postgresql/server/access/tupdesc.h include/postgresql/server/access/tupmacs.h include/postgresql/server/access/tuptoaster.h diff --git a/databases/postgresql84-server/pkg-plist-server b/databases/postgresql84-server/pkg-plist-server index d539274d1363..9134bcce6f4e 100644 --- a/databases/postgresql84-server/pkg-plist-server +++ b/databases/postgresql84-server/pkg-plist-server @@ -273,6 +273,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Mendoza %%TZDATA%%share/postgresql/timezone/America/Menominee %%TZDATA%%share/postgresql/timezone/America/Merida +%%TZDATA%%share/postgresql/timezone/America/Metlakatla %%TZDATA%%share/postgresql/timezone/America/Mexico_City %%TZDATA%%share/postgresql/timezone/America/Miquelon %%TZDATA%%share/postgresql/timezone/America/Moncton @@ -285,6 +286,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Nipigon %%TZDATA%%share/postgresql/timezone/America/Nome %%TZDATA%%share/postgresql/timezone/America/Noronha +%%TZDATA%%share/postgresql/timezone/America/North_Dakota/Beulah %%TZDATA%%share/postgresql/timezone/America/North_Dakota/Center %%TZDATA%%share/postgresql/timezone/America/North_Dakota/New_Salem %%TZDATA%%share/postgresql/timezone/America/Ojinaga @@ -311,6 +313,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Sao_Paulo %%TZDATA%%share/postgresql/timezone/America/Scoresbysund %%TZDATA%%share/postgresql/timezone/America/Shiprock +%%TZDATA%%share/postgresql/timezone/America/Sitka %%TZDATA%%share/postgresql/timezone/America/St_Barthelemy %%TZDATA%%share/postgresql/timezone/America/St_Johns %%TZDATA%%share/postgresql/timezone/America/St_Kitts @@ -755,4 +758,4 @@ share/postgresql/tsearch_data/thesaurus_sample.ths @dirrmtry etc/periodic/daily @dirrmtry etc/periodic @dirrmtry lib/postgresql -@dirrmtry pgsql +@dirrmtry %%PG_USER%% diff --git a/databases/postgresql90-server/Makefile b/databases/postgresql90-server/Makefile index 52fcd0eb0bc0..21b88acbf291 100644 --- a/databases/postgresql90-server/Makefile +++ b/databases/postgresql90-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -DISTVERSION?= 9.0.3 +DISTVERSION?= 9.0.4 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${DISTVERSION} @@ -24,7 +24,6 @@ DIST_SUBDIR= postgresql UNIQUENAME?= ${PORTNAME}90 LATEST_LINK?= ${PKGNAMEPREFIX}${UNIQUENAME}${PKGNAMESUFFIX} -PKGINSTALL?= ${PKGDIR}/pkg-install${PKGNAMESUFFIX} USE_BZIP2= YES USE_GMAKE= YES GNU_CONFIGURE= YES @@ -33,8 +32,9 @@ GNU_CONFIGURE= YES .undef GNU_CONFIGURE .endif -PGUSER= pgsql -PGGROUP= pgsql +PG_USER?= pgsql +PG_GROUP?= pgsql +PG_UID?= 70 LDFLAGS+= -L${LOCALBASE}/lib INCLUDES+= -I${LOCALBASE}/include @@ -60,6 +60,7 @@ SERVER_ONLY= yes USE_RC_SUBR= postgresql USE_PGSQL= yes WANT_PGSQL_VER= ${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g} +SUB_FILES+= 502.pgsql .endif .if !defined(SLAVE_ONLY) @@ -93,7 +94,7 @@ OPTIONS+= OPTIMIZED_CFLAGS "Builds with compiler optimizations (-O3)" off OPTIONS+= XML "Build with XML data type (server)" on OPTIONS+= TZDATA "Use internal timezone database (server)" on OPTIONS+= DEBUG "Builds with debugging symbols" off -OPTIONS+= GSSAPI "BUild with GSSAPI support" on +OPTIONS+= GSSAPI "BUild with GSSAPI support" off # See http://people.freebsd.org/~girgen/postgresql-icu/README.html for more info OPTIONS+= ICU "Use ICU for unicode collation (server)" off @@ -283,7 +284,7 @@ MAN7= ABORT.7 ALTER_AGGREGATE.7 ALTER_CONVERSION.7 ALTER_DATABASE.7 \ .if defined(SERVER_ONLY) pre-everything:: - @${SH} ${PKGINSTALL} ${PORTNAME} BACKUPWARNING + @${SH} ${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in ${PORTNAME} BACKUPWARNING .endif .if !defined(NO_BUILD) @@ -305,11 +306,19 @@ do-build: SUB_FILES+= pkg-message${PKGNAMESUFFIX} PKGMESSAGE= ${WRKSRC}/pkg-message${PKGNAMESUFFIX} . endif +. if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in) +SUB_FILES+= pkg-install${PKGNAMESUFFIX} +SUB_LIST= PG_GROUP=$(PG_GROUP) \ + PG_USER=$(PG_USER) \ + PG_UID=$(PG_UID) +PLIST_SUB+= PG_USER=$(PG_USER) +PKGINSTALL= ${WRKDIR}/pkg-install${PKGNAMESUFFIX} +. endif .endif .if defined(SERVER_ONLY) pre-su-install: - @ ${SETENV} PKG_PREFIX=${PREFIX} PGUSER=${PGUSER} PGGROUP=${PGGROUP} \ + @ ${SETENV} PKG_PREFIX=${PREFIX} PG_USER=$(PG_USER) PG_GROUP=$(PG_GROUP) \ ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL .endif @@ -330,7 +339,7 @@ do-install: . if defined(SERVER_ONLY) @ ${MKDIR} ${PREFIX}/share/postgresql ;\ ${MKDIR} ${PREFIX}/etc/periodic/daily ;\ - ${INSTALL_SCRIPT} ${FILESDIR}/502.pgsql \ + ${INSTALL_SCRIPT} ${WRKDIR}/502.pgsql \ ${PREFIX}/etc/periodic/daily . endif # SERVER_ONLY . if defined(CLIENT_ONLY) diff --git a/databases/postgresql90-server/distinfo b/databases/postgresql90-server/distinfo index 82c15fd2e1b9..fab2290611db 100644 --- a/databases/postgresql90-server/distinfo +++ b/databases/postgresql90-server/distinfo @@ -1,4 +1,4 @@ -SHA256 (postgresql/postgresql-9.0.3.tar.bz2) = cf429421dea73a7bd5ef9fbdd1212a0d01c0f63c2059e0218a0e350891867b35 -SIZE (postgresql/postgresql-9.0.3.tar.bz2) = 14040705 +SHA256 (postgresql/postgresql-9.0.4.tar.bz2) = 30572706e3176228415991895e63a8b77343a5abad11407961cfd08790be9e84 +SIZE (postgresql/postgresql-9.0.4.tar.bz2) = 14040871 SHA256 (postgresql/pg-900-icu-2010-09-19.diff.gz) = 27cea46241ec814965c278330cd96f67ee03422b7758a210713a63b4b5bb77e9 SIZE (postgresql/pg-900-icu-2010-09-19.diff.gz) = 4349 diff --git a/databases/postgresql90-server/files/502.pgsql b/databases/postgresql90-server/files/502.pgsql deleted file mode 100644 index 281189a59c46..000000000000 --- a/databases/postgresql90-server/files/502.pgsql +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# Maintenance shell script to vacuum and backup database -# Put this in /usr/local/etc/periodic/daily, and it will be run -# every night -# -# Written by Palle Girgensohn -# -# In public domain, do what you like with it, -# and use it at your own risk... :) -# - -# Define these variables in either /etc/periodic.conf or -# /etc/periodic.conf.local to override the default values. -# -# daily_pgsql_backup_enable="YES" # do backup of all databases -# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases -# daily_pgsql_vacuum_enable="YES" # do vacuum - -daily_pgsql_vacuum_args="-z" -daily_pgsql_pgdump_args="-b -F c" -# backupdir is relative to ~pgsql home directory unless it begins with a slash: -daily_pgsql_backupdir="~pgsql/backups" -daily_pgsql_savedays="7" - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -# allow '~´ in dir name -eval backupdir=${daily_pgsql_backupdir} - -rc=0 - -pgsql_backup() { - # daily_pgsql_backupdir must be writeable by user pgsql - # ~pgsql is just that under normal circumstances, - # but this might not be where you want the backups... - if [ ! -d ${backupdir} ] ; then - echo Creating ${backupdir} - mkdir -m 700 ${backupdir}; chown pgsql ${backupdir} - fi - - echo - echo "PostgreSQL backups" - - # Protect the data - umask 077 - rc=$? - now=`date "+%Y-%m-%dT%H:%M:%S"` - file=${daily_pgsql_backupdir}/pgglobals_${now} - su -l pgsql -c "umask 077; pg_dumpall -g | gzip -9 > ${file}.gz" - - db=$1 - while shift; do - echo -n " $db" - file=${backupdir}/pgdump_${db}_${now} - su -l pgsql -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}" - [ $? -gt 0 ] && rc=3 - db=$1 - done - - if [ $rc -gt 0 ]; then - echo - echo "Errors were reported during backup." - fi - - # cleaning up old data - find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ - -a -mtime +${daily_pgsql_savedays} -delete - echo -} - -case "$daily_pgsql_backup_enable" in - [Yy][Ee][Ss]) - dbnames=`su -l pgsql -c "umask 077; psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` - pgsql_backup $dbnames - ;; - - [Nn][Oo]) - ;; - - "") - ;; - - *) - pgsql_backup $daily_pgsql_backup_enable - ;; -esac - -case "$daily_pgsql_vacuum_enable" in - [Yy][Ee][Ss]) - - echo - echo "PostgreSQL vacuum" - su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}" - if [ $? -gt 0 ] - then - echo - echo "Errors were reported during vacuum." - rc=3 - fi - ;; -esac - -exit $rc diff --git a/databases/postgresql90-server/files/502.pgsql.in b/databases/postgresql90-server/files/502.pgsql.in new file mode 100644 index 000000000000..50129aff7764 --- /dev/null +++ b/databases/postgresql90-server/files/502.pgsql.in @@ -0,0 +1,112 @@ +%%PG_USER%%#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql90-server/files/502.pgsql.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ +# +# Maintenance shell script to vacuum and backup database +# Put this in /usr/local/etc/periodic/daily, and it will be run +# every night +# +# Written by Palle Girgensohn +# +# In public domain, do what you like with it, +# and use it at your own risk... :) +# + +# Define these variables in either /etc/periodic.conf or +# /etc/periodic.conf.local to override the default values. +# +# daily_pgsql_backup_enable="YES" # do backup of all databases +# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases +# daily_pgsql_vacuum_enable="YES" # do vacuum + +daily_pgsql_vacuum_args="-z" +daily_pgsql_pgdump_args="-b -F c" +# backupdir is relative to ~pgsql home directory unless it begins with a slash: +daily_pgsql_backupdir="~%%PG_USER%%/backups" +daily_pgsql_savedays="7" + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +# allow '~´ in dir name +eval backupdir=${daily_pgsql_backupdir} + +rc=0 + +pgsql_backup() { + # daily_pgsql_backupdir must be writeable by user %%PG_USER%% + # ~%%PG_USER%% is just that under normal circumstances, + # but this might not be where you want the backups... + if [ ! -d ${backupdir} ] ; then + echo Creating ${backupdir} + mkdir -m 700 ${backupdir}; chown %%PG_USER%% ${backupdir} + fi + + echo + echo "PostgreSQL backups" + + # Protect the data + umask 077 + rc=$? + now=`date "+%Y-%m-%dT%H:%M:%S"` + file=${daily_pgsql_backupdir}/pgglobals_${now} + su -l %%PG_USER%% -c "umask 077; pg_dumpall -g -U %%PG_USER%% | gzip -9 > ${file}.gz" + + db=$1 + while shift; do + echo -n " $db" + file=${backupdir}/pgdump_${db}_${now} + su -l %%PG_USER%% -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -U %%PG_USER%% -f ${file} ${db}" + [ $? -gt 0 ] && rc=3 + db=$1 + done + + if [ $rc -gt 0 ]; then + echo + echo "Errors were reported during backup." + fi + + # cleaning up old data + find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ + -a -mtime +${daily_pgsql_savedays} -delete + echo +} + +case "$daily_pgsql_backup_enable" in + [Yy][Ee][Ss]) + dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` + pgsql_backup $dbnames + ;; + + [Nn][Oo]) + ;; + + "") + ;; + + *) + pgsql_backup $daily_pgsql_backup_enable + ;; +esac + +case "$daily_pgsql_vacuum_enable" in + [Yy][Ee][Ss]) + + echo + echo "PostgreSQL vacuum" + su -l %%PG_USER%% -c "vacuumdb -a -q -U %%PG_USER%% ${daily_pgsql_vacuum_args}" + if [ $? -gt 0 ] + then + echo + echo "Errors were reported during vacuum." + rc=3 + fi + ;; +esac + +exit $rc diff --git a/databases/postgresql90-server/files/pkg-install-server.in b/databases/postgresql90-server/files/pkg-install-server.in new file mode 100644 index 000000000000..a225290b6a67 --- /dev/null +++ b/databases/postgresql90-server/files/pkg-install-server.in @@ -0,0 +1,66 @@ +#! /bin/sh + +# $FreeBSD$ + +PATH=/bin:/usr/bin:/usr/sbin +PG_USER=%%PG_USER%% +PG_GROUP=%%PG_GROUP%% +PG_UID=%%PG_UID%% + +backupwarning() { echo " + + =========== BACKUP YOUR DATA! ============= + As always, backup your data before + upgrading. If the upgrade leads to a higher + minor revision (e.g. 7.3.x -> 7.4), a dump + and restore of all databases is + required. This is *NOT* done by the port! + + Press ctrl-C *now* if you need to pg_dump. + =========================================== +" + sleep 5 +} + +case $2 in +PRE-INSTALL) + backupwarning + PGUSER=${PGUSER:-${PG_USER}} + PGGROUP=${PGGROUP:-${PG_GROUP}} + DB_DIR=${PKG_PREFIX}/${PGUSER} + UID=${PG_UID} + GID=${PG_UID} + + if pw group show "${PGGROUP}" 2>/dev/null; then + echo "You already have a group \"${PGGROUP}\", so I will use it." + else + if pw groupadd ${PGGROUP} -g ${GID}; then + echo "Added group \"${PGGROUP}\"." + else + echo "Adding group \"${PGGROUP}\" failed..." + exit 1 + fi + fi + + if pw user show "${PGUSER}" 2>/dev/null; then + echo "You already have a user \"${PGUSER}\", so I will use it." + else + if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ + -d ${DB_DIR} -c "PostgreSQL Daemon" + then + echo "Added user \"${PGUSER}\"." + else + echo "Adding user \"${PGUSER}\" failed..." + exit 1 + fi + fi + + if ! [ -x ~${PGUSER} ] ; then + install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} + fi + ;; + +BACKUPWARNING) + backupwarning + ;; +esac diff --git a/databases/postgresql90-server/files/pkg-message-client.in b/databases/postgresql90-server/files/pkg-message-client.in index 3183bc136aa6..ff486a635645 100644 --- a/databases/postgresql90-server/files/pkg-message-client.in +++ b/databases/postgresql90-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql90-server/files/postgresql.in b/databases/postgresql90-server/files/postgresql.in index 405d2efaa4d3..d1e3c763f8da 100644 --- a/databases/postgresql90-server/files/postgresql.in +++ b/databases/postgresql90-server/files/postgresql.in @@ -32,7 +32,7 @@ load_rc_config postgresql # set defaults postgresql_enable=${postgresql_enable:-"NO"} postgresql_flags=${postgresql_flags:-"-w -s -m fast"} -postgresql_user=pgsql +postgresql_user=${postgresql_user:-"%%PG_USER%%"} eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"} postgresql_class=${postgresql_class:-"default"} postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc-collate=C"} diff --git a/databases/postgresql90-server/pkg-install-server b/databases/postgresql90-server/pkg-install-server deleted file mode 100644 index 6dc3b6fdbd67..000000000000 --- a/databases/postgresql90-server/pkg-install-server +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh - -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -backupwarning() { echo " - - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. If the upgrade leads to a higher - minor revision (e.g. 7.3.x -> 7.4), a dump - and restore of all databases is - required. This is *NOT* done by the port! - - Press ctrl-C *now* if you need to pg_dump. - =========================================== -" - sleep 5 -} - -case $2 in -PRE-INSTALL) - backupwarning - PGUSER=${PGUSER:-pgsql} - PGGROUP=${PGGROUP:-pgsql} - DB_DIR=${PKG_PREFIX}/${PGUSER} - UID=70 - GID=70 - - if pw group show "${PGGROUP}" 2>/dev/null; then - echo "You already have a group \"${PGGROUP}\", so I will use it." - else - if pw groupadd ${PGGROUP} -g ${GID}; then - echo "Added group \"${PGGROUP}\"." - else - echo "Adding group \"${PGGROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${PGUSER}" 2>/dev/null; then - echo "You already have a user \"${PGUSER}\", so I will use it." - else - if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ - -d ${DB_DIR} -c "PostgreSQL Daemon" - then - echo "Added user \"${PGUSER}\"." - else - echo "Adding user \"${PGUSER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~${PGUSER} ] ; then - install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} - fi - ;; - -BACKUPWARNING) - backupwarning - ;; -esac diff --git a/databases/postgresql90-server/pkg-plist-server b/databases/postgresql90-server/pkg-plist-server index 457bffe0ccbc..ffd6dfc752d2 100644 --- a/databases/postgresql90-server/pkg-plist-server +++ b/databases/postgresql90-server/pkg-plist-server @@ -276,6 +276,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Mendoza %%TZDATA%%share/postgresql/timezone/America/Menominee %%TZDATA%%share/postgresql/timezone/America/Merida +%%TZDATA%%share/postgresql/timezone/America/Metlakatla %%TZDATA%%share/postgresql/timezone/America/Mexico_City %%TZDATA%%share/postgresql/timezone/America/Miquelon %%TZDATA%%share/postgresql/timezone/America/Moncton @@ -288,6 +289,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Nipigon %%TZDATA%%share/postgresql/timezone/America/Nome %%TZDATA%%share/postgresql/timezone/America/Noronha +%%TZDATA%%share/postgresql/timezone/America/North_Dakota/Beulah %%TZDATA%%share/postgresql/timezone/America/North_Dakota/Center %%TZDATA%%share/postgresql/timezone/America/North_Dakota/New_Salem %%TZDATA%%share/postgresql/timezone/America/Ojinaga @@ -314,6 +316,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Sao_Paulo %%TZDATA%%share/postgresql/timezone/America/Scoresbysund %%TZDATA%%share/postgresql/timezone/America/Shiprock +%%TZDATA%%share/postgresql/timezone/America/Sitka %%TZDATA%%share/postgresql/timezone/America/St_Barthelemy %%TZDATA%%share/postgresql/timezone/America/St_Johns %%TZDATA%%share/postgresql/timezone/America/St_Kitts @@ -758,4 +761,4 @@ share/postgresql/tsearch_data/thesaurus_sample.ths @dirrmtry etc/periodic/daily @dirrmtry etc/periodic @dirrmtry lib/postgresql -@dirrmtry pgsql +@dirrmtry %%PG_USER%% diff --git a/databases/postgresql91-server/Makefile b/databases/postgresql91-server/Makefile index 52fcd0eb0bc0..21b88acbf291 100644 --- a/databases/postgresql91-server/Makefile +++ b/databases/postgresql91-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -DISTVERSION?= 9.0.3 +DISTVERSION?= 9.0.4 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${DISTVERSION} @@ -24,7 +24,6 @@ DIST_SUBDIR= postgresql UNIQUENAME?= ${PORTNAME}90 LATEST_LINK?= ${PKGNAMEPREFIX}${UNIQUENAME}${PKGNAMESUFFIX} -PKGINSTALL?= ${PKGDIR}/pkg-install${PKGNAMESUFFIX} USE_BZIP2= YES USE_GMAKE= YES GNU_CONFIGURE= YES @@ -33,8 +32,9 @@ GNU_CONFIGURE= YES .undef GNU_CONFIGURE .endif -PGUSER= pgsql -PGGROUP= pgsql +PG_USER?= pgsql +PG_GROUP?= pgsql +PG_UID?= 70 LDFLAGS+= -L${LOCALBASE}/lib INCLUDES+= -I${LOCALBASE}/include @@ -60,6 +60,7 @@ SERVER_ONLY= yes USE_RC_SUBR= postgresql USE_PGSQL= yes WANT_PGSQL_VER= ${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g} +SUB_FILES+= 502.pgsql .endif .if !defined(SLAVE_ONLY) @@ -93,7 +94,7 @@ OPTIONS+= OPTIMIZED_CFLAGS "Builds with compiler optimizations (-O3)" off OPTIONS+= XML "Build with XML data type (server)" on OPTIONS+= TZDATA "Use internal timezone database (server)" on OPTIONS+= DEBUG "Builds with debugging symbols" off -OPTIONS+= GSSAPI "BUild with GSSAPI support" on +OPTIONS+= GSSAPI "BUild with GSSAPI support" off # See http://people.freebsd.org/~girgen/postgresql-icu/README.html for more info OPTIONS+= ICU "Use ICU for unicode collation (server)" off @@ -283,7 +284,7 @@ MAN7= ABORT.7 ALTER_AGGREGATE.7 ALTER_CONVERSION.7 ALTER_DATABASE.7 \ .if defined(SERVER_ONLY) pre-everything:: - @${SH} ${PKGINSTALL} ${PORTNAME} BACKUPWARNING + @${SH} ${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in ${PORTNAME} BACKUPWARNING .endif .if !defined(NO_BUILD) @@ -305,11 +306,19 @@ do-build: SUB_FILES+= pkg-message${PKGNAMESUFFIX} PKGMESSAGE= ${WRKSRC}/pkg-message${PKGNAMESUFFIX} . endif +. if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in) +SUB_FILES+= pkg-install${PKGNAMESUFFIX} +SUB_LIST= PG_GROUP=$(PG_GROUP) \ + PG_USER=$(PG_USER) \ + PG_UID=$(PG_UID) +PLIST_SUB+= PG_USER=$(PG_USER) +PKGINSTALL= ${WRKDIR}/pkg-install${PKGNAMESUFFIX} +. endif .endif .if defined(SERVER_ONLY) pre-su-install: - @ ${SETENV} PKG_PREFIX=${PREFIX} PGUSER=${PGUSER} PGGROUP=${PGGROUP} \ + @ ${SETENV} PKG_PREFIX=${PREFIX} PG_USER=$(PG_USER) PG_GROUP=$(PG_GROUP) \ ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL .endif @@ -330,7 +339,7 @@ do-install: . if defined(SERVER_ONLY) @ ${MKDIR} ${PREFIX}/share/postgresql ;\ ${MKDIR} ${PREFIX}/etc/periodic/daily ;\ - ${INSTALL_SCRIPT} ${FILESDIR}/502.pgsql \ + ${INSTALL_SCRIPT} ${WRKDIR}/502.pgsql \ ${PREFIX}/etc/periodic/daily . endif # SERVER_ONLY . if defined(CLIENT_ONLY) diff --git a/databases/postgresql91-server/distinfo b/databases/postgresql91-server/distinfo index 82c15fd2e1b9..fab2290611db 100644 --- a/databases/postgresql91-server/distinfo +++ b/databases/postgresql91-server/distinfo @@ -1,4 +1,4 @@ -SHA256 (postgresql/postgresql-9.0.3.tar.bz2) = cf429421dea73a7bd5ef9fbdd1212a0d01c0f63c2059e0218a0e350891867b35 -SIZE (postgresql/postgresql-9.0.3.tar.bz2) = 14040705 +SHA256 (postgresql/postgresql-9.0.4.tar.bz2) = 30572706e3176228415991895e63a8b77343a5abad11407961cfd08790be9e84 +SIZE (postgresql/postgresql-9.0.4.tar.bz2) = 14040871 SHA256 (postgresql/pg-900-icu-2010-09-19.diff.gz) = 27cea46241ec814965c278330cd96f67ee03422b7758a210713a63b4b5bb77e9 SIZE (postgresql/pg-900-icu-2010-09-19.diff.gz) = 4349 diff --git a/databases/postgresql91-server/files/502.pgsql b/databases/postgresql91-server/files/502.pgsql deleted file mode 100644 index 281189a59c46..000000000000 --- a/databases/postgresql91-server/files/502.pgsql +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# Maintenance shell script to vacuum and backup database -# Put this in /usr/local/etc/periodic/daily, and it will be run -# every night -# -# Written by Palle Girgensohn -# -# In public domain, do what you like with it, -# and use it at your own risk... :) -# - -# Define these variables in either /etc/periodic.conf or -# /etc/periodic.conf.local to override the default values. -# -# daily_pgsql_backup_enable="YES" # do backup of all databases -# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases -# daily_pgsql_vacuum_enable="YES" # do vacuum - -daily_pgsql_vacuum_args="-z" -daily_pgsql_pgdump_args="-b -F c" -# backupdir is relative to ~pgsql home directory unless it begins with a slash: -daily_pgsql_backupdir="~pgsql/backups" -daily_pgsql_savedays="7" - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -# allow '~´ in dir name -eval backupdir=${daily_pgsql_backupdir} - -rc=0 - -pgsql_backup() { - # daily_pgsql_backupdir must be writeable by user pgsql - # ~pgsql is just that under normal circumstances, - # but this might not be where you want the backups... - if [ ! -d ${backupdir} ] ; then - echo Creating ${backupdir} - mkdir -m 700 ${backupdir}; chown pgsql ${backupdir} - fi - - echo - echo "PostgreSQL backups" - - # Protect the data - umask 077 - rc=$? - now=`date "+%Y-%m-%dT%H:%M:%S"` - file=${daily_pgsql_backupdir}/pgglobals_${now} - su -l pgsql -c "umask 077; pg_dumpall -g | gzip -9 > ${file}.gz" - - db=$1 - while shift; do - echo -n " $db" - file=${backupdir}/pgdump_${db}_${now} - su -l pgsql -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}" - [ $? -gt 0 ] && rc=3 - db=$1 - done - - if [ $rc -gt 0 ]; then - echo - echo "Errors were reported during backup." - fi - - # cleaning up old data - find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ - -a -mtime +${daily_pgsql_savedays} -delete - echo -} - -case "$daily_pgsql_backup_enable" in - [Yy][Ee][Ss]) - dbnames=`su -l pgsql -c "umask 077; psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` - pgsql_backup $dbnames - ;; - - [Nn][Oo]) - ;; - - "") - ;; - - *) - pgsql_backup $daily_pgsql_backup_enable - ;; -esac - -case "$daily_pgsql_vacuum_enable" in - [Yy][Ee][Ss]) - - echo - echo "PostgreSQL vacuum" - su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}" - if [ $? -gt 0 ] - then - echo - echo "Errors were reported during vacuum." - rc=3 - fi - ;; -esac - -exit $rc diff --git a/databases/postgresql91-server/files/502.pgsql.in b/databases/postgresql91-server/files/502.pgsql.in new file mode 100644 index 000000000000..266a822efb61 --- /dev/null +++ b/databases/postgresql91-server/files/502.pgsql.in @@ -0,0 +1,112 @@ +%%PG_USER%%#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql91-server/files/502.pgsql.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ +# +# Maintenance shell script to vacuum and backup database +# Put this in /usr/local/etc/periodic/daily, and it will be run +# every night +# +# Written by Palle Girgensohn +# +# In public domain, do what you like with it, +# and use it at your own risk... :) +# + +# Define these variables in either /etc/periodic.conf or +# /etc/periodic.conf.local to override the default values. +# +# daily_pgsql_backup_enable="YES" # do backup of all databases +# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases +# daily_pgsql_vacuum_enable="YES" # do vacuum + +daily_pgsql_vacuum_args="-z" +daily_pgsql_pgdump_args="-b -F c" +# backupdir is relative to ~pgsql home directory unless it begins with a slash: +daily_pgsql_backupdir="~%%PG_USER%%/backups" +daily_pgsql_savedays="7" + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +# allow '~´ in dir name +eval backupdir=${daily_pgsql_backupdir} + +rc=0 + +pgsql_backup() { + # daily_pgsql_backupdir must be writeable by user %%PG_USER%% + # ~%%PG_USER%% is just that under normal circumstances, + # but this might not be where you want the backups... + if [ ! -d ${backupdir} ] ; then + echo Creating ${backupdir} + mkdir -m 700 ${backupdir}; chown %%PG_USER%% ${backupdir} + fi + + echo + echo "PostgreSQL backups" + + # Protect the data + umask 077 + rc=$? + now=`date "+%Y-%m-%dT%H:%M:%S"` + file=${daily_pgsql_backupdir}/pgglobals_${now} + su -l %%PG_USER%% -c "umask 077; pg_dumpall -g -U %%PG_USER%% | gzip -9 > ${file}.gz" + + db=$1 + while shift; do + echo -n " $db" + file=${backupdir}/pgdump_${db}_${now} + su -l %%PG_USER%% -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -U %%PG_USER%% -f ${file} ${db}" + [ $? -gt 0 ] && rc=3 + db=$1 + done + + if [ $rc -gt 0 ]; then + echo + echo "Errors were reported during backup." + fi + + # cleaning up old data + find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ + -a -mtime +${daily_pgsql_savedays} -delete + echo +} + +case "$daily_pgsql_backup_enable" in + [Yy][Ee][Ss]) + dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` + pgsql_backup $dbnames + ;; + + [Nn][Oo]) + ;; + + "") + ;; + + *) + pgsql_backup $daily_pgsql_backup_enable + ;; +esac + +case "$daily_pgsql_vacuum_enable" in + [Yy][Ee][Ss]) + + echo + echo "PostgreSQL vacuum" + su -l %%PG_USER%% -c "vacuumdb -a -q -U %%PG_USER%% ${daily_pgsql_vacuum_args}" + if [ $? -gt 0 ] + then + echo + echo "Errors were reported during vacuum." + rc=3 + fi + ;; +esac + +exit $rc diff --git a/databases/postgresql91-server/files/pkg-install-server.in b/databases/postgresql91-server/files/pkg-install-server.in new file mode 100644 index 000000000000..efa9b14c2788 --- /dev/null +++ b/databases/postgresql91-server/files/pkg-install-server.in @@ -0,0 +1,66 @@ +#! /bin/sh + +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql91-server/files/Attic/pkg-install-server.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ + +PATH=/bin:/usr/bin:/usr/sbin +PG_USER=%%PG_USER%% +PG_GROUP=%%PG_GROUP%% +PG_UID=%%PG_UID%% + +backupwarning() { echo " + + =========== BACKUP YOUR DATA! ============= + As always, backup your data before + upgrading. If the upgrade leads to a higher + minor revision (e.g. 7.3.x -> 7.4), a dump + and restore of all databases is + required. This is *NOT* done by the port! + + Press ctrl-C *now* if you need to pg_dump. + =========================================== +" + sleep 5 +} + +case $2 in +PRE-INSTALL) + backupwarning + PGUSER=${PGUSER:-${PG_USER}} + PGGROUP=${PGGROUP:-${PG_GROUP}} + DB_DIR=${PKG_PREFIX}/${PGUSER} + UID=${PG_UID} + GID=${PG_UID} + + if pw group show "${PGGROUP}" 2>/dev/null; then + echo "You already have a group \"${PGGROUP}\", so I will use it." + else + if pw groupadd ${PGGROUP} -g ${GID}; then + echo "Added group \"${PGGROUP}\"." + else + echo "Adding group \"${PGGROUP}\" failed..." + exit 1 + fi + fi + + if pw user show "${PGUSER}" 2>/dev/null; then + echo "You already have a user \"${PGUSER}\", so I will use it." + else + if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ + -d ${DB_DIR} -c "PostgreSQL Daemon" + then + echo "Added user \"${PGUSER}\"." + else + echo "Adding user \"${PGUSER}\" failed..." + exit 1 + fi + fi + + if ! [ -x ~${PGUSER} ] ; then + install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} + fi + ;; + +BACKUPWARNING) + backupwarning + ;; +esac diff --git a/databases/postgresql91-server/files/pkg-message-client.in b/databases/postgresql91-server/files/pkg-message-client.in index 3183bc136aa6..ff486a635645 100644 --- a/databases/postgresql91-server/files/pkg-message-client.in +++ b/databases/postgresql91-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql91-server/files/postgresql.in b/databases/postgresql91-server/files/postgresql.in index 405d2efaa4d3..d1e3c763f8da 100644 --- a/databases/postgresql91-server/files/postgresql.in +++ b/databases/postgresql91-server/files/postgresql.in @@ -32,7 +32,7 @@ load_rc_config postgresql # set defaults postgresql_enable=${postgresql_enable:-"NO"} postgresql_flags=${postgresql_flags:-"-w -s -m fast"} -postgresql_user=pgsql +postgresql_user=${postgresql_user:-"%%PG_USER%%"} eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"} postgresql_class=${postgresql_class:-"default"} postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc-collate=C"} diff --git a/databases/postgresql91-server/pkg-install-server b/databases/postgresql91-server/pkg-install-server deleted file mode 100644 index 6dc3b6fdbd67..000000000000 --- a/databases/postgresql91-server/pkg-install-server +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh - -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -backupwarning() { echo " - - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. If the upgrade leads to a higher - minor revision (e.g. 7.3.x -> 7.4), a dump - and restore of all databases is - required. This is *NOT* done by the port! - - Press ctrl-C *now* if you need to pg_dump. - =========================================== -" - sleep 5 -} - -case $2 in -PRE-INSTALL) - backupwarning - PGUSER=${PGUSER:-pgsql} - PGGROUP=${PGGROUP:-pgsql} - DB_DIR=${PKG_PREFIX}/${PGUSER} - UID=70 - GID=70 - - if pw group show "${PGGROUP}" 2>/dev/null; then - echo "You already have a group \"${PGGROUP}\", so I will use it." - else - if pw groupadd ${PGGROUP} -g ${GID}; then - echo "Added group \"${PGGROUP}\"." - else - echo "Adding group \"${PGGROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${PGUSER}" 2>/dev/null; then - echo "You already have a user \"${PGUSER}\", so I will use it." - else - if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ - -d ${DB_DIR} -c "PostgreSQL Daemon" - then - echo "Added user \"${PGUSER}\"." - else - echo "Adding user \"${PGUSER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~${PGUSER} ] ; then - install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} - fi - ;; - -BACKUPWARNING) - backupwarning - ;; -esac diff --git a/databases/postgresql91-server/pkg-plist-server b/databases/postgresql91-server/pkg-plist-server index 457bffe0ccbc..ffd6dfc752d2 100644 --- a/databases/postgresql91-server/pkg-plist-server +++ b/databases/postgresql91-server/pkg-plist-server @@ -276,6 +276,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Mendoza %%TZDATA%%share/postgresql/timezone/America/Menominee %%TZDATA%%share/postgresql/timezone/America/Merida +%%TZDATA%%share/postgresql/timezone/America/Metlakatla %%TZDATA%%share/postgresql/timezone/America/Mexico_City %%TZDATA%%share/postgresql/timezone/America/Miquelon %%TZDATA%%share/postgresql/timezone/America/Moncton @@ -288,6 +289,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Nipigon %%TZDATA%%share/postgresql/timezone/America/Nome %%TZDATA%%share/postgresql/timezone/America/Noronha +%%TZDATA%%share/postgresql/timezone/America/North_Dakota/Beulah %%TZDATA%%share/postgresql/timezone/America/North_Dakota/Center %%TZDATA%%share/postgresql/timezone/America/North_Dakota/New_Salem %%TZDATA%%share/postgresql/timezone/America/Ojinaga @@ -314,6 +316,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Sao_Paulo %%TZDATA%%share/postgresql/timezone/America/Scoresbysund %%TZDATA%%share/postgresql/timezone/America/Shiprock +%%TZDATA%%share/postgresql/timezone/America/Sitka %%TZDATA%%share/postgresql/timezone/America/St_Barthelemy %%TZDATA%%share/postgresql/timezone/America/St_Johns %%TZDATA%%share/postgresql/timezone/America/St_Kitts @@ -758,4 +761,4 @@ share/postgresql/tsearch_data/thesaurus_sample.ths @dirrmtry etc/periodic/daily @dirrmtry etc/periodic @dirrmtry lib/postgresql -@dirrmtry pgsql +@dirrmtry %%PG_USER%% diff --git a/databases/postgresql92-server/Makefile b/databases/postgresql92-server/Makefile index 52fcd0eb0bc0..21b88acbf291 100644 --- a/databases/postgresql92-server/Makefile +++ b/databases/postgresql92-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= postgresql -DISTVERSION?= 9.0.3 +DISTVERSION?= 9.0.4 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_PGSQL} MASTER_SITE_SUBDIR= source/v${DISTVERSION} @@ -24,7 +24,6 @@ DIST_SUBDIR= postgresql UNIQUENAME?= ${PORTNAME}90 LATEST_LINK?= ${PKGNAMEPREFIX}${UNIQUENAME}${PKGNAMESUFFIX} -PKGINSTALL?= ${PKGDIR}/pkg-install${PKGNAMESUFFIX} USE_BZIP2= YES USE_GMAKE= YES GNU_CONFIGURE= YES @@ -33,8 +32,9 @@ GNU_CONFIGURE= YES .undef GNU_CONFIGURE .endif -PGUSER= pgsql -PGGROUP= pgsql +PG_USER?= pgsql +PG_GROUP?= pgsql +PG_UID?= 70 LDFLAGS+= -L${LOCALBASE}/lib INCLUDES+= -I${LOCALBASE}/include @@ -60,6 +60,7 @@ SERVER_ONLY= yes USE_RC_SUBR= postgresql USE_PGSQL= yes WANT_PGSQL_VER= ${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g} +SUB_FILES+= 502.pgsql .endif .if !defined(SLAVE_ONLY) @@ -93,7 +94,7 @@ OPTIONS+= OPTIMIZED_CFLAGS "Builds with compiler optimizations (-O3)" off OPTIONS+= XML "Build with XML data type (server)" on OPTIONS+= TZDATA "Use internal timezone database (server)" on OPTIONS+= DEBUG "Builds with debugging symbols" off -OPTIONS+= GSSAPI "BUild with GSSAPI support" on +OPTIONS+= GSSAPI "BUild with GSSAPI support" off # See http://people.freebsd.org/~girgen/postgresql-icu/README.html for more info OPTIONS+= ICU "Use ICU for unicode collation (server)" off @@ -283,7 +284,7 @@ MAN7= ABORT.7 ALTER_AGGREGATE.7 ALTER_CONVERSION.7 ALTER_DATABASE.7 \ .if defined(SERVER_ONLY) pre-everything:: - @${SH} ${PKGINSTALL} ${PORTNAME} BACKUPWARNING + @${SH} ${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in ${PORTNAME} BACKUPWARNING .endif .if !defined(NO_BUILD) @@ -305,11 +306,19 @@ do-build: SUB_FILES+= pkg-message${PKGNAMESUFFIX} PKGMESSAGE= ${WRKSRC}/pkg-message${PKGNAMESUFFIX} . endif +. if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in) +SUB_FILES+= pkg-install${PKGNAMESUFFIX} +SUB_LIST= PG_GROUP=$(PG_GROUP) \ + PG_USER=$(PG_USER) \ + PG_UID=$(PG_UID) +PLIST_SUB+= PG_USER=$(PG_USER) +PKGINSTALL= ${WRKDIR}/pkg-install${PKGNAMESUFFIX} +. endif .endif .if defined(SERVER_ONLY) pre-su-install: - @ ${SETENV} PKG_PREFIX=${PREFIX} PGUSER=${PGUSER} PGGROUP=${PGGROUP} \ + @ ${SETENV} PKG_PREFIX=${PREFIX} PG_USER=$(PG_USER) PG_GROUP=$(PG_GROUP) \ ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL .endif @@ -330,7 +339,7 @@ do-install: . if defined(SERVER_ONLY) @ ${MKDIR} ${PREFIX}/share/postgresql ;\ ${MKDIR} ${PREFIX}/etc/periodic/daily ;\ - ${INSTALL_SCRIPT} ${FILESDIR}/502.pgsql \ + ${INSTALL_SCRIPT} ${WRKDIR}/502.pgsql \ ${PREFIX}/etc/periodic/daily . endif # SERVER_ONLY . if defined(CLIENT_ONLY) diff --git a/databases/postgresql92-server/distinfo b/databases/postgresql92-server/distinfo index 82c15fd2e1b9..fab2290611db 100644 --- a/databases/postgresql92-server/distinfo +++ b/databases/postgresql92-server/distinfo @@ -1,4 +1,4 @@ -SHA256 (postgresql/postgresql-9.0.3.tar.bz2) = cf429421dea73a7bd5ef9fbdd1212a0d01c0f63c2059e0218a0e350891867b35 -SIZE (postgresql/postgresql-9.0.3.tar.bz2) = 14040705 +SHA256 (postgresql/postgresql-9.0.4.tar.bz2) = 30572706e3176228415991895e63a8b77343a5abad11407961cfd08790be9e84 +SIZE (postgresql/postgresql-9.0.4.tar.bz2) = 14040871 SHA256 (postgresql/pg-900-icu-2010-09-19.diff.gz) = 27cea46241ec814965c278330cd96f67ee03422b7758a210713a63b4b5bb77e9 SIZE (postgresql/pg-900-icu-2010-09-19.diff.gz) = 4349 diff --git a/databases/postgresql92-server/files/502.pgsql b/databases/postgresql92-server/files/502.pgsql deleted file mode 100644 index 281189a59c46..000000000000 --- a/databases/postgresql92-server/files/502.pgsql +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# Maintenance shell script to vacuum and backup database -# Put this in /usr/local/etc/periodic/daily, and it will be run -# every night -# -# Written by Palle Girgensohn -# -# In public domain, do what you like with it, -# and use it at your own risk... :) -# - -# Define these variables in either /etc/periodic.conf or -# /etc/periodic.conf.local to override the default values. -# -# daily_pgsql_backup_enable="YES" # do backup of all databases -# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases -# daily_pgsql_vacuum_enable="YES" # do vacuum - -daily_pgsql_vacuum_args="-z" -daily_pgsql_pgdump_args="-b -F c" -# backupdir is relative to ~pgsql home directory unless it begins with a slash: -daily_pgsql_backupdir="~pgsql/backups" -daily_pgsql_savedays="7" - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -# allow '~´ in dir name -eval backupdir=${daily_pgsql_backupdir} - -rc=0 - -pgsql_backup() { - # daily_pgsql_backupdir must be writeable by user pgsql - # ~pgsql is just that under normal circumstances, - # but this might not be where you want the backups... - if [ ! -d ${backupdir} ] ; then - echo Creating ${backupdir} - mkdir -m 700 ${backupdir}; chown pgsql ${backupdir} - fi - - echo - echo "PostgreSQL backups" - - # Protect the data - umask 077 - rc=$? - now=`date "+%Y-%m-%dT%H:%M:%S"` - file=${daily_pgsql_backupdir}/pgglobals_${now} - su -l pgsql -c "umask 077; pg_dumpall -g | gzip -9 > ${file}.gz" - - db=$1 - while shift; do - echo -n " $db" - file=${backupdir}/pgdump_${db}_${now} - su -l pgsql -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}" - [ $? -gt 0 ] && rc=3 - db=$1 - done - - if [ $rc -gt 0 ]; then - echo - echo "Errors were reported during backup." - fi - - # cleaning up old data - find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ - -a -mtime +${daily_pgsql_savedays} -delete - echo -} - -case "$daily_pgsql_backup_enable" in - [Yy][Ee][Ss]) - dbnames=`su -l pgsql -c "umask 077; psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` - pgsql_backup $dbnames - ;; - - [Nn][Oo]) - ;; - - "") - ;; - - *) - pgsql_backup $daily_pgsql_backup_enable - ;; -esac - -case "$daily_pgsql_vacuum_enable" in - [Yy][Ee][Ss]) - - echo - echo "PostgreSQL vacuum" - su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}" - if [ $? -gt 0 ] - then - echo - echo "Errors were reported during vacuum." - rc=3 - fi - ;; -esac - -exit $rc diff --git a/databases/postgresql92-server/files/502.pgsql.in b/databases/postgresql92-server/files/502.pgsql.in new file mode 100644 index 000000000000..c4be1e087eac --- /dev/null +++ b/databases/postgresql92-server/files/502.pgsql.in @@ -0,0 +1,112 @@ +%%PG_USER%%#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql92-server/files/502.pgsql.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ +# +# Maintenance shell script to vacuum and backup database +# Put this in /usr/local/etc/periodic/daily, and it will be run +# every night +# +# Written by Palle Girgensohn +# +# In public domain, do what you like with it, +# and use it at your own risk... :) +# + +# Define these variables in either /etc/periodic.conf or +# /etc/periodic.conf.local to override the default values. +# +# daily_pgsql_backup_enable="YES" # do backup of all databases +# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases +# daily_pgsql_vacuum_enable="YES" # do vacuum + +daily_pgsql_vacuum_args="-z" +daily_pgsql_pgdump_args="-b -F c" +# backupdir is relative to ~pgsql home directory unless it begins with a slash: +daily_pgsql_backupdir="~%%PG_USER%%/backups" +daily_pgsql_savedays="7" + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +# allow '~´ in dir name +eval backupdir=${daily_pgsql_backupdir} + +rc=0 + +pgsql_backup() { + # daily_pgsql_backupdir must be writeable by user %%PG_USER%% + # ~%%PG_USER%% is just that under normal circumstances, + # but this might not be where you want the backups... + if [ ! -d ${backupdir} ] ; then + echo Creating ${backupdir} + mkdir -m 700 ${backupdir}; chown %%PG_USER%% ${backupdir} + fi + + echo + echo "PostgreSQL backups" + + # Protect the data + umask 077 + rc=$? + now=`date "+%Y-%m-%dT%H:%M:%S"` + file=${daily_pgsql_backupdir}/pgglobals_${now} + su -l %%PG_USER%% -c "umask 077; pg_dumpall -g -U %%PG_USER%% | gzip -9 > ${file}.gz" + + db=$1 + while shift; do + echo -n " $db" + file=${backupdir}/pgdump_${db}_${now} + su -l %%PG_USER%% -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -U %%PG_USER%% -f ${file} ${db}" + [ $? -gt 0 ] && rc=3 + db=$1 + done + + if [ $rc -gt 0 ]; then + echo + echo "Errors were reported during backup." + fi + + # cleaning up old data + find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \ + -a -mtime +${daily_pgsql_savedays} -delete + echo +} + +case "$daily_pgsql_backup_enable" in + [Yy][Ee][Ss]) + dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"` + pgsql_backup $dbnames + ;; + + [Nn][Oo]) + ;; + + "") + ;; + + *) + pgsql_backup $daily_pgsql_backup_enable + ;; +esac + +case "$daily_pgsql_vacuum_enable" in + [Yy][Ee][Ss]) + + echo + echo "PostgreSQL vacuum" + su -l %%PG_USER%% -c "vacuumdb -a -q -U %%PG_USER%% ${daily_pgsql_vacuum_args}" + if [ $? -gt 0 ] + then + echo + echo "Errors were reported during vacuum." + rc=3 + fi + ;; +esac + +exit $rc diff --git a/databases/postgresql92-server/files/pkg-install-server.in b/databases/postgresql92-server/files/pkg-install-server.in new file mode 100644 index 000000000000..d85d62931474 --- /dev/null +++ b/databases/postgresql92-server/files/pkg-install-server.in @@ -0,0 +1,66 @@ +#! /bin/sh + +# $FreeBSD: /tmp/pcvs/ports/databases/postgresql92-server/files/Attic/pkg-install-server.in,v 1.1 2011-04-18 23:34:27 girgen Exp $ + +PATH=/bin:/usr/bin:/usr/sbin +PG_USER=%%PG_USER%% +PG_GROUP=%%PG_GROUP%% +PG_UID=%%PG_UID%% + +backupwarning() { echo " + + =========== BACKUP YOUR DATA! ============= + As always, backup your data before + upgrading. If the upgrade leads to a higher + minor revision (e.g. 7.3.x -> 7.4), a dump + and restore of all databases is + required. This is *NOT* done by the port! + + Press ctrl-C *now* if you need to pg_dump. + =========================================== +" + sleep 5 +} + +case $2 in +PRE-INSTALL) + backupwarning + PGUSER=${PGUSER:-${PG_USER}} + PGGROUP=${PGGROUP:-${PG_GROUP}} + DB_DIR=${PKG_PREFIX}/${PGUSER} + UID=${PG_UID} + GID=${PG_UID} + + if pw group show "${PGGROUP}" 2>/dev/null; then + echo "You already have a group \"${PGGROUP}\", so I will use it." + else + if pw groupadd ${PGGROUP} -g ${GID}; then + echo "Added group \"${PGGROUP}\"." + else + echo "Adding group \"${PGGROUP}\" failed..." + exit 1 + fi + fi + + if pw user show "${PGUSER}" 2>/dev/null; then + echo "You already have a user \"${PGUSER}\", so I will use it." + else + if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ + -d ${DB_DIR} -c "PostgreSQL Daemon" + then + echo "Added user \"${PGUSER}\"." + else + echo "Adding user \"${PGUSER}\" failed..." + exit 1 + fi + fi + + if ! [ -x ~${PGUSER} ] ; then + install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} + fi + ;; + +BACKUPWARNING) + backupwarning + ;; +esac diff --git a/databases/postgresql92-server/files/pkg-message-client.in b/databases/postgresql92-server/files/pkg-message-client.in index 3183bc136aa6..ff486a635645 100644 --- a/databases/postgresql92-server/files/pkg-message-client.in +++ b/databases/postgresql92-server/files/pkg-message-client.in @@ -1,6 +1,6 @@ The PostgreSQL port has a collection of "side orders": -postgresql-doc +postgresql-docs For all of the html documentation p5-Pg diff --git a/databases/postgresql92-server/files/postgresql.in b/databases/postgresql92-server/files/postgresql.in index 405d2efaa4d3..d1e3c763f8da 100644 --- a/databases/postgresql92-server/files/postgresql.in +++ b/databases/postgresql92-server/files/postgresql.in @@ -32,7 +32,7 @@ load_rc_config postgresql # set defaults postgresql_enable=${postgresql_enable:-"NO"} postgresql_flags=${postgresql_flags:-"-w -s -m fast"} -postgresql_user=pgsql +postgresql_user=${postgresql_user:-"%%PG_USER%%"} eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"} postgresql_class=${postgresql_class:-"default"} postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc-collate=C"} diff --git a/databases/postgresql92-server/pkg-install-server b/databases/postgresql92-server/pkg-install-server deleted file mode 100644 index 6dc3b6fdbd67..000000000000 --- a/databases/postgresql92-server/pkg-install-server +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh - -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -backupwarning() { echo " - - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. If the upgrade leads to a higher - minor revision (e.g. 7.3.x -> 7.4), a dump - and restore of all databases is - required. This is *NOT* done by the port! - - Press ctrl-C *now* if you need to pg_dump. - =========================================== -" - sleep 5 -} - -case $2 in -PRE-INSTALL) - backupwarning - PGUSER=${PGUSER:-pgsql} - PGGROUP=${PGGROUP:-pgsql} - DB_DIR=${PKG_PREFIX}/${PGUSER} - UID=70 - GID=70 - - if pw group show "${PGGROUP}" 2>/dev/null; then - echo "You already have a group \"${PGGROUP}\", so I will use it." - else - if pw groupadd ${PGGROUP} -g ${GID}; then - echo "Added group \"${PGGROUP}\"." - else - echo "Adding group \"${PGGROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${PGUSER}" 2>/dev/null; then - echo "You already have a user \"${PGUSER}\", so I will use it." - else - if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ - -d ${DB_DIR} -c "PostgreSQL Daemon" - then - echo "Added user \"${PGUSER}\"." - else - echo "Adding user \"${PGUSER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~${PGUSER} ] ; then - install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} - fi - ;; - -BACKUPWARNING) - backupwarning - ;; -esac diff --git a/databases/postgresql92-server/pkg-plist-server b/databases/postgresql92-server/pkg-plist-server index 457bffe0ccbc..ffd6dfc752d2 100644 --- a/databases/postgresql92-server/pkg-plist-server +++ b/databases/postgresql92-server/pkg-plist-server @@ -276,6 +276,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Mendoza %%TZDATA%%share/postgresql/timezone/America/Menominee %%TZDATA%%share/postgresql/timezone/America/Merida +%%TZDATA%%share/postgresql/timezone/America/Metlakatla %%TZDATA%%share/postgresql/timezone/America/Mexico_City %%TZDATA%%share/postgresql/timezone/America/Miquelon %%TZDATA%%share/postgresql/timezone/America/Moncton @@ -288,6 +289,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Nipigon %%TZDATA%%share/postgresql/timezone/America/Nome %%TZDATA%%share/postgresql/timezone/America/Noronha +%%TZDATA%%share/postgresql/timezone/America/North_Dakota/Beulah %%TZDATA%%share/postgresql/timezone/America/North_Dakota/Center %%TZDATA%%share/postgresql/timezone/America/North_Dakota/New_Salem %%TZDATA%%share/postgresql/timezone/America/Ojinaga @@ -314,6 +316,7 @@ share/postgresql/snowball_create.sql %%TZDATA%%share/postgresql/timezone/America/Sao_Paulo %%TZDATA%%share/postgresql/timezone/America/Scoresbysund %%TZDATA%%share/postgresql/timezone/America/Shiprock +%%TZDATA%%share/postgresql/timezone/America/Sitka %%TZDATA%%share/postgresql/timezone/America/St_Barthelemy %%TZDATA%%share/postgresql/timezone/America/St_Johns %%TZDATA%%share/postgresql/timezone/America/St_Kitts @@ -758,4 +761,4 @@ share/postgresql/tsearch_data/thesaurus_sample.ths @dirrmtry etc/periodic/daily @dirrmtry etc/periodic @dirrmtry lib/postgresql -@dirrmtry pgsql +@dirrmtry %%PG_USER%% -- cgit v1.2.3