Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jul 2011 13:35:17 +0200
From:      =?iso-8859-1?Q?Eirik_=D8verby?= <ltning@anduin.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/158606: New port: databases/rubygem-rubyrep
Message-ID:  <CD988D92-639C-4B83-A187-3C994E2CC6B1@anduin.net>
Resent-Message-ID: <201107031210.p63CAD8V074074@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         158606
>Category:       ports
>Synopsis:       New port: databases/rubygem-rubyrep Multi-master =
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 03 12:10:13 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Eirik Oeverby
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
=20
>Environment:
System: FreeBSD build02.osl2.modirum.com 8.2-RELEASE FreeBSD 8.2-RELEASE =
#0: Thu Feb 17 02:41:51 UTC 2011 =
root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
        Multi-master replication and sync for MySQL and PostgreSQL

>How-To-Repeat:

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	rubygem-rubyrep
#	rubygem-rubyrep/Makefile
#	rubygem-rubyrep/distinfo
#	rubygem-rubyrep/files
#	rubygem-rubyrep/files/rubyrep.in
#	rubygem-rubyrep/pkg-descr
#
echo c - rubygem-rubyrep
mkdir -p rubygem-rubyrep > /dev/null 2>&1
echo x - rubygem-rubyrep/Makefile
sed 's/^X//' >rubygem-rubyrep/Makefile << =
'46ecf18c564e445d214043f5bead61e7'
X# New ports collection makefile for: pg
X# Date created: 28 Jan 2009
X# Whom: Wen Heping <wenheping@gmail.com>
X#
X# $FreeBSD: ports/databases/rubygem-pg/Makefile,v 1.9 2011/06/19 =
02:30:14 swills Exp $
X#
X
XPORTNAME=3D		rubyrep
XPORTVERSION=3D		1.2.0
XCATEGORIES=3D		databases rubygems
XMASTER_SITES=3D		RG
X
XMAINTAINER=3D		ltning@anduin.net
XCOMMENT=3D		Multi-master replication and sync for MySQL and =
PostgreSQL
X
XUSE_RUBY=3D		yes
XUSE_RUBYGEMS=3D		yes
XRUBYGEM_AUTOPLIST=3D	yes
X
XUSE_RC_SUBR=3D	rubyrep
X
XRUN_DEPENDS+=3D	flog>=3D0:${PORTSDIR}/sysutils/flog
X
XOPTIONS =3D	MYSQL "Enable MySQL support" off \
X		PGSQL "Enable PostgreSQL support" on
X
X.include <bsd.port.options.mk>
X
X.if defined(WITH_PGSQL)
XRUN_DEPENDS+=3D    rubygem-pg>=3D0:${PORTSDIR}/databases/rubygem-pg
X.endif
X
X.if defined(WITH_MYSQL)
XRUN_DEPENDS+=3D    ruby-mysql>=3D0:${PORTSDIR}/databases/ruby-mysql
X.endif
X
X.include <bsd.port.mk>
46ecf18c564e445d214043f5bead61e7
echo x - rubygem-rubyrep/distinfo
sed 's/^X//' >rubygem-rubyrep/distinfo << =
'3d55eea23ef1fbf902369e1d453c30d0'
XSHA256 (rubygem/rubyrep-1.2.0.gem) =3D =
35348b04b3bc5babac1f8350caa9458ccfe33a16ec4bdbaa9eb9f94fee0c04d4
XSIZE (rubygem/rubyrep-1.2.0.gem) =3D 142848
3d55eea23ef1fbf902369e1d453c30d0
echo c - rubygem-rubyrep/files
mkdir -p rubygem-rubyrep/files > /dev/null 2>&1
echo x - rubygem-rubyrep/files/rubyrep.in
sed 's/^X//' >rubygem-rubyrep/files/rubyrep.in << =
'110723b6d54837e8284ff6db1d1cee9e'
X#!/bin/sh
X
X# PROVIDE: rubyrep
X# REQUIRE: NETWORKING SERVERS
X# KEYWORD: shutdown
X
X# Add the following line to /etc/rc.conf to enable `rubyrep':
X#rubyrep_enable=3D"YES"
X# and be sure to configure (at least)
X# %%PREFIX%%/etc/rubyrep/rubyrep.conf
X#
X# To replicate more than one database, change
X#rubyrep_multi=3D"NO"
X# to "YES". A rubyrep process will be started for each file with
X# .conf suffix in $rubyrep_config_dir.
X#
X# Additional options:
X#
X#rubyrep_stdout_log=3D"/var/log/rubyrep.fifo"
X#rubyrep_stderr_log=3D"/var/log/rubyrep_err.fifo"
X#rubyrep_fifo_logs=3D"YES"
X# Specify log files for stdout and stderr. Defaults to using fifos;
X# actual log file will have the extension .log. Additional PID files=20
X# will be created for each of the processes used to tap the fifos;=20
X# these can be used in newsyslog.conf(5) to automate log rotation.
X#
X#rubyrep_config=3D"%%PREFIX%%/etc/rubyrep.conf"
X# Specify full path to default rubyrep configuration file.
X# NOTE: Ignored if $rubyrep_multi is set to "YES"!
X#
X#rubyrep_config_dir=3D"%%PREFIX%%/etc/rubyrep"
X# Specify directory containing config files for rubyrep. Used
X# by $rubyrep_multi, ignored if $rubyrep_multi=3D"NO" (the default).
X#
X#rubyrep_command=3D"replicate"
X# Specify the command to pass to rubyrep. Usually you'll want to
X# replicate (the default), but it is also possible to specify "proxy",
X# "scan" or "sync". Note: This option applies to all databases if
X# $rubyrep_multi=3D"YES"!
X#
X#rubyrep_command_flags=3D""
X# Specify options to pass to the $rubyrep_command above. For other
X# operating modes than "replicate" this may be necessary, especially
X# if you want useful log output! Run
X#   %%prefix%%/bin/rubyrep <command> --help
X# for further information.
X
Xrubyrep_enable=3D"${rubyrep_enable:-"NO"}"
Xrubyrep_multi=3D"${rubyrep_multi:-"NO"}"
Xrubyrep_command=3D"${rubyrep_command:-"replicate"}"
Xrubyrep_command_flags=3D"${rubyrep_command_flags:-""}"
Xrubyrep_config=3D"${rubyrep_config:-"%%PREFIX%%/etc/rubyrep.conf"}"
Xrubyrep_config_dir=3D"${rubyrep_config_dir:-"%%PREFIX%%/etc/rubyrep"}"
Xrubyrep_user=3D"${rubyrep_user:-"daemon"}"
Xrubyrep_stdout_log=3D"${rubyrep_stdout_log:-"/var/log/rubyrep.fifo"}"
Xrubyrep_stderr_log=3D"${rubyrep_stderr_log:-"/var/log/rubyrep_err.fifo"}"=

Xrubyrep_fifo_logs=3D"YES"
X
X. /etc/rc.subr
X
Xcheckfifo() {
X        # Check and create if necessary fifo special files for logging
X        for f in $stdout_log $stderr_log ; do
X                flog_fifo=3D$f
X                if [ ! -p "$flog_fifo" ] ; then
X                        mkfifo $flog_fifo ; chown ${rubyrep_user} =
$flog_fifo
X                fi
X        done
X}
X
Xpid_touch () {
X        touch $pidfile
X        chown $rubyrep_user $pidfile
X}
X
Xrubyrep_prestart() {
X        pid_touch
X	if [ "$rubyrep_fifo_logs"=3D"YES" ] ; then
X	        umask 027
X		checkfifo
X	        for f in $stdout_log $stderr_log ; do
X	                flog_fifo=3D$f
X	                flog_args=3D" -t "
X	                if [ "$cfgname" ] ; then
X				local out_log=3D"`dirname $f`/`basename =
-s .fifo.$cfgname $flog_fifo`.$cfgname.log"
X				local out_pid=3D"/var/run/`basename -s =
.fifo.$cfgname $flog_fifo`.$cfgname.flog.pid"
X			else
X				local out_log=3D"`dirname $f`/`basename =
-s .fifo $flog_fifo`.log"
X				local out_pid=3D"/var/run/`basename -s =
.fifo $flog_fifo`.flog.pid"
X			fi
X
X	                echo "Enabling logging for $flog_fifo ($out_log, =
$out_pid)..."
X	                echo "%%PREFIX%%/bin/flog $flog_args $out_log < =
$flog_fifo &"
X	                %%PREFIX%%/bin/flog $flog_args $out_log < =
$flog_fifo &
X	                echo $! > $out_pid
X	        done
X	fi
X}
X
Xrubyrep_stop() {
X	if [ -f "$pidfile" ] ; then
X		kill -9 `cat $pidfile`
X		rm $pidfile
X	else
X		echo "PID file not found ($pidfile)"
X	fi
X}
X
Xrubyrep_poststop() {
X	if [ "$rubyrep_fifo_logs"=3D"YES" ] ; then
X	        for f in $stdout_log $stderr_log ; do
X	                flog_fifo=3D$f
X	                if [ "$cfgname" ] ; then
X				local out_pid=3D"/var/run/`basename -s =
.fifo.$cfgname $flog_fifo`.$cfgname.flog.pid"
X			else
X				local out_pid=3D"/var/run/`basename -s =
.fifo $flog_fifo`.flog.pid"
X			fi
X	                kill $out_pid >/dev/null 2>/dev/null
X	                rm $out_pid >/dev/null 2>/dev/null
X	        done
X	fi
X}
X
Xrubyrep_init() {
X	if [ "$rubyrep_multi" =3D "NO" ] ; then
X		cmdline=3D"%%PREFIX%%/bin/rubyrep generate =
$rubyrep_config"
X		if [ "$1" =3D "init" -a -f "$rubyrep_config" ] ; then
X			echo "Skipping file $rubyrep_config (already =
exists)."
X		else
X			echo "Generating template file $rubyrep_config"
X			$cmdline
X		fi
X	else
X		echo 'Command not available when $rubyrep_multi=3D"YES"'.
X		exit
X	fi
X}
X
Xname=3D"rubyrep"
Xrcvar=3D`set_rcvar`
X
X# read configuration and set defaults
Xload_rc_config $name
X
Xextra_commands=3D"init"
Xinit_cmd=3D"${name}_init"
X
Xcommand=3D"/usr/sbin/daemon"
Xstart_precmd=3D"${name}_prestart"
Xstop_cmd=3D"${name}_stop"
Xstop_postcmd=3D"${name}_poststop"
Xrubyrep_command_flags=3D"$rubyrep_command_flags"
X
Xif [ "$rubyrep_multi" =3D "NO" ] ; then
X	stdout_log=3D${rubyrep_stdout_log}
X	stderr_log=3D${rubyrep_stderr_log}
X	log_args=3D">> ${stdout_log} 2>> ${stderr_log} "
X	cmdline=3D"%%PREFIX%%/bin/rubyrep $rubyrep_command =
$rubyrep_command_flags -c $rubyrep_config"
X	pidfile=3D"/var/run/$name.pid"
X	flags=3D"-p ${pidfile} ${cmdline} ${log_args}"
X	run_rc_command "$1"
Xelif [ "$rubyrep_multi" =3D "YES" ] ; then
X	[ ! -d "$rubyrep_config_dir" ] && mkdir -p "$rubyrep_config_dir"
X	for i in `ls $rubyrep_config_dir/*.conf` ; do
X		rubyrep_config=3D$i
X		cfgname=3D$(basename -s .conf $i)
X		stdout_log=3D${rubyrep_stdout_log}.$cfgname
X		stderr_log=3D${rubyrep_stderr_log}.$cfgname
X		log_args=3D">> ${stdout_log} 2>> ${stderr_log} "
X		cmdline=3D"%%PREFIX%%/bin/rubyrep $rubyrep_command =
$rubyrep_command_flags -c $rubyrep_config"
X		pidfile=3D"/var/run/${name}_${cfgname}.pid"
X		flags=3D"-p ${pidfile} ${cmdline} ${log_args}"
X		run_rc_command "$1"
X	done
Xfi
110723b6d54837e8284ff6db1d1cee9e
echo x - rubygem-rubyrep/pkg-descr
sed 's/^X//' >rubygem-rubyrep/pkg-descr << =
'86a2eb1fc929445e37be1c2eda5a248c'
XMission:
XDevelopment of an open-source solution for asynchronous, master-master
Xreplication of relational databases that is
X
X- ridiculously easy to use
X- database independent
X
XCurrently supports PostgreSQL and MySQL.
X
XWWW: http://www.rubyrep.org/
86a2eb1fc929445e37be1c2eda5a248c
exit


>Release-Note:
>Audit-Trail:
>Unformatted:
 X-send-pr-version: 3.113
 X-GNATS-Notify:=20
 
 replication and sync for MySQL and PostgreSQL



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CD988D92-639C-4B83-A187-3C994E2CC6B1>