aboutsummaryrefslogtreecommitdiff
path: root/databases/slony1
diff options
context:
space:
mode:
authorSam Lawrance <lawrance@FreeBSD.org>2005-06-24 11:22:43 +0000
committerSam Lawrance <lawrance@FreeBSD.org>2005-06-24 11:22:43 +0000
commitbe10df55cfde6f9964a45cb997df593f8c861a83 (patch)
tree29d8eb22b037b2141acc0263cfc0402d67b764c2 /databases/slony1
parentcc2c701842301c401c502229e0d151fa99d40061 (diff)
downloadports-be10df55cfde6f9964a45cb997df593f8c861a83.tar.gz
ports-be10df55cfde6f9964a45cb997df593f8c861a83.zip
Notes
Diffstat (limited to 'databases/slony1')
-rw-r--r--databases/slony1/Makefile74
-rw-r--r--databases/slony1/distinfo4
-rw-r--r--databases/slony1/files/extra-GNUmakefile.in11
-rw-r--r--databases/slony1/files/patch-builddocs14
-rw-r--r--databases/slony1/files/patch-cleanupthread17
-rw-r--r--databases/slony1/files/pkg-message.in26
-rw-r--r--databases/slony1/files/slon-mkservice.sh.in38
-rw-r--r--databases/slony1/files/slon.conf-sample16
-rw-r--r--databases/slony1/files/slon.sh.in30
-rw-r--r--databases/slony1/pkg-descr2
-rw-r--r--databases/slony1/pkg-message8
11 files changed, 144 insertions, 96 deletions
diff --git a/databases/slony1/Makefile b/databases/slony1/Makefile
index 85f210207892..b5514ac2b046 100644
--- a/databases/slony1/Makefile
+++ b/databases/slony1/Makefile
@@ -6,73 +6,61 @@
#
PORTNAME= slony1
-PORTVERSION= 1.0.5
-PORTREVISION= 2
+PORTVERSION= 1.1.0
CATEGORIES= databases
MASTER_SITES= http://developer.postgresql.org/~wieck/slony1/download/
MAINTAINER= vivek@khera.org
-COMMENT= PostgreSQL master to multiple slaves replication system
+COMMENT= PostgreSQL master to multiple replicas replication system
PGSQL_PORT= ${PORTSDIR}/databases/postgresql${PGSQL_VER}-server
-BUILD_DEPENDS= ${NONEXISTENT}:${PGSQL_PORT}:configure
-.if ! defined(NOPORTDOCS)
-BUILD_DEPENDS+= ${LOCALBASE}/bin/pnmtops:${PORTSDIR}/graphics/netpbm \
- ${LOCALBASE}/bin/djpeg:${PORTSDIR}/graphics/jpeg \
- ${LOCALBASE}/bin/ps2pdf:${PORTSDIR}/print/ghostscript-gnu
-.else
-EXTRA_PATCHES= ${FILESDIR}/extra-GNUmakefile.in
-.endif
RUN_DEPENDS= ${LOCALBASE}/bin/postmaster:${PGSQL_PORT}
GNU_CONFIGURE= yes
-USE_BISON= yes
-USE_GETTEXT= yes
USE_GMAKE= yes
-PGSQL_SRC= `cd ${PGSQL_PORT}; make -V WRKSRC`
-CONFIGURE_ARGS= --with-pgsourcetree=${PGSQL_SRC}
+USE_BZIP2= yes
+USE_RC_SUBR= slon.sh
-PLIST_FILES= bin/slon bin/slonik bin/slony_setup.pl \
- lib/postgresql/slony1_funcs.so lib/postgresql/xxid.so \
- share/postgresql/slony1_base.sql \
- share/postgresql/slony1_funcs.sql \
- share/postgresql/slony1_base.v73.sql \
- share/postgresql/slony1_base.v74.sql \
- share/postgresql/slony1_funcs.v73.sql \
- share/postgresql/slony1_funcs.v74.sql \
- share/postgresql/xxid.v73.sql \
- share/postgresql/xxid.v74.sql
-PORTDOCS= *.pdf howto COPYRIGHT README slonik_commands.html
+SUB_FILES= pkg-message slon-mkservice.sh
+SUB_LIST+= NAME=slon
-DEFAULT_PGSQL_VER?=74
+OPTIONS= PERLTOOLS "Install perl configuration tools" Off
.include <bsd.port.pre.mk>
+
+.if defined(WITH_PERLTOOLS)
+USE_PERL5_RUN= yes
+CONFIGURE_ARGS+= --with-perltools=${LOCALBASE}/sbin
+PLIST_SUB+= PERLTOOLS=""
+SUB_LIST+= PERLTOOLS=""
+.else
+PLIST_SUB+= PERLTOOLS="@comment "
+SUB_LIST+= PERLTOOLS="@comment "
+.endif
+
+DEFAULT_PGSQL_VER?=80
+
# Setting/finding PostgreSQL version we want.
.if exists(${LOCALBASE}/bin/postmaster)
PGSQL_VER!= ${LOCALBASE}/bin/postmaster -V | \
- ${SED} -n 's/postmaster.*PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
+ ${SED} -En 's/postmaster.*PostgreSQL[^0-9]*([0-9]+)\.([0-9]+)\..*/\1\2/p'
.elif exists(${LOCALBASE}/bin/pg_config)
-PGSQL_VER!= ${LOCALBASE}/bin/pg_config --version | ${SED} -n 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
+PGSQL_VER!= ${LOCALBASE}/bin/pg_config --version | \
+ ${SED} -En 's/PostgreSQL[^0-9]*([0-9]*)\.([0-9]+)\..*/\1\2/p'
.else
PGSQL_VER= ${DEFAULT_PGSQL_VER}
.endif
-pre-configure:
- cd ${PGSQL_SRC}/src/interfaces/libpq && ${GMAKE} all
- cd ${PGSQL_SRC}/src/port && ${GMAKE} all
-
-do-install:
- cd ${WRKSRC} && ${GMAKE} install
- ${INSTALL_SCRIPT} ${WRKSRC}/tools/slony_setup.pl ${PREFIX}/bin
+post-install:
.if ! defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT ${WRKSRC}/README ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/doc/concept/Slony-I-concept.pdf ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/doc/implementation/Slony-I-implementation.pdf ${DOCSDIR}
- ${MKDIR} ${DOCSDIR}/howto
- ${INSTALL_DATA} ${WRKSRC}/doc/howto/*.txt ${DOCSDIR}/howto
- ${INSTALL_DATA} ${WRKSRC}/doc/howto/slonik_commands.html ${DOCSDIR}
+ ${MKDIR} ${DOCSDIR}/adminguide
+ ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT ${WRKSRC}/INSTALL ${WRKSRC}/SAMPLE ${WRKSRC}/README ${WRKSRC}/UPGRADING ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/*/*.pdf ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/adminguide/prebuilt/*.html ${DOCSDIR}/adminguide/
.endif
- ${CAT} ${PKGMESSAGE}
+ @${INSTALL_SCRIPT} ${WRKDIR}/slon-mkservice.sh ${PREFIX}/sbin/slon-mkservice
+ @${INSTALL_DATA} ${FILESDIR}/slon.conf-sample ${PREFIX}/etc/
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/databases/slony1/distinfo b/databases/slony1/distinfo
index 1ab317ecdaf8..7148d3bffb59 100644
--- a/databases/slony1/distinfo
+++ b/databases/slony1/distinfo
@@ -1,2 +1,2 @@
-MD5 (slony1-1.0.5.tar.gz) = 66fcc0f53028101e4e0f969e5f47fe43
-SIZE (slony1-1.0.5.tar.gz) = 374903
+MD5 (slony1-1.1.0.tar.bz2) = a2d738840dc2ce5fc3f7fa27c5a434dc
+SIZE (slony1-1.1.0.tar.bz2) = 1183776
diff --git a/databases/slony1/files/extra-GNUmakefile.in b/databases/slony1/files/extra-GNUmakefile.in
deleted file mode 100644
index 304d79893b6a..000000000000
--- a/databases/slony1/files/extra-GNUmakefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- GNUmakefile.in.orig Thu Jun 10 11:09:18 2004
-+++ GNUmakefile.in Mon Jun 28 02:16:04 2004
-@@ -25,7 +25,7 @@
- $(wildcard makefiles/*)
-
-
--SUBDIRS = src doc
-+SUBDIRS = src
-
- all:
- for subdir in $(SUBDIRS) ; do \
diff --git a/databases/slony1/files/patch-builddocs b/databases/slony1/files/patch-builddocs
deleted file mode 100644
index 3dfeb8ecc058..000000000000
--- a/databases/slony1/files/patch-builddocs
+++ /dev/null
@@ -1,14 +0,0 @@
---- doc/Makefile.orig Thu Mar 18 20:32:21 2004
-+++ doc/Makefile Wed Jun 23 17:30:53 2004
-@@ -15,9 +15,9 @@
-
- DISTFILES = Makefile
-
--all install installdirs:
-+install installdirs:
-
--clean distclean maintainer-clean:
-+all clean distclean maintainer-clean:
- for subdir in $(SUBDIRS) ; do \
- $(MAKE) -C $$subdir $@ ; \
- done
diff --git a/databases/slony1/files/patch-cleanupthread b/databases/slony1/files/patch-cleanupthread
deleted file mode 100644
index 59569507efba..000000000000
--- a/databases/slony1/files/patch-cleanupthread
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: src/slon/cleanup_thread.c
-===================================================================
-RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/cleanup_thread.c,v
-retrieving revision 1.13.2.4
-retrieving revision 1.13.2.5
-diff -u -r1.13.2.4 -r1.13.2.5
---- cleanup_thread.c 30 Sep 2004 17:45:06 -0000 1.13.2.4
-+++ cleanup_thread.c 12 Jan 2005 03:15:36 -0000 1.13.2.5
-@@ -145,7 +145,7 @@
- "delete from %s.sl_log_1 "
- "where log_origin = '%s' "
- "and log_xid < '%s'; "
-- "delete from %s.sl_log_1 "
-+ "delete from %s.sl_log_2 "
- "where log_origin = '%s' "
- "and log_xid < '%s'; "
- "delete from %s.sl_seqlog "
diff --git a/databases/slony1/files/pkg-message.in b/databases/slony1/files/pkg-message.in
new file mode 100644
index 000000000000..d63faf0d7d1b
--- /dev/null
+++ b/databases/slony1/files/pkg-message.in
@@ -0,0 +1,26 @@
+**********************************************************************
+
+
+Please read the docs on configuring and runing slony-1. Unless you specified
+NOPORTDOCS, they are in the %%LOCALBASE%%/share/doc/slony1 directory.
+
+If you are upgrading from a prior version of slony, please read the UPGRADING
+file in the above docs directory.
+
+The script %%LOCALBASE%%/sbin/slon-mkservice can be used to create a control
+directory to run and monitor the slon daemon under svscan from daemontools.
+If you use this, be sure not to set slon_enable="YES" in /etc/rc.conf.
+
+If you prefer to use the standard startup script in %%LOCALBASE%%/etc/rc.d then
+set slon_enable="YES" in /etc/rc.conf to enable the slon.sh script.
+
+To use either of the above startup configurations, you will need to set up a
+%%LOCALBASE%%/etc/slon.conf file to tell slon what to replicate. This file
+is documented in %%LOCALBASE%%/share/doc/slony1/adminguide/runtime-config.html
+
+%%PERLTOOLS%%To use the perl slony configuration and monitoring tools, you must
+%%PERLTOOLS%%create %%LOCALBASE%%/etc/slon_tools.conf based on the sample file.
+
+
+
+**********************************************************************
diff --git a/databases/slony1/files/slon-mkservice.sh.in b/databases/slony1/files/slon-mkservice.sh.in
new file mode 100644
index 000000000000..d87710e8372d
--- /dev/null
+++ b/databases/slony1/files/slon-mkservice.sh.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# create a slon service directory for use with svscan from deamontools
+
+echo -n 'specify directory for "slon" service like "/var/slon-master": '
+read DIR
+if [ -z "$DIR" ]; then
+ echo "Directory must be non-empty"
+ exit 1;
+fi
+
+echo -n 'System user name for programs to run under (default pgsql): '
+read sysuser
+if [ -z "$sysuser" ]; then
+ echo "User name pgsql being used."
+ sysuser='pgsql'
+fi
+
+mkdir -p ${DIR}/env ${DIR}/supervise || exit 1
+mkdir -p ${DIR}/log/main ${DIR}/log/supervise || exit 1
+
+cat > ${DIR}/run <<EOF
+#!/bin/sh
+exec 2>&1
+
+exec envdir ./env sh -c 'exec envuidgid ${sysuser} slon -f \${CONFIGFILE}'
+EOF
+chmod +x ${DIR}/run
+
+cat >${DIR}/log/run <<EOF
+#!/bin/sh
+exec setuidgid ${sysuser} multilog t ./main
+EOF
+chmod +x ${DIR}/log/run
+
+echo "%%PREFIX%%/etc/slon.conf" > ${DIR}/env/CONFIGFILE
+
+chown -R ${sysuser} ${DIR}
diff --git a/databases/slony1/files/slon.conf-sample b/databases/slony1/files/slon.conf-sample
new file mode 100644
index 000000000000..96e94209ca01
--- /dev/null
+++ b/databases/slony1/files/slon.conf-sample
@@ -0,0 +1,16 @@
+# sample config file. see share/doc/slony1/runtime-config.html
+# values are overridden by command line options.
+# not all settings are shown here.
+
+syslog 0
+log_level 4
+log_timestamp 1
+
+cluster_name sample
+conn_info 'dbname=pgbench user=postgres host=localhost port=5432'
+
+#sync_interval 100
+#sync_interval_timeout 1000
+#sync_group_maxsize 6
+#vac_frequency 3
+#desired_sync_time 60000
diff --git a/databases/slony1/files/slon.sh.in b/databases/slony1/files/slon.sh.in
new file mode 100644
index 000000000000..7a235158c751
--- /dev/null
+++ b/databases/slony1/files/slon.sh.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: %%NAME%%
+# REQUIRE: postgresql
+# KEYWORD: FreeBSD shutdown
+
+# Add the following line to /etc/rc.conf to enable `%%NAME%%':
+#
+#%%NAME%%_enable="YES"
+#
+# and be sure to configure %%PREFIX%%/etc/%%NAME%%.conf
+
+. "%%RC_SUBR%%"
+
+name="%%NAME%%"
+rcvar=`set_rcvar`
+
+pidfile="/var/run/$name.pid"
+command="%%PREFIX%%/bin/slon"
+command_args="-f %%PREFIX%%/etc/$name.conf -p $pidfile"
+required_files="%%PREFIX%%/etc/$name.conf"
+
+# read configuration and set defaults
+load_rc_config "$name"
+: ${%%NAME%%_enable="NO"}
+
+run_rc_command "$1"
diff --git a/databases/slony1/pkg-descr b/databases/slony1/pkg-descr
index 02da2ac276d6..4e1d418b5959 100644
--- a/databases/slony1/pkg-descr
+++ b/databases/slony1/pkg-descr
@@ -10,4 +10,4 @@ Slony-I is developed as a system for data centers and backup
sites, where the normal mode of operation is that all nodes
are available.
-WWW: http://www.slony.org/
+WWW: http://www.slony.info/
diff --git a/databases/slony1/pkg-message b/databases/slony1/pkg-message
deleted file mode 100644
index 423352b91c7b..000000000000
--- a/databases/slony1/pkg-message
+++ /dev/null
@@ -1,8 +0,0 @@
-For running slony1 you need:
- slony postgresql superuser with password set
- slony system user (makes auth. of slony db user easier)
- TCP/IP enabled in postgresql (for replication of non local db)
-
-There is a perl script slony_setup.pl which helps you to create initial
-configuration. Installing this package do not makes any needed system
-changes.