From cff237a07b50dd237a11079360a240ce5dde2fb5 Mon Sep 17 00:00:00 2001 From: rafan Date: Mon, 16 Jul 2007 10:53:48 +0000 Subject: - Patch configure.in so it accepts --infodir option [1] - While I'm here, use USE_RC_SUBR facility for rc scripts - Other cosmetic changes Reported by: pointyhat exp run --- databases/pgcluster/Makefile | 18 +++------ databases/pgcluster/files/patch-configure.in | 26 +++++++++++++ databases/pgcluster/files/pgcluster.in | 56 +++++++++++++++++++++++++++ databases/pgcluster/files/pgcluster.sh.tmpl | 56 --------------------------- databases/pgcluster/files/pglb.in | 34 ++++++++++++++++ databases/pgcluster/files/pglb.sh.tmpl | 34 ---------------- databases/pgcluster/files/pgreplicate.in | 36 +++++++++++++++++ databases/pgcluster/files/pgreplicate.sh.tmpl | 36 ----------------- databases/pgcluster/pkg-plist | 3 -- 9 files changed, 158 insertions(+), 141 deletions(-) create mode 100644 databases/pgcluster/files/patch-configure.in create mode 100644 databases/pgcluster/files/pgcluster.in delete mode 100644 databases/pgcluster/files/pgcluster.sh.tmpl create mode 100644 databases/pgcluster/files/pglb.in delete mode 100644 databases/pgcluster/files/pglb.sh.tmpl create mode 100644 databases/pgcluster/files/pgreplicate.in delete mode 100644 databases/pgcluster/files/pgreplicate.sh.tmpl (limited to 'databases') diff --git a/databases/pgcluster/Makefile b/databases/pgcluster/Makefile index 4585c5d51e18..94356400ee38 100644 --- a/databases/pgcluster/Makefile +++ b/databases/pgcluster/Makefile @@ -18,7 +18,7 @@ PATCHFILES= pgcluster-${PORTVERSION}-patch.bz2 PATCH_DIST_STRIP= -p0 MAINTAINER= ports@FreeBSD.org -COMMENT=The multi-master and synchronous replication system for PostgreSQL +COMMENT= The multi-master and synchronous replication system for PostgreSQL RUN_DEPENDS= rsync:${PORTSDIR}/net/rsync @@ -29,7 +29,7 @@ USE_AUTOTOOLS= autoconf:259 MAKE_FLAGS= # empty MAKEFILE= # empty CONFLICTS= postgresql-* -USE_RC_SUBR= yes +USE_RC_SUBR= pgcluster USE_LDCONFIG= yes .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-debug @@ -41,13 +41,15 @@ INSTALL_TARGET= install-strip BASEPGSQL= 7.3.6 .if defined(WITHOUT_PGCLUSTER_REPLICATION) PGRP= "@comment " +.else +USE_RC_SUBR+= pgreplicate .endif .if defined(WITHOUT_PGCLUSTER_LOADBALANCER) PGLB= "@comment " +.else +USE_RC_SUBR+= pglb .endif PLIST_SUB= PGRP=${PGRP} PGLB=${PGLB} -RCSUBR_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} -RCSUBR_SED= ${SED} ${RCSUBR_SUB:S|$|!g|:S|^| -e s!%%|:S|=|%%!|} MAN1= clusterdb.1 createdb.1 createlang.1 createuser.1 dropdb.1 droplang.1 \ dropuser.1 ecpg.1 initdb.1 initlocation.1 ipcclean.1 \ @@ -97,17 +99,9 @@ pre-install: post-install: .if !defined(WITHOUT_PGCLUSTER_REPLICATION) ${MAKE} WRKSRC=${WRKSRC}/src/pgcluster/pgrp do-install - ${RCSUBR_SED} ${FILESDIR}/pgreplicate.sh.tmpl > \ - ${PREFIX}/etc/rc.d/pgreplicate.sh - ${CHMOD} +x ${PREFIX}/etc/rc.d/pgreplicate.sh .endif .if !defined(WITHOUT_PGCLUSTER_LOADBALANCER) ${MAKE} WRKSRC=${WRKSRC}/src/pgcluster/pglb do-install - ${RCSUBR_SED} ${FILESDIR}/pglb.sh.tmpl > ${PREFIX}/etc/rc.d/pglb.sh - ${CHMOD} +x ${PREFIX}/etc/rc.d/pglb.sh .endif - ${RCSUBR_SED} ${FILESDIR}/pgcluster.sh.tmpl > \ - ${PREFIX}/etc/rc.d/pgcluster.sh - ${CHMOD} +x ${PREFIX}/etc/rc.d/pgcluster.sh .include diff --git a/databases/pgcluster/files/patch-configure.in b/databases/pgcluster/files/patch-configure.in new file mode 100644 index 000000000000..ad55a81b3cd7 --- /dev/null +++ b/databases/pgcluster/files/patch-configure.in @@ -0,0 +1,26 @@ +--- configure.in.orig Tue Mar 2 08:44:53 2004 ++++ configure.in Mon Jul 16 16:20:48 2007 +@@ -19,11 +19,7 @@ + dnl + dnl The GNU folks apparently haven't heard that some people don't use + dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir". +-m4_define([info], [doc]) +-m4_define([infodir], [docdir]) + AC_INIT([PostgreSQL], [7.3.6], [pgsql-bugs@postgresql.org]) +-m4_undefine([infodir]) +-m4_undefine([info]) + AC_SUBST(docdir) + + AC_PREREQ(2.53) +@@ -506,6 +502,11 @@ + ]) + + AC_SUBST(with_openssl) ++ ++# ++# Replication ++# ++AC_DEFINE([USE_REPLICATION], 1, [Define to build with Replication support]) + + + # diff --git a/databases/pgcluster/files/pgcluster.in b/databases/pgcluster/files/pgcluster.in new file mode 100644 index 000000000000..aec8d3e4a80b --- /dev/null +++ b/databases/pgcluster/files/pgcluster.in @@ -0,0 +1,56 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/pgcluster/files/Attic/pgcluster.in,v 1.1 2007-07-16 10:53:48 rafan Exp $ +# +# PROVIDE: pgcluster +# REQUIRE: DAEMON +# BEFORE: pgreplicate +# +# Add the following line to /etc/rc.conf to enable pgcluster: +# +# pgcluster_enable="YES" +# # optional +# pgcluster_data="/home/pgsql/data" +# pgcluster_flags="-w -s" +# + +pgcluster_enable=${pgcluster_enable-"NO"} +pgcluster_data=${pgcluster_data-"%%PREFIX%%/pgsql/data"} +pgcluster_flags=${pgcluster_flags-"-w -s"} + +. %%RC_SUBR%% + +load_rc_config pgcluster + +name=pgcluster +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/pg_ctl +pgcluster_user=pgsql +extra_commands="initdb recover" +initdb_cmd="pgcluster_initdb" +recover_cmd="pgcluster_recover" +start_cmd="pgcluster_start" +stop_cmd="pgcluster_stop" + +pgcluster_flags="${pgcluster_flags} -D ${pgcluster_data}" +pidfile="${pgcluster_data}/postmaster.pid" + +pgcluster_start() +{ + su -m ${pgcluster_user} -c "exec ${command} start ${pgcluster_flags} -o '-i'" +} +pgcluster_stop() +{ + su -m ${pgcluster_user} -c "exec ${command} stop ${pgcluster_flags} -m i" +} +pgcluster_recover() +{ + su -m ${pgcluster_user} -c "exec ${command} start ${pgcluster_flags} -o '-i -R'" +} +pgcluster_initdb() +{ + su -m ${pgcluster_user} -c "exec %%PREFIX%%/bin/initdb -D ${pgcluster_data}" +} + +load_rc_config $name +run_rc_command "$1" diff --git a/databases/pgcluster/files/pgcluster.sh.tmpl b/databases/pgcluster/files/pgcluster.sh.tmpl deleted file mode 100644 index 1a4ec30ec616..000000000000 --- a/databases/pgcluster/files/pgcluster.sh.tmpl +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: pgcluster -# REQUIRE: DAEMON -# BEFORE: pgreplicate -# -# Add the following line to /etc/rc.conf to enable pgcluster: -# -# pgcluster_enable="YES" -# # optional -# pgcluster_data="/home/pgsql/data" -# pgcluster_flags="-w -s" -# - -pgcluster_enable=${pgcluster_enable-"NO"} -pgcluster_data=${pgcluster_data-"%%PREFIX%%/pgsql/data"} -pgcluster_flags=${pgcluster_flags-"-w -s"} - -. %%RC_SUBR%% - -load_rc_config pgcluster - -name=pgcluster -rcvar=`set_rcvar` -command=%%PREFIX%%/bin/pg_ctl -pgcluster_user=pgsql -extra_commands="initdb recover" -initdb_cmd="pgcluster_initdb" -recover_cmd="pgcluster_recover" -start_cmd="pgcluster_start" -stop_cmd="pgcluster_stop" - -pgcluster_flags="${pgcluster_flags} -D ${pgcluster_data}" -pidfile="${pgcluster_data}/postmaster.pid" - -pgcluster_start() -{ - su -m ${pgcluster_user} -c "exec ${command} start ${pgcluster_flags} -o '-i'" -} -pgcluster_stop() -{ - su -m ${pgcluster_user} -c "exec ${command} stop ${pgcluster_flags} -m i" -} -pgcluster_recover() -{ - su -m ${pgcluster_user} -c "exec ${command} start ${pgcluster_flags} -o '-i -R'" -} -pgcluster_initdb() -{ - su -m ${pgcluster_user} -c "exec %%PREFIX%%/bin/initdb -D ${pgcluster_data}" -} - -load_rc_config $name -run_rc_command "$1" diff --git a/databases/pgcluster/files/pglb.in b/databases/pgcluster/files/pglb.in new file mode 100644 index 000000000000..934b3a928352 --- /dev/null +++ b/databases/pgcluster/files/pglb.in @@ -0,0 +1,34 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/pgcluster/files/Attic/pglb.in,v 1.1 2007-07-16 10:53:48 rafan Exp $ +# +# PROVIDE: pglb +# REQUIRE: DAEMON +# +# Add the following line to /etc/rc.conf to enable pglb: +# +# pglb_enable="YES" +# + +pglb_enable=${pglb_enable-"NO"} +pglb_data=${pglb_data-"%%PREFIX%%/pgsql/data"} + +. %%RC_SUBR%% + +load_rc_config pglb + +name=pglb +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/pglb +pglb_user=pgsql +stop_cmd="pglb_stop" + +pglb_flags="${pglb_flags} -D ${pglb_data}" + +pglb_stop() +{ + su -m ${pglb_user} -c "exec ${command} -D ${pglb_data} stop" +} + +load_rc_config $name +run_rc_command "$1" diff --git a/databases/pgcluster/files/pglb.sh.tmpl b/databases/pgcluster/files/pglb.sh.tmpl deleted file mode 100644 index 4e5af93ab3ba..000000000000 --- a/databases/pgcluster/files/pglb.sh.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: pglb -# REQUIRE: DAEMON -# -# Add the following line to /etc/rc.conf to enable pglb: -# -# pglb_enable="YES" -# - -pglb_enable=${pglb_enable-"NO"} -pglb_data=${pglb_data-"%%PREFIX%%/pgsql/data"} - -. %%RC_SUBR%% - -load_rc_config pglb - -name=pglb -rcvar=`set_rcvar` -command=%%PREFIX%%/bin/pglb -pglb_user=pgsql -stop_cmd="pglb_stop" - -pglb_flags="${pglb_flags} -D ${pglb_data}" - -pglb_stop() -{ - su -m ${pglb_user} -c "exec ${command} -D ${pglb_data} stop" -} - -load_rc_config $name -run_rc_command "$1" diff --git a/databases/pgcluster/files/pgreplicate.in b/databases/pgcluster/files/pgreplicate.in new file mode 100644 index 000000000000..0ee716fdd1b5 --- /dev/null +++ b/databases/pgcluster/files/pgreplicate.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/databases/pgcluster/files/Attic/pgreplicate.in,v 1.1 2007-07-16 10:53:48 rafan Exp $ +# +# PROVIDE: pgreplicate +# REQUIRE: DAEMON +# BEFORE: pglb +# +# Add the following line to /etc/rc.conf to enable pgreplicate: +# +# pgreplicate_enable="YES" +# + +pgreplicate_enable=${pgreplicate_enable-"NO"} +pgreplicate_data=${pgreplicate_data-"%%PREFIX%%/pgsql/data"} + +. %%RC_SUBR%% + +load_rc_config pgreplicate + +name=pgreplicate +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/pgreplicate +pgreplicate_user=pgsql +stop_cmd="pgreplicate_stop" + +pgreplicate_flags="${pgreplicate_flags} -D ${pgreplicate_data}" +pidfile="${pgreplicate_data}/pgreplicate.pid" + +pgreplicate_stop() +{ + su -m ${pgreplicate_user} -c "exec ${command} -D ${pgreplicate_data} stop" +} + +load_rc_config $name +run_rc_command "$1" diff --git a/databases/pgcluster/files/pgreplicate.sh.tmpl b/databases/pgcluster/files/pgreplicate.sh.tmpl deleted file mode 100644 index bf58256c28de..000000000000 --- a/databases/pgcluster/files/pgreplicate.sh.tmpl +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: pgreplicate -# REQUIRE: DAEMON -# BEFORE: pglb -# -# Add the following line to /etc/rc.conf to enable pgreplicate: -# -# pgreplicate_enable="YES" -# - -pgreplicate_enable=${pgreplicate_enable-"NO"} -pgreplicate_data=${pgreplicate_data-"%%PREFIX%%/pgsql/data"} - -. %%RC_SUBR%% - -load_rc_config pgreplicate - -name=pgreplicate -rcvar=`set_rcvar` -command=%%PREFIX%%/bin/pgreplicate -pgreplicate_user=pgsql -stop_cmd="pgreplicate_stop" - -pgreplicate_flags="${pgreplicate_flags} -D ${pgreplicate_data}" -pidfile="${pgreplicate_data}/pgreplicate.pid" - -pgreplicate_stop() -{ - su -m ${pgreplicate_user} -c "exec ${command} -D ${pgreplicate_data} stop" -} - -load_rc_config $name -run_rc_command "$1" diff --git a/databases/pgcluster/pkg-plist b/databases/pgcluster/pkg-plist index f4e10f6c120c..23dcaad9ab88 100644 --- a/databases/pgcluster/pkg-plist +++ b/databases/pgcluster/pkg-plist @@ -26,9 +26,6 @@ bin/psql bin/vacuumdb %%PGLB%%etc/pglb.conf.sample %%PGRP%%etc/pgreplicate.conf.sample -etc/rc.d/pgcluster.sh -%%PGLB%%etc/rc.d/pglb.sh -%%PGRP%%etc/rc.d/pgreplicate.sh include/ecpgerrno.h include/ecpglib.h include/ecpgtype.h -- cgit