Name: mysql-master-master Version: 1.2.3 Release: 1 Summary: MySQL Master-Master Replication Manager License: GPLv2 Group: Applications/System Source: http://mysql-master-master.googlecode.com/files/mysql-master-master-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires: initscripts %description MMM (MySQL Master-Master Replication Manager) is a set of flexible scripts to perform monitoring/failover and management of MySQL Master-Master replication configurations (with only one node writable at any time). The toolset also has the ability to read balance standard master/slave configurations with any number of slaves, so you can use it to move virtual IP addresses around a group of servers depending on whether they are behind in replication. %prep %setup -q %build # Nothing to build %install rm -rf $RPM_BUILD_ROOT %define mmm_instdir /usr/local/mmm # Use built in install script. # /usr/local/mmm seems to be hardcoded in places... # Maybe it can be adjusted at some point ./install.pl --prefix=$RPM_BUILD_ROOT%{mmm_instdir} \ --disable-symlinks \ --skip-checks # Make symlinks our way (script makes links with rpm install root) pushd $RPM_BUILD_ROOT%{mmm_instdir}/sbin mkdir -p $RPM_BUILD_ROOT%{_sbindir} for i in *; do ln -s %{mmm_instdir}/sbin/$i $RPM_BUILD_ROOT%{_sbindir}/$i done popd pushd $RPM_BUILD_ROOT%{mmm_instdir}/man/man1 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 for i in *; do ln -s %{mmm_instdir}/man/man1/$i $RPM_BUILD_ROOT%{_mandir}/man1/$i done popd # Install init scripts and logrotate conf mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d install -m755 scripts/init.d/mmm_agent \ $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/mmm_agent install -m755 scripts/init.d/mmm_mon \ $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/mmm_mon mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d install -m644 scripts/logrotate.d/mmm \ $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/mmm # Remove unpackaged files/dirs rm -rf $RPM_BUILD_ROOT%{mmm_instdir}/scripts \ $RPM_BUILD_ROOT%{mmm_instdir}/install.sh \ $RPM_BUILD_ROOT%{mmm_instdir}/.hg_archival.txt \ $RPM_BUILD_ROOT%{mmm_instdir}/contrib \ $RPM_BUILD_ROOT%{mmm_instdir}/man/src \ $RPM_BUILD_ROOT%{mmm_instdir}/CHANGES \ $RPM_BUILD_ROOT%{mmm_instdir}/COPYING \ $RPM_BUILD_ROOT%{mmm_instdir}/INSTALL \ $RPM_BUILD_ROOT%{mmm_instdir}/README \ $RPM_BUILD_ROOT%{mmm_instdir}/VERSION %clean rm -rf $RPM_BUILD_ROOT %post # Register the services /sbin/chkconfig --add mmm_agent /sbin/chkconfig --add mmm_mon %preun # Stop and remove services if uninstalling completely if [ $1 = 0 ]; then /sbin/service mmm_agent stop > /dev/null 2>&1 /sbin/service mmm_mon stop > /dev/null 2>&1 /sbin/chkconfig --del mmm_agent /sbin/chkconfig --del mmm_mon fi %files %defattr(-, root, root, 0755) %doc CHANGES COPYING INSTALL README VERSION %{_mandir}/man?/* %config(noreplace) %{_sysconfdir}/logrotate.d/mmm %config %{_sysconfdir}/rc.d/init.d/mmm_agent %config %{_sysconfdir}/rc.d/init.d/mmm_mon %{mmm_instdir} %{_sbindir} %changelog * Wed Feb 25 2009 Ryan Lowe - Initial build (I owe JayKim)