Opened 13 years ago

Closed 12 years ago

Last modified 20 months ago

#15266 closed submission (fixed)

ZRM -- Zmanda Recovery Manager for MySQL -- Portfile

Reported by: kmayer (Ken Mayer) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: jmroot (Joshua Root)
Port: mysql-zrm

Description

Submitted for your approval, a mysql backup suite that sucks less.

I've been using ZRM for my MySQL5 backups and find it far less annoying than some of the other alternatives. Since I had to deploy it to multiple machines, I decided to automate it and create a Portfile for others in the community. This initial port is not tested for remote backup servers, but it works fine with local copies of mysql5 (using the default Leopard installation).

This is my first submitted Portfile, I probably made a few stylistic errors, so be gentle.

The source tar ball from zmanda.com has no configuration or installation scripts (although they do have deb & rpm bundles); it's just a destroot-like directory tree. Not exactly like the ports hierarchy, however. I had to write a bunch of reinplace script / patches to move things around, and rewrite paths appropriately.

I have installed this successfully on Tiger & Leopard.

Attachments (1)

mysql-zrm.tar (20.0 KB) - added by kmayer (Ken Mayer) 12 years ago.
Portfile Revision 6. MD5 (mysql-zrm.tar) = 3076618ef8d2e5f49d6c29b80c85be97

Download all attachments as: .zip

Change History (9)

comment:1 Changed 13 years ago by kmayer (Ken Mayer)

Here's the port file (from the included tar file), for review

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem		1.0
name			mysql-zrm
version			2.0
revision		5
categories		databases sysutils
maintainers		kmayer@bitwrangler.com
description		Zmanda Recovery Manager for MySQL
long_description	Zmanda Recovery Manager (ZRM) \
	for MySQL simplifies the life of a Database Administrator \
	who needs an easy-to-use yet flexible and robust backup and \
	recovery solution for MySQL server. You can find a \
	quick start guide at: http://www.zmanda.com/quick-mysql-backup.html
homepage		http://www.zmanda.com/backup-mysql.html
platforms       	darwin
master_sites		http://www.zmanda.com/downloads/community/ZRM-MySQL/${version}/Source/
distname		MySQL-zrm-${version}
checksums		md5 13a82abeb181d265af553770d1db6718
depends_lib		port:p5-dbi \
			port:p5-xml-parser
use_configure		no
patchfiles		patch-mysql-zrm-backup-0 \
			patch-mysql-zrm-verify-backup-1 \
			patch-zrm-pre-scheduler-2 \
			patch-mysql-zrm-scheduler-3 \
			patch-mysql-zrm-4
destroot.keepdirs	${destroot}${prefix}/var/lib/mysql-zrm \
			${destroot}${prefix}/var/log/mysql-zrm

post-patch {
	# Not the most efficient way to do this, but much more readable
	foreach f [exec find ${worksrcpath} -type f -print] {
		reinplace "s|/opt/csw/bin|${prefix}/bin|" ${f}
		reinplace "s|/usr/bin/perl|${prefix}/bin/perl|" ${f}
		reinplace "s|/usr/bin/mysql-zrm|${prefix}/bin/mysql-zrm|" ${f}
		reinplace "s|/usr/lib/mysql-zrm|${prefix}/lib/mysql-zrm|" ${f}
		reinplace "s|/usr/share/mysql-zrm|${prefix}/share/mysql-zrm|" ${f}
		reinplace "s|/etc/mysql-zrm|${prefix}/etc/mysql-zrm|" ${f}
		reinplace "s|/var/lib|${prefix}/var/lib|" ${f}
		reinplace "s|/var/log|${prefix}/var/log|" ${f}
	}
	reinplace "s|@BINPATH@|${prefix}/bin|" \
		${worksrcpath}/usr/bin/zrm-pre-scheduler \
		${worksrcpath}/usr/bin/mysql-zrm-scheduler \
		${worksrcpath}/usr/bin/mysql-zrm
}

build {}

destroot {
	xinstall -m 755 -d ${destroot}${prefix}/bin
	eval xinstall -m 755 [glob ${worksrcpath}/usr/bin/*] \
		${destroot}${prefix}/bin

	xinstall -m 755 -d ${destroot}${prefix}/lib/mysql-zrm/Data/Report/Plugin
	xinstall -m 444 ${worksrcpath}/usr/lib/mysql-zrm/Data/Report.pm \
		${destroot}${prefix}/lib/mysql-zrm/Data
	xinstall -m 444 ${worksrcpath}/usr/lib/mysql-zrm/Data/Report/Base.pm \
		${destroot}${prefix}/lib/mysql-zrm/Data/Report
	eval xinstall -m 444 [glob ${worksrcpath}/usr/lib/mysql-zrm/Data/Report/Plugin/*] \
		 ${destroot}${prefix}/lib/mysql-zrm/Data/Report

	xinstall -m 755 -d ${destroot}${prefix}/lib/mysql-zrm/XML
	eval xinstall -m 444 [glob ${worksrcpath}/usr/lib/mysql-zrm/XML/*] \
		${destroot}${prefix}/lib/mysql-zrm/XML

	xinstall -m 755 -d ${destroot}${prefix}/lib/mysql-zrm/ZRM
	eval xinstall -m 444 [glob ${worksrcpath}/usr/lib/mysql-zrm/ZRM/*] \
		${destroot}${prefix}/lib/mysql-zrm/ZRM

	xinstall -m 755 -d ${destroot}${prefix}/share/doc/MySQL-zrm-2.0
	eval xinstall -m 444 [glob ${worksrcpath}/usr/share/doc/MySQL-zrm-2.0/*] \
		${destroot}${prefix}/share/doc/MySQL-zrm-2.0

	xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
	eval xinstall -m 444 [glob ${worksrcpath}/usr/share/man/man1/*] \
		${destroot}${prefix}/share/man/man1

	xinstall -m 755 -d ${destroot}${prefix}/share/man/man5
	eval xinstall -m 444 [glob ${worksrcpath}/usr/share/man/man5/*] \
		${destroot}${prefix}/share/man/man5

	xinstall -m 755 -d ${destroot}${prefix}/share/mysql-zrm/plugins
	eval xinstall -m 444 [glob ${worksrcpath}/usr/share/mysql-zrm/plugins/*] \
		${destroot}${prefix}/share/mysql-zrm/plugins

	xinstall -m 755 -d ${destroot}${prefix}/etc/mysql-zrm
	eval xinstall -m 644 [glob ${worksrcpath}/etc/mysql-zrm/*] \
		${destroot}${prefix}/etc/mysql-zrm

	xinstall -m 755 -d ${destroot}/var/lib/mysql-zrm
	xinstall -m 755 -d ${destroot}/var/log/mysql-zrm
}

Changed 12 years ago by kmayer (Ken Mayer)

Attachment: mysql-zrm.tar added

Portfile Revision 6. MD5 (mysql-zrm.tar) = 3076618ef8d2e5f49d6c29b80c85be97

comment:2 Changed 12 years ago by kmayer (Ken Mayer)

Cc: kmayer@… added

Cc Me!

comment:3 Changed 12 years ago by raimue (Rainer Müller)

Just digged up this very old ticket. Sorry for the long delay. Are you still interested in addition and maintaining?

comment:4 in reply to:  3 Changed 12 years ago by kmayer (Ken Mayer)

Replying to raimue@…:

Just digged up this very old ticket. Sorry for the long delay. Are you still interested in addition and maintaining?

Sure! Sign me up!

comment:5 Changed 12 years ago by jmroot (Joshua Root)

Cc: jmr@… added; kmayer@… removed
Port: mysql-zrm added
Priority: Not setNormal
Resolution: fixed
Status: newclosed

Committed in r48493 with a few changes:

  • obfuscated maintainer address
  • changed ${destroot} to ${destroot}${prefix} in a couple places
  • deleted revision line (initial revision should be 0, which is the default)

comment:6 Changed 12 years ago by jmroot (Joshua Root)

Type: enhancementsubmission

comment:7 Changed 12 years ago by (none)

Milestone: Port Submissions

Milestone Port Submissions deleted

comment:8 Changed 20 months ago by mojca (Mojca Miklavec)

In 9348a447faa21fcf09363206fe26439dda7b3c9d/macports-ports (master):

mysql-zrm: add maintainer's github handle

Also make the port openmaintainer.

See: #15266

Note: See TracTickets for help on using tickets.