diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index e69de29..0000000
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..646cf67
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+mysql-mmm-2.2.1.pdf
+mysql-mmm-2.2.1.tar.gz
+/mysql-mmm-2.2.1.pdf
+/mysql-mmm-2.2.1.tar.gz
diff --git a/Makefile b/Makefile
deleted file mode 100644
index e5a4c5f..0000000
--- a/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile for source rpm: mysql-mmm
-# $Id$
-NAME := mysql-mmm
-SPECFILE = $(firstword $(wildcard *.spec))
-
-define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
-endef
-
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
-
-ifeq ($(MAKEFILE_COMMON),)
-# attept a checkout
-define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
-endef
-
-MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
-endif
-
-include $(MAKEFILE_COMMON)
diff --git a/mmm_agent.conf b/mmm_agent.conf
new file mode 100644
index 0000000..ae54b78
--- /dev/null
+++ b/mmm_agent.conf
@@ -0,0 +1,6 @@
+include mmm_common.conf
+
+# The 'this' variable refers to this server. Proper operation requires
+# that 'this' server (db1 by default), as well as all other servers, have the
+# proper IP addresses set in mmm_common.conf.
+this db1
diff --git a/mmm_common.conf b/mmm_common.conf
new file mode 100644
index 0000000..7e9caa2
--- /dev/null
+++ b/mmm_common.conf
@@ -0,0 +1,40 @@
+active_master_role writer
+
+
+ cluster_interface eth0
+ pid_path /run/mysql-mmm-agent.pid
+ bin_path /usr/libexec/mysql-mmm/
+ replication_user replicant
+ replication_password slave
+ agent_user mmm_agent
+ agent_password RepAgent
+
+
+
+ ip 192.168.100.49
+ mode master
+ peer db2
+
+
+
+ ip 192.168.100.50
+ mode master
+ peer db1
+
+
+#
+# ip 192.168.100.51
+# mode slave
+#
+
+
+ hosts db1, db2
+ ips 192.168.100.250
+ mode exclusive
+
+
+
+ hosts db1, db2
+ ips 192.168.100.251, 192.168.100.252
+ mode balanced
+
diff --git a/mmm_mon.conf b/mmm_mon.conf
new file mode 100644
index 0000000..179deb7
--- /dev/null
+++ b/mmm_mon.conf
@@ -0,0 +1,24 @@
+include mmm_common.conf
+
+
+ ip 127.0.0.1
+ pid_path /run/mysql-mmm-monitor.pid
+ bin_path /usr/libexec/mysql-mmm
+ status_path /var/lib/mysql-mmm/mmm_mond.status
+ ping_ips 192.168.100.50
+ auto_set_online 60
+
+ # The kill_host_bin does not exist by default, though the monitor will
+ # throw a warning about it missing. See the section 5.10 "Kill Host
+ # Functionality" in the PDF documentation.
+ #
+ # kill_host_bin /usr/libexec/mysql-mmm/monitor/kill_host
+ #
+
+
+
+ monitor_user mmm_monitor
+ monitor_password RepMonitor
+
+
+debug 0
diff --git a/mmm_mon_log.conf b/mmm_mon_log.conf
new file mode 100644
index 0000000..3bea103
--- /dev/null
+++ b/mmm_mon_log.conf
@@ -0,0 +1,18 @@
+#log4perl.logger = FATAL, MMMLog, MailFatal
+log4perl.logger = FATAL, MMMLog
+
+log4perl.appender.MMMLog = Log::Log4perl::Appender::File
+log4perl.appender.MMMLog.Threshold = INFO
+log4perl.appender.MMMLog.filename = /var/log/mysql-mmm/mmm_mond.log
+log4perl.appender.MMMLog.recreate = 1
+log4perl.appender.MMMLog.layout = PatternLayout
+log4perl.appender.MMMLog.layout.ConversionPattern = %d %5p %m%n
+
+#log4perl.appender.MailFatal = Log::Dispatch::Email::MailSender
+#log4perl.appender.MailFatal.Threshold = FATAL
+#log4perl.appender.MailFatal.from = mmm@example.com
+#log4perl.appender.MailFatal.to = root
+#log4perl.appender.MailFatal.buffered = 0
+#log4perl.appender.MailFatal.subject = FATAL error in mysql-mmm-monitor
+#log4perl.appender.MailFatal.layout = PatternLayout
+#log4perl.appender.MailFatal.layout.ConversionPattern = %d %m%n
diff --git a/mmm_tools.conf b/mmm_tools.conf
new file mode 100644
index 0000000..75b6e5f
--- /dev/null
+++ b/mmm_tools.conf
@@ -0,0 +1,43 @@
+include mmm_agent.conf
+
+default_copy_method scp
+clone_dirs data, logs
+
+
+ ssh_user root
+
+ lvm_snapshot_size 1G
+ lvm_logical_volume mysql
+ lvm_volume_group storage
+ lvm_mount_dir /mmm_snapshot
+ lvm_mount_opts -orw,nouuid
+
+ tools_user mmm_tools
+ tools_password RepTools
+
+ backup_dir /mmm_backup
+ restore_dir /mysql
+
+
+
+
+ backup_command scp -c blowfish -r %SSH_USER%@%IP%:%SNAPSHOT%/%CLONE_DIR% %DEST_DIR%/
+ restore_command cp -axv %BACKUP_DIR%/* %DEST_DIR%/
+ true_copy 1
+
+
+
+ backup_command rdiff-backup --ssh-no-compression -v 5 !--include %SNAPSHOT%/%CLONE_DIR%! --exclude %SNAPSHOT% %SSH_USER%@%IP%::%SNAPSHOT%/ %DEST_DIR%/
+ restore_command rdiff-backup --force -v 5 -r %VERSION% %BACKUP_DIR% %DEST_DIR%/.mmm_restore; cp -axvl --remove-destination %DEST_DIR%/.mmm_restore/* %DEST_DIR%/; rm -r %DEST_DIR%/.mmm_restore/
+ incremental_command rdiff-backup --parsable-output -l %BACKUP_DIR%
+ single_run 1
+ incremental 1
+
+
+
+ backup_command ssh -c blowfish %SSH_USER%@%IP% "cd '%SNAPSHOT%'; tar cv !'%CLONE_DIR%'!" | gzip > %DEST_DIR%/backup.tar.gz
+ restore_command cd %DEST_DIR%; tar xzfv %BACKUP_DIR%/backup.tar.gz
+ single_run 1
+
+
+
diff --git a/mysql-mmm-2.1.0-paths.patch b/mysql-mmm-2.1.0-paths.patch
new file mode 100644
index 0000000..fb5be84
--- /dev/null
+++ b/mysql-mmm-2.1.0-paths.patch
@@ -0,0 +1,11 @@
+--- mysql-mmm-2.1.0/Makefile.orig 2010-02-18 09:49:25.000000000 -0600
++++ mysql-mmm-2.1.0/Makefile 2010-02-22 18:10:53.000000000 -0600
+@@ -4,7 +4,7 @@
+ endif
+
+ MODULEDIR = $(DESTDIR)$(shell eval "`perl -V:${INSTALLDIR}`"; echo "$$${INSTALLDIR}")/MMM
+-BINDIR = $(DESTDIR)/usr/lib/mysql-mmm
++BINDIR = $(DESTDIR)/usr/libexec/mysql-mmm
+ SBINDIR = $(DESTDIR)/usr/sbin
+ LOGDIR = $(DESTDIR)/var/log/mysql-mmm
+ ETCDIR = $(DESTDIR)/etc
diff --git a/mysql-mmm-add-notify-cmd.patch b/mysql-mmm-add-notify-cmd.patch
new file mode 100644
index 0000000..a3f8437
--- /dev/null
+++ b/mysql-mmm-add-notify-cmd.patch
@@ -0,0 +1,50 @@
+diff --git a/lib/Agent/Agent.pm b/lib/Agent/Agent.pm
+index 2e2480b..c98f39a 100644
+--- a/lib/Agent/Agent.pm
++++ b/lib/Agent/Agent.pm
+@@ -37,6 +37,7 @@ struct 'MMM::Agent::Agent' => {
+ mysql_password => '$',
+ writer_role => '$',
+ bin_path => '$',
++ notify_cmd => '$',
+
+ active_master => '$',
+ state => '$',
+@@ -50,6 +51,8 @@ sub main($) {
+ $self->roles([]);
+ $self->active_master('');
+
++ if ($self->notify_cmd) { system($self->notify_cmd); }
++
+ while (!$main::shutdown) {
+
+ DEBUG 'Listener: Waiting for connection...';
+@@ -236,6 +239,8 @@ sub cmd_set_status($$) {
+ foreach my $role (@added_roles) { $role->add(); }
+
+ $self->roles(\@new_roles);
++
++ if ($self->notify_cmd) { system($self->notify_cmd); }
+ }
+
+ # Process state change
+@@ -272,6 +277,7 @@ sub from_config($%) {
+ $self->mysql_password ($host->{agent_password});
+ $self->writer_role ($config->{active_master_role});
+ $self->bin_path ($host->{bin_path});
++ $self->notify_cmd ($host->{notify_cmd});
+ }
+
+ 1;
+diff --git a/lib/Common/Config.pm b/lib/Common/Config.pm
+index 1870d5e..6c0af28 100644
+--- a/lib/Common/Config.pm
++++ b/lib/Common/Config.pm
+@@ -99,6 +99,7 @@ our $RULESET = {
+ 'lvm_volume_group' => { 'required' => ['TOOLS'] },
+ 'lvm_mount_dir' => { 'required' => ['TOOLS'] },
+ 'lvm_mount_opts' => { 'required' => ['TOOLS'] },
++ 'notify_cmd' => { 'default' => '' },
+ }
+ },
+ 'check' => { 'create_if_empty' => ['MONITOR'], 'multiple' => 1, 'template' => 'default', 'values' => ['ping', 'mysql', 'rep_backlog', 'rep_threads'], 'section' => {
diff --git a/mysql-mmm-agent.init b/mysql-mmm-agent.init
new file mode 100644
index 0000000..3ffc7a0
--- /dev/null
+++ b/mysql-mmm-agent.init
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# mysql-mmm-agent This shell script takes care of starting and stopping
+# the mmm agent daemon.
+#
+# chkconfig: - 64 36
+# description: MMM Agent.
+# processname: mmm_agentd
+# config: /etc/mysql-mmm/mmm_agent.conf
+# pidfile: /var/run/mysql-mmm/mmm_agentd.pid
+
+# Source function library and defaults file.
+. /etc/rc.d/init.d/functions
+. /etc/default/mysql-mmm-agent
+
+# Paths
+MMMD_AGENT_BIN="/usr/sbin/mmm_agentd"
+MMMD_AGENT_PIDFILE="/var/run/mysql-mmm/mmm_agentd.pid"
+LOCKFILE='/var/lock/subsys/mysql-mmm-agent'
+prog='MMM Agent Daemon'
+
+
+start() {
+ if [ "${ENABLED}" != "1" ]; then
+ echo "$prog is disabled!"
+ exit 1
+ fi
+
+ # ensure directories exist (/var/run and /var/lock
+ # are tmpfs since Fedora 15
+ run_dir=$(dirname $MMMD_AGENT_PIDFILE)
+ if [ ! -e "$run_dir" ]; then
+ mkdir -p $run_dir
+ fi
+
+ echo -n "Starting $prog: "
+ if [ -s $MMMD_AGENT_PIDFILE ] && kill -0 `cat $MMMD_AGENT_PIDFILE` 2> /dev/null; then
+ echo " already running."
+ exit 0
+ fi
+ daemon $MMMD_AGENT_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $LOCKFILE
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemon.
+ echo -n "Stopping $prog: "
+ killproc -p $MMMD_AGENT_PIDFILE $MMMD_AGENT_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f $LOCKFILE
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+
+ stop)
+ stop
+ ;;
+
+ status)
+ status -p $MMMD_AGENT_PIDFILE $MMMD_AGENT_BIN
+ RETVAL=$?
+ ;;
+
+ restart|reload)
+ stop
+ start
+ ;;
+
+ condrestart)
+ if [ -f $LOCKFILE ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|condrestart|status}"
+ ;;
+esac
+
+exit $RETVAL
diff --git a/mysql-mmm-agent.service b/mysql-mmm-agent.service
new file mode 100644
index 0000000..3447f29
--- /dev/null
+++ b/mysql-mmm-agent.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=MySQL MMM agent
+After=network.target mysqld.service
+
+[Service]
+Type=forking
+PIDFile=/run/mysql-mmm-agent.pid
+ExecStart=/usr/bin/mmm_agentd
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mysql-mmm-fix-bug-with-newer-net-arp.patch b/mysql-mmm-fix-bug-with-newer-net-arp.patch
new file mode 100644
index 0000000..be6db0d
--- /dev/null
+++ b/mysql-mmm-fix-bug-with-newer-net-arp.patch
@@ -0,0 +1,26 @@
+diff -rup mysql-mmm-2.2.1.orig/lib/Agent/Helpers/Network.pm mysql-mmm-2.2.1/lib/Agent/Helpers/Network.pm
+--- mysql-mmm-2.2.1.orig/lib/Agent/Helpers/Network.pm 2010-05-07 07:55:50.000000000 +0000
++++ mysql-mmm-2.2.1/lib/Agent/Helpers/Network.pm 2014-12-02 17:02:38.234674563 +0000
+@@ -133,7 +133,7 @@ sub send_arp($$) {
+
+ if ($OSNAME eq 'linux' || $OSNAME eq 'freebsd') {
+ my $mac = '';
+- if ($Net::ARP::VERSION < 1.0) {
++ if ($Net::ARP::VERSION =~ /^0/) { # VERSION < 1.0 check that even works for 1.0.8, etc.
+ Net::ARP::get_mac($if, $mac);
+ }
+ else {
+diff -rup mysql-mmm-2.2.1.orig/lib/Agent/Helpers.pm mysql-mmm-2.2.1/lib/Agent/Helpers.pm
+--- mysql-mmm-2.2.1.orig/lib/Agent/Helpers.pm 2010-05-07 07:55:50.000000000 +0000
++++ mysql-mmm-2.2.1/lib/Agent/Helpers.pm 2014-12-02 00:52:26.454298472 +0000
+@@ -168,8 +168,8 @@ sub _execute($$$) {
+ my $config_file = $main::agent->config_file;
+ $params = '' unless defined($params);
+
+- DEBUG "Executing $path $params";
+- my $res = `$path $config_file $params`;
++ DEBUG "Executing $path $config_file $params";
++ my $res = `$path $config_file $params 2>&1`;
+
+ unless ($return_all) {
+ my @lines = split /\n/, $res;
diff --git a/mysql-mmm-fix-cve-remote-command-injection.patch b/mysql-mmm-fix-cve-remote-command-injection.patch
new file mode 100644
index 0000000..315fb13
--- /dev/null
+++ b/mysql-mmm-fix-cve-remote-command-injection.patch
@@ -0,0 +1,87 @@
+diff --git a/lib/Agent/Helpers.pm b/lib/Agent/Helpers.pm
+index 24caae8..c0155e4 100644
+--- a/lib/Agent/Helpers.pm
++++ b/lib/Agent/Helpers.pm
+@@ -168,6 +168,10 @@ sub _execute($$$) {
+ my $config_file = $main::agent->config_file;
+ $params = '' unless defined($params);
+
++ if ($params !~ /^[\w\. \:\-]*$/) {
++ _exit_error("ERROR: Invalid Parameter");
++ }
++
+ DEBUG "Executing $path $config_file $params";
+ my $res = `$path $config_file $params 2>&1`;
+
+diff --git a/lib/Agent/Helpers/Network.pm b/lib/Agent/Helpers/Network.pm
+index 8ef4468..b0d5a8b 100644
+--- a/lib/Agent/Helpers/Network.pm
++++ b/lib/Agent/Helpers/Network.pm
+@@ -33,6 +33,10 @@ sub check_ip($$) {
+ my $if = shift;
+ my $ip = shift;
+
++ if ($ip !~ /^[\d\.]*$/) {
++ _exit_error("ERROR: Invalid IP Address");
++ }
++
+ my $output;
+ if ($OSNAME eq 'linux') {
+ $output = `/sbin/ip addr show dev $if`;
+@@ -65,6 +69,10 @@ sub add_ip($$) {
+ my $if = shift;
+ my $ip = shift;
+
++ if ($ip !~ /^[\d\.]*$/) {
++ _exit_error("ERROR: Invalid IP Address");
++ }
++
+ my $output;
+ if ($OSNAME eq 'linux') {
+ $output = `/sbin/ip addr add $ip/32 dev $if`;
+@@ -101,6 +109,10 @@ sub clear_ip($$) {
+ my $if = shift;
+ my $ip = shift;
+
++ if ($ip !~ /^[\d\.]*$/) {
++ _exit_error("ERROR: Invalid IP Address");
++ }
++
+ my $output;
+ if ($OSNAME eq 'linux') {
+ $output = `/sbin/ip addr del $ip/32 dev $if`;
+@@ -130,6 +142,9 @@ sub send_arp($$) {
+ my $if = shift;
+ my $ip = shift;
+
++ if ($ip !~ /^[\d\.]*$/) {
++ _exit_error("ERROR: Invalid IP Address");
++ }
+
+ if ($OSNAME eq 'linux' || $OSNAME eq 'freebsd') {
+ my $mac = '';
+diff --git a/lib/Common/Role.pm b/lib/Common/Role.pm
+index 7cd4dc9..211ab5f 100644
+--- a/lib/Common/Role.pm
++++ b/lib/Common/Role.pm
+@@ -59,7 +59,7 @@ sub from_string($$) {
+ my $class = shift;
+ my $string = shift;
+
+- if (my ($name, $ip) = $string =~ /(.*)\((.*)\)/) {
++ if (my ($name, $ip) = $string =~ /^([\w_\.\-]+)\(([\d\.]+)\)$/) {
+ return $class->new(name => $name, ip => $ip);
+ }
+ return undef;
+diff --git a/lib/Common/Socket.pm b/lib/Common/Socket.pm
+index 6adecd1..38e1f7b 100644
+--- a/lib/Common/Socket.pm
++++ b/lib/Common/Socket.pm
+@@ -80,6 +80,7 @@ sub create_sender($$$) {
+ SSL_cert_file => $main::config->{'socket'}->{cert_file},
+ SSL_key_file => $main::config->{'socket'}->{key_file},
+ SSL_ca_file => $main::config->{'socket'}->{ca_file},
++ SSL_verify_mode => 0x03 # SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT
+ );
+ }
+
diff --git a/mysql-mmm-monitor.init b/mysql-mmm-monitor.init
new file mode 100644
index 0000000..edfd742
--- /dev/null
+++ b/mysql-mmm-monitor.init
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# mysql-mmm-monitor This shell script takes care of starting and stopping
+# the mmm monitoring daemon.
+#
+# chkconfig: - 64 36
+# description: MMM Monitor.
+# processname: mmm_mond
+# config: /etc/mysql-mmm/mmm_mon.conf
+# pidfile: /var/run/mysql-mmm/mmm_mond.pid
+
+# Source function library and defaults file.
+. /etc/rc.d/init.d/functions
+. /etc/default/mysql-mmm-monitor
+
+# Cluster name (it can be empty for default cases)
+CLUSTER=''
+LOCKFILE='/var/lock/subsys/mysql-mmm-monitor'
+prog='MMM Monitor Daemon'
+
+if [ "$CLUSTER" != "" ]; then
+ MMMD_MON_BIN="/usr/sbin/mmm_mond @$CLUSTER"
+ MMMD_MON_PIDFILE="/var/run/mysql-mmm/mmm_mond-$CLUSTER.pid"
+else
+ MMMD_MON_BIN="/usr/sbin/mmm_mond"
+ MMMD_MON_PIDFILE="/var/run/mysql-mmm/mmm_mond.pid"
+fi
+
+start() {
+ if [ "${ENABLED}" != "1" ]; then
+ echo "$prog is disabled!"
+ exit 1
+ fi
+
+ # ensure directories exist (/var/run and /var/lock
+ # are tmpfs since Fedora 15
+ run_dir=$(dirname $MMMD_MON_PIDFILE)
+ if [ ! -e "$run_dir" ]; then
+ mkdir -p $run_dir
+ fi
+
+ echo -n "Starting $prog: "
+ if [ -s $MMMD_MON_PIDFILE ] && kill -0 `cat $MMMD_MON_PIDFILE` 2> /dev/null; then
+ echo " already running."
+ exit 0
+ fi
+ daemon $MMMD_MON_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $LOCKFILE
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemon.
+ echo -n "Stopping $prog: "
+ killproc -p $MMMD_MON_PIDFILE $MMMD_MON_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f $LOCKFILE
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+
+ stop)
+ stop
+ ;;
+
+ status)
+ status -p $MMMD_MON_PIDFILE $MMMD_MON_BIN
+ RETVAL=$?
+ ;;
+
+ restart|reload)
+ stop
+ start
+ ;;
+
+ condrestart)
+ if [ -f $LOCKFILE ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|condrestart|status}"
+ ;;
+esac
+
+exit $RETVAL
diff --git a/mysql-mmm-monitor.service b/mysql-mmm-monitor.service
new file mode 100644
index 0000000..748a621
--- /dev/null
+++ b/mysql-mmm-monitor.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=MySQL MMM Monitor
+After=network.target mysqld.service
+
+[Service]
+Type=forking
+PIDFile=/run/mysql-mmm-monitor.pid
+ExecStart=/usr/bin/mmm_mond
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mysql-mmm-suppress-uninitialized-warning.patch b/mysql-mmm-suppress-uninitialized-warning.patch
new file mode 100644
index 0000000..7906911
--- /dev/null
+++ b/mysql-mmm-suppress-uninitialized-warning.patch
@@ -0,0 +1,564 @@
+diff --git a/bin/agent/check_ip b/bin/agent/check_ip
+index 8a91cf3..cbcdc32 100755
+--- a/bin/agent/check_ip
++++ b/bin/agent/check_ip
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Agent::Helpers::Actions;
+
+ # Check arguments
+diff --git a/bin/agent/clear_ip b/bin/agent/clear_ip
+index e5cb697..c31d200 100755
+--- a/bin/agent/clear_ip
++++ b/bin/agent/clear_ip
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Agent::Helpers::Actions;
+
+ # Check arguments
+diff --git a/bin/agent/configure_ip b/bin/agent/configure_ip
+index f8d2aab..9017020 100755
+--- a/bin/agent/configure_ip
++++ b/bin/agent/configure_ip
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Agent::Helpers::Actions;
+
+ # Check arguments
+diff --git a/bin/agent/mysql_allow_write b/bin/agent/mysql_allow_write
+index 9383b69..d33bb7b 100755
+--- a/bin/agent/mysql_allow_write
++++ b/bin/agent/mysql_allow_write
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/mysql_deny_write b/bin/agent/mysql_deny_write
+index d9692d2..ad73cf0 100755
+--- a/bin/agent/mysql_deny_write
++++ b/bin/agent/mysql_deny_write
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/mysql_may_write b/bin/agent/mysql_may_write
+index 417742b..e3f9043 100755
+--- a/bin/agent/mysql_may_write
++++ b/bin/agent/mysql_may_write
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/set_active_master b/bin/agent/set_active_master
+index 9cd306e..df985d1 100755
+--- a/bin/agent/set_active_master
++++ b/bin/agent/set_active_master
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/sync_with_master b/bin/agent/sync_with_master
+index cc52712..06ebb5f 100755
+--- a/bin/agent/sync_with_master
++++ b/bin/agent/sync_with_master
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/turn_off_slave b/bin/agent/turn_off_slave
+index 0a468d3..b7b4214 100755
+--- a/bin/agent/turn_off_slave
++++ b/bin/agent/turn_off_slave
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/agent/turn_on_slave b/bin/agent/turn_on_slave
+index d6ac262..3b2fb47 100755
+--- a/bin/agent/turn_on_slave
++++ b/bin/agent/turn_on_slave
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Agent::Helpers::Actions;
+
+diff --git a/bin/monitor/checker b/bin/monitor/checker
+index 345abf6..e7e30d7 100755
+--- a/bin/monitor/checker
++++ b/bin/monitor/checker
+@@ -3,6 +3,7 @@
+ # Use mandatory external modules
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( OUTPUT_AUTOFLUSH );
+ use Log::Log4perl qw(:easy);
+
+diff --git a/bin/tools/create_snapshot b/bin/tools/create_snapshot
+index 7538789..fe19ebd 100755
+--- a/bin/tools/create_snapshot
++++ b/bin/tools/create_snapshot
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use DBI;
+ use MMM::Common::Config;
+ use MMM::Tools::Snapshot::LVM;
+diff --git a/bin/tools/remove_snapshot b/bin/tools/remove_snapshot
+index 59f8d91..db24c3e 100755
+--- a/bin/tools/remove_snapshot
++++ b/bin/tools/remove_snapshot
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Config;
+ use MMM::Tools::Snapshot::LVM;
+
+diff --git a/lib/Agent/Agent.pm b/lib/Agent/Agent.pm
+index c98f39a..31fa22c 100644
+--- a/lib/Agent/Agent.pm
++++ b/lib/Agent/Agent.pm
+@@ -2,6 +2,7 @@ package MMM::Agent::Agent;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw(EVAL_ERROR);
+ use Algorithm::Diff;
+ use DBI;
+diff --git a/lib/Agent/Helpers.pm b/lib/Agent/Helpers.pm
+index c0155e4..33f3b91 100644
+--- a/lib/Agent/Helpers.pm
++++ b/lib/Agent/Helpers.pm
+@@ -2,6 +2,7 @@ package MMM::Agent::Helpers;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+
+ our $VERSION = '0.01';
+diff --git a/lib/Agent/Helpers/Actions.pm b/lib/Agent/Helpers/Actions.pm
+index c39b674..33e2102 100644
+--- a/lib/Agent/Helpers/Actions.pm
++++ b/lib/Agent/Helpers/Actions.pm
+@@ -2,6 +2,7 @@ package MMM::Agent::Helpers::Actions;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Agent::Helpers::Network;
+
+ our $VERSION = '0.01';
+diff --git a/lib/Agent/Helpers/Network.pm b/lib/Agent/Helpers/Network.pm
+index b0d5a8b..38619bf 100644
+--- a/lib/Agent/Helpers/Network.pm
++++ b/lib/Agent/Helpers/Network.pm
+@@ -2,6 +2,7 @@ package MMM::Agent::Helpers::Network;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( OSNAME );
+
+ our $VERSION = '0.01';
+diff --git a/lib/Agent/Role.pm b/lib/Agent/Role.pm
+index b9723c2..a4e69cd 100644
+--- a/lib/Agent/Role.pm
++++ b/lib/Agent/Role.pm
+@@ -3,6 +3,7 @@ use base 'MMM::Common::Role';
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use MMM::Agent::Helpers;
+
+diff --git a/lib/Common/Angel.pm b/lib/Common/Angel.pm
+index 7ad7e88..ac49309 100644
+--- a/lib/Common/Angel.pm
++++ b/lib/Common/Angel.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Angel;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( CHILD_ERROR ERRNO );
+ use Log::Log4perl qw(:easy);
+ use Errno qw( EINTR );
+diff --git a/lib/Common/Config.pm b/lib/Common/Config.pm
+index 6c0af28..948a728 100644
+--- a/lib/Common/Config.pm
++++ b/lib/Common/Config.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Config;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( NR );
+ use Log::Log4perl qw(:easy);
+
+diff --git a/lib/Common/Log.pm b/lib/Common/Log.pm
+index ae3910b..3b527e5 100644
+--- a/lib/Common/Log.pm
++++ b/lib/Common/Log.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Log;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use English qw( PROGRAM_NAME );
+
+diff --git a/lib/Common/PidFile.pm b/lib/Common/PidFile.pm
+index 2de55eb..70b39b6 100644
+--- a/lib/Common/PidFile.pm
++++ b/lib/Common/PidFile.pm
+@@ -2,6 +2,7 @@ package MMM::Common::PidFile;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROCESS_ID );
+ use Log::Log4perl qw(:easy);
+
+diff --git a/lib/Common/Role.pm b/lib/Common/Role.pm
+index 211ab5f..4f48172 100644
+--- a/lib/Common/Role.pm
++++ b/lib/Common/Role.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Role;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+
+ our $VERSION = '0.01';
+
+diff --git a/lib/Common/Socket.pm b/lib/Common/Socket.pm
+index 38e1f7b..a072ca9 100644
+--- a/lib/Common/Socket.pm
++++ b/lib/Common/Socket.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Socket;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use IO::Socket::INET;
+
+diff --git a/lib/Common/Uptime.pm b/lib/Common/Uptime.pm
+index 4b7c71c..c8e0c55 100644
+--- a/lib/Common/Uptime.pm
++++ b/lib/Common/Uptime.pm
+@@ -2,6 +2,7 @@ package MMM::Common::Uptime;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( OSNAME );
+ use Log::Log4perl qw(:easy);
+
+diff --git a/lib/Monitor/Agent.pm b/lib/Monitor/Agent.pm
+index a72c98c..f12a93a 100644
+--- a/lib/Monitor/Agent.pm
++++ b/lib/Monitor/Agent.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Agent;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use MMM::Common::Socket;
+ use MMM::Monitor::ChecksStatus;
+diff --git a/lib/Monitor/Agents.pm b/lib/Monitor/Agents.pm
+index d1ba80a..12f3f99 100644
+--- a/lib/Monitor/Agents.pm
++++ b/lib/Monitor/Agents.pm
+@@ -3,6 +3,7 @@ use base 'Class::Singleton';
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use IO::Handle;
+ use File::Temp;
+diff --git a/lib/Monitor/CheckResult.pm b/lib/Monitor/CheckResult.pm
+index cde4184..ec42a02 100644
+--- a/lib/Monitor/CheckResult.pm
++++ b/lib/Monitor/CheckResult.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::CheckResult;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use threads;
+ use threads::shared;
+diff --git a/lib/Monitor/Checker.pm b/lib/Monitor/Checker.pm
+index a4f2ea7..1a5fe52 100644
+--- a/lib/Monitor/Checker.pm
++++ b/lib/Monitor/Checker.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Checker;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use IPC::Open2;
+ use MMM::Monitor::CheckResult;
+diff --git a/lib/Monitor/Checker/Checks.pm b/lib/Monitor/Checker/Checks.pm
+index 6e200b6..2eeeae3 100644
+--- a/lib/Monitor/Checker/Checks.pm
++++ b/lib/Monitor/Checker/Checks.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Checker::Checks;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw(OSNAME EFFECTIVE_USER_ID);
+ use DBI;
+ use Net::Ping;
+diff --git a/lib/Monitor/ChecksStatus.pm b/lib/Monitor/ChecksStatus.pm
+index a68e159..6b1a9ca 100644
+--- a/lib/Monitor/ChecksStatus.pm
++++ b/lib/Monitor/ChecksStatus.pm
+@@ -3,6 +3,7 @@ use base 'Class::Singleton';
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use MMM::Monitor::Checker
+
+diff --git a/lib/Monitor/Commands.pm b/lib/Monitor/Commands.pm
+index 9503c8d..972fdac 100644
+--- a/lib/Monitor/Commands.pm
++++ b/lib/Monitor/Commands.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Commands;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use List::Util qw(max);
+ use threads;
+diff --git a/lib/Monitor/Monitor.pm b/lib/Monitor/Monitor.pm
+index 7cf7dbf..f96503b 100644
+--- a/lib/Monitor/Monitor.pm
++++ b/lib/Monitor/Monitor.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Monitor;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use threads;
+ use threads::shared;
+ use Algorithm::Diff;
+diff --git a/lib/Monitor/NetworkChecker.pm b/lib/Monitor/NetworkChecker.pm
+index 8529d11..1a6d2e2 100644
+--- a/lib/Monitor/NetworkChecker.pm
++++ b/lib/Monitor/NetworkChecker.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::NetworkChecker;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use MMM::Monitor::Checker;
+
+diff --git a/lib/Monitor/Role.pm b/lib/Monitor/Role.pm
+index ec1ce46..725cce3 100644
+--- a/lib/Monitor/Role.pm
++++ b/lib/Monitor/Role.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::Role;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use MMM::Common::Role;
+
+ our $VERSION = '0.01';
+diff --git a/lib/Monitor/Roles.pm b/lib/Monitor/Roles.pm
+index c5fcda8..68b3d44 100644
+--- a/lib/Monitor/Roles.pm
++++ b/lib/Monitor/Roles.pm
+@@ -3,6 +3,7 @@ use base 'Class::Singleton';
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+ use MMM::Monitor::Agents;
+ use MMM::Monitor::Role;
+diff --git a/lib/Monitor/StartupStatus.pm b/lib/Monitor/StartupStatus.pm
+index b4ab43e..0051a03 100644
+--- a/lib/Monitor/StartupStatus.pm
++++ b/lib/Monitor/StartupStatus.pm
+@@ -2,6 +2,7 @@ package MMM::Monitor::StartupStatus;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use List::Util qw(max);
+ use Log::Log4perl qw(:easy);
+ use MMM::Common::Role;
+diff --git a/lib/Tools/MySQL.pm b/lib/Tools/MySQL.pm
+index 505c162..4c2e81a 100644
+--- a/lib/Tools/MySQL.pm
++++ b/lib/Tools/MySQL.pm
+@@ -2,6 +2,7 @@ package MMM::Tools::MySQL;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use DBI;
+ use Log::Log4perl qw(:easy);
+
+diff --git a/lib/Tools/Snapshot/LVM.pm b/lib/Tools/Snapshot/LVM.pm
+index 8cad596..e9408e2 100644
+--- a/lib/Tools/Snapshot/LVM.pm
++++ b/lib/Tools/Snapshot/LVM.pm
+@@ -2,6 +2,7 @@ package MMM::Tools::Snapshot::LVM;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Log::Log4perl qw(:easy);
+
+
+diff --git a/lib/Tools/Snapshot/MySQL.pm b/lib/Tools/Snapshot/MySQL.pm
+index 85300c0..510b916 100644
+--- a/lib/Tools/Snapshot/MySQL.pm
++++ b/lib/Tools/Snapshot/MySQL.pm
+@@ -2,6 +2,7 @@ package MMM::Tools::Snapshot::MySQL;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use Data::Dumper;
+ use DBI;
+ use Log::Log4perl qw(:easy);
+diff --git a/lib/Tools/Tools.pm b/lib/Tools/Tools.pm
+index 5820cb9..b7f350c 100644
+--- a/lib/Tools/Tools.pm
++++ b/lib/Tools/Tools.pm
+@@ -2,6 +2,7 @@ package MMM::Tools::Tools;
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw(FORMAT_NAME);
+ use Path::Class qw(dir);
+ use Log::Log4perl qw(:easy);
+diff --git a/sbin/mmm_agentd b/sbin/mmm_agentd
+index 343f5c1..af6a6b9 100755
+--- a/sbin/mmm_agentd
++++ b/sbin/mmm_agentd
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROGRAM_NAME );
+ use File::Basename;
+ use Proc::Daemon;
+diff --git a/sbin/mmm_backup b/sbin/mmm_backup
+index fc7ae50..a105648 100755
+--- a/sbin/mmm_backup
++++ b/sbin/mmm_backup
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROGRAM_NAME );
+ use File::Basename;
+ use Log::Log4perl qw(:easy);
+diff --git a/sbin/mmm_clone b/sbin/mmm_clone
+index 5217314..73c1ea8 100755
+--- a/sbin/mmm_clone
++++ b/sbin/mmm_clone
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROGRAM_NAME );
+ use File::Basename;
+ use Log::Log4perl qw(:easy);
+diff --git a/sbin/mmm_control b/sbin/mmm_control
+index 597b9a1..95a2264 100755
+--- a/sbin/mmm_control
++++ b/sbin/mmm_control
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROGRAM_NAME );
+ use File::Basename;
+ use Log::Log4perl qw(:easy);
+diff --git a/sbin/mmm_mond b/sbin/mmm_mond
+index 6f9643b..9ed50c2 100755
+--- a/sbin/mmm_mond
++++ b/sbin/mmm_mond
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use threads;
+ use threads::shared;
+ use Config;
+diff --git a/sbin/mmm_restore b/sbin/mmm_restore
+index 6dc9248..d80adaf 100755
+--- a/sbin/mmm_restore
++++ b/sbin/mmm_restore
+@@ -2,6 +2,7 @@
+
+ use strict;
+ use warnings FATAL => 'all';
++no warnings 'uninitialized';
+ use English qw( PROGRAM_NAME FORMAT_NAME );
+ use File::Basename;
+ use Log::Log4perl qw(:easy);
diff --git a/mysql-mmm.logrotate b/mysql-mmm.logrotate
new file mode 100644
index 0000000..4dc9967
--- /dev/null
+++ b/mysql-mmm.logrotate
@@ -0,0 +1,9 @@
+/var/log/mysql-mmm/*.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ delaycompress
+ notifempty
+ create 640 root adm
+}
diff --git a/mysql-mmm.spec b/mysql-mmm.spec
new file mode 100644
index 0000000..46230de
--- /dev/null
+++ b/mysql-mmm.spec
@@ -0,0 +1,435 @@
+%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
+
+Name: mysql-mmm
+Version: 2.2.1
+Release: 40%{?dist}
+Summary: Multi-Master Replication Manager for MySQL
+# Automatically converted from old format: GPLv2 - review is highly recommended.
+License: GPL-2.0-only
+URL: http://mysql-mmm.org
+Source: http://mysql-mmm.org/_media/:mmm2:/%{name}-%{version}.tar.gz
+Source1: mysql-mmm.logrotate
+Source2: http://mysql-mmm.org/_media/:mmm2:/%{name}-%{version}.pdf
+Source3: mmm_mon_log.conf
+Source4: mmm_agent.conf
+Source5: mmm_mon.conf
+Source6: mmm_tools.conf
+Source7: mmm_common.conf
+Source8: mysql-mmm-agent.service
+Source9: mysql-mmm-monitor.service
+
+BuildArch: noarch
+BuildRequires: make
+BuildRequires: perl-generators
+BuildRequires: systemd
+
+Provides: mmm = %{version}-%{release}
+Provides: mysql-master-master = %{version}-%{release}
+
+Patch0: mysql-mmm-2.1.0-paths.patch
+Patch1: mysql-mmm-fix-bug-with-newer-net-arp.patch
+Patch2: mysql-mmm-fix-cve-remote-command-injection.patch
+Patch3: mysql-mmm-add-notify-cmd.patch
+Patch4: mysql-mmm-suppress-uninitialized-warning.patch
+
+%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. In addition to that, it also has scripts for data backups,
+resynchronization between nodes etc.
+
+%package agent
+Summary: MMM Database Server Agent Daemon and Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: iproute
+Requires: perl-DBD-mysql
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+Provides: mysql-master-master-agent = %{version}-%{release}
+Provides: mmm-agent = %{version}-%{release}
+
+%description agent
+Agent daemon and libraries which run on each MySQL server and provides the
+monitoring node with a simple set of remote services.
+
+%package monitor
+Summary: MMM Monitor Server Daemon and Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: perl(Class::Singleton), perl(DBD::mysql), perl(Time::HiRes)
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+Provides: mysql-master-master-monitor = %{version}-%{release}
+Provides: mmm-monitor = %{version}-%{release}
+
+%description monitor
+Monitoring daemon and libraries that do all monitoring work and make all
+decisions about roles moving and so on.
+
+%package tools
+Summary: MMM Control Scripts and Libraries
+Requires: %{name} = %{version}-%{release}
+Provides: mysql-master-master-tools = %{version}-%{release}
+Provides: mmm-tools = %{version}-%{release}
+
+%description tools
+Scripts and libraries dedicated to management of the mmm_mond processes
+by commands.
+
+%prep
+%setup -q
+cp -a %{SOURCE2} .
+
+# currently the README included with mysql-mmm is zero-length
+cat >>README < - 2.2.1-40
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
+
+* Sat Apr 05 2025 avid Beveridge 2.2.1-39
+- add feature notify_cmd
+- suppress fatal escalation of uninitialized variables warning
+- modify systemd unit files to refer to /usr/bin instead of /usr/sbin
+
+* Wed Mar 26 2025 David Beveridge 2.2.1-38
+- Unify bin and sbin
+
+* Sun Feb 02 2025 David Beveridge 2.2.1-37
+- fix patchN deprecated
+
+* Fri Jan 17 2025 Fedora Release Engineering - 2.2.1-36
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
+
+* Mon Jul 29 2024 Miroslav Suchý - 2.2.1-35
+- convert license to SPDX
+
+* Thu Jul 18 2024 Fedora Release Engineering - 2.2.1-34
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
+
+* Thu Jan 25 2024 Fedora Release Engineering - 2.2.1-33
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Sun Jan 21 2024 Fedora Release Engineering - 2.2.1-32
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Thu Jul 20 2023 Fedora Release Engineering - 2.2.1-31
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
+
+* Thu Jan 19 2023 Fedora Release Engineering - 2.2.1-30
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
+
+* Fri Jul 22 2022 Fedora Release Engineering - 2.2.1-29
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
+
+* Thu Jan 20 2022 Fedora Release Engineering - 2.2.1-28
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
+
+* Thu Jul 22 2021 Fedora Release Engineering - 2.2.1-27
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
+
+* Tue Jan 26 2021 Fedora Release Engineering - 2.2.1-26
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
+
+* Tue Jul 28 2020 Fedora Release Engineering - 2.2.1-25
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Wed Jan 29 2020 Fedora Release Engineering - 2.2.1-24
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
+
+* Thu Jul 25 2019 Fedora Release Engineering - 2.2.1-23
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* Fri Feb 01 2019 Fedora Release Engineering - 2.2.1-22
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Fri Jul 13 2018 Fedora Release Engineering - 2.2.1-21
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Wed May 02 2018 David Beveridge 2.2.1-20
+- Patch for mmm_agentd Remote Command Injection Vulnerabilities
+- TALOS-2017-0501, CVE-2017-14474 - CVE-2017-14481
+
+* Thu Feb 08 2018 Fedora Release Engineering - 2.2.1-19
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Wed Dec 20 2017 Ruben Kerkhof - 2.2.1-18
+- Correct permissions for systemd units (#1527992)
+
+* Wed Jul 26 2017 Fedora Release Engineering - 2.2.1-17
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Fri Feb 10 2017 Fedora Release Engineering - 2.2.1-16
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Thu Feb 04 2016 Fedora Release Engineering - 2.2.1-15
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Thu Dec 10 2015 Ruben Kerkhof 2.2.1-14
+- Fix bug with newer Net::ARP version numbers (#1169914)
+
+* Wed Jun 17 2015 Fedora Release Engineering - 2.2.1-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Sat Jun 07 2014 Fedora Release Engineering - 2.2.1-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Sun Sep 15 2013 Ruben Kerkhof 2.2.1-11
+- Convert to systemd (#913501)
+
+* Sun Sep 15 2013 Ruben Kerkhof 2.2.1-10
+- Monitor needs perl-Time-HiRes (#915665)
+
+* Sat Aug 03 2013 Petr Pisar - 2.2.1-9
+- Perl 5.18 rebuild
+
+* Fri Jul 26 2013 Ville Skyttä - 2.2.1-8
+- Honor %%{_pkgdocdir} where available.
+- Don't ship patch backup files.
+
+* Wed Jul 17 2013 Petr Pisar - 2.2.1-7
+- Perl 5.18 rebuild
+
+* Thu Feb 14 2013 Fedora Release Engineering - 2.2.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Fri Jul 20 2012 Fedora Release Engineering - 2.2.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Fri Jan 13 2012 Fedora Release Engineering - 2.2.1-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Tue Feb 08 2011 Fedora Release Engineering - 2.2.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Tue Nov 23 2010 BJ Dierkes - 2.2.1-2
+- Updated agent/monitor init scripts to create /var/run/mysql-mmm
+ if it does not exist. Resolves BZ#656634
+- List /var/run, /var/lock/subsys files as %%ghost entries
+
+* Tue May 11 2010 BJ Dierkes - 2.2.1-1
+- Latest upstream release, fixes possible errors related to
+ replication. Full ChangeLog available at:
+ http://mysql-mmm.org/mmm2:changelog
+
+* Wed Mar 10 2010 BJ Dierkes - 2.2.0-1
+- Latest upstream release. Resolves LaunchPad Issues 416572, 422549,
+ 531011, 531841, 525719. Full ChangeLog available at:
+ http://mysql-mmm.org/mmm2:changelog
+
+* Mon Mar 08 2010 BJ Dierkes - 2.1.1-1
+- Latest upstream release, resolves DBI timeout issue. Full changelog
+ available at: http://mysql-mmm.org/mmm2:changelog
+- Removing Patch4: mysql-mmm-2.0.10-default_logging.patch (applied upstream)
+
+* Fri Feb 26 2010 BJ Dierkes - 2.1.0-4
+- Agent Requires: perl-DBD-mysql. Resolves BZ #568870
+
+* Thu Feb 25 2010 BJ Dierkes - 2.1.0-3
+- Fixed init scripts to check for ENABLED only within the start
+ function.
+
+* Tue Feb 23 2010 BJ Dierkes - 2.1.0-2
+- Added defaults file for mysql-mmm-agent and mysql-mmm-monitor
+ Resolves BZ #567753
+- Init scripts exit if ENABLED != 1
+- Fixed typo in mysql-mmm-monitor where mmmd_mon was still referenced
+
+* Mon Feb 22 2010 BJ Dierkes - 2.1.0-1.1
+- Latest sources from upstream
+- Updated init scripts to reflect new binary paths
+ (i.e. mmmd_agent -> mmm_agentd)
+- Updated Patch0: mysql-mmm-2.1.0-paths.patch
+- Removed Patch1: mysql-mmm-2.0.9-configs.patch (added source
+ config files)
+
+* Wed Feb 17 2010 BJ Dierkes - 2.0.11-2
+- Rebuild for F13/devel retag
+
+* Mon Feb 08 2010 BJ Dierkes - 2.0.11-1
+- Latest sources from upstream
+- Removed Patch3: mysql-mmm-2.0.10-lp473446.patch (appied upstream)
+- Added default mmm_mon_log.conf to allow logger modification
+
+* Fri Dec 04 2009 BJ Dierkes - 2.0.10-4
+- Add auto_set_online to 60 in mmm_mon.conf
+- Provides full version-release for all subpackages
+- Append doc location to pdf documentation in README
+- Use subsys/lockfile in init scripts
+
+* Thu Nov 19 2009 BJ Dierkes - 2.0.10-3
+- BuildArch: noarch
+- Monitor subpackage Requires: perl(DBD::mysql)
+- Provides full version-release for mmm, mysql-master-master
+- Removed redundant /var/run/mysql-mmm entry
+- Use _localstatedir macro for /var/log/mysql-mmm file listing
+- Fixed logic in post and postun scripts to properly handle
+ install/upgrade conditions.
+- Post scripts now perform condrestart
+- Added Source3: mysql-mmm-agent.init
+- Added Source4: mysql-mmm-monitor.init
+
+* Tue Nov 17 2009 BJ Dierkes - 2.0.10-2
+- Removed Patch2: mysql-mmm-2.0.10-sleep.patch (obsoleted by Patch3)
+- Added Patch3: mysql-mmm-2.0.10-lp473446.patch
+- Added Patch4: mysql-mmm-2.0.10-default_logging.patch
+
+* Tue Nov 03 2009 BJ Dierkes - 2.0.10-1
+- Latest sources from upstream.
+- Added Patch1: mysql-mmm-2.0.9-configs.patch
+- Added Patch2: mysql-mmm-2.0.10-sleep.patch
+- Moved mmm_control under monitor package
+
+* Mon Oct 19 2009 BJ Dierkes - 2.0.9-1
+- Starting mostly from scratch with 2.0 branch
+- Added Patch0: mysql-mmm-2.0.9-patchs.patch
+
+* Tue Oct 13 2009 BJ Dierkes - 1.2.6-4
+- Cleaning up rpmlint errors
+- No longer require perl-DBD-MySQL
+
+* Tue Sep 29 2009 BJ Dierkes - 1.2.6-3.3
+- Removing .rs tag (Packaging for Fedora/Epel).
+
+* Mon Sep 28 2009 BJ Dierkes - 1.2.6-3.2.rs
+- Change subpackage -control to -tools
+- No longer build or include send_arp, removing requirement of
+ libnet
+- Keep etc config files actually in /etc, symlink at _mmm_instdir/etc
+
+* Wed Sep 23 2009 BJ Dierkes - 1.2.6-3.rs
+- Cleaned up spec a bit further, moved sed changes to patches
+- Added Patch1: mysql-master-master-1.2.6-libnet_1.1.patch
+- Added Patch2: mysql-master-master-1.2.6-paths.patch
+- Explicitly require libnet >= 1.1
+- Added subpackages to break up agent, monitor, and control (backup/restore)
+
+* Mon Sep 21 2009 Andrew Garner - 1.2.6-2.abg
+- Added patch for http://code.google.com/p/mysql-master-master/issues/detail?id=35
+
+* Wed Sep 02 2009 Andrew Garner - 1.2.6-1.abg
+- New upstream release
+
+* Thu Jul 09 2009 Andrew Garner
+- Fix release string to drop out incorrect ~rs identifier
+- Updated to release 5.abg
+
+* Thu Apr 16 2009 Andrew Garner
+- Change /etc/init.d/mysql-mmm_{mon,agent} back to mmm_{mon,agent}
+- symlink /etc/mysql-mmm to /usr/lib/mysql-mmm (not the other way around)
+
+* Tue Apr 14 2009 Andrew Garner
+- Cleanup spec
+- Use standard state/log paths
+- Rebuild fping
+- Added dist suffix
+- Changed Release to 4.rs-abg
+
+* Mon Apr 13 2009 Andrew Garner
+- Fix send_arp for RHEL 5.3's libnet
+- Changed /usr/local/mmm to /usr/lib/mysql-mmm/
+- Changed /etc/init.d/mmm_{mon,agent} to mysql-mmm_{mon,agent}
+- Changed Release to 3.rs-abg
+
+* Thu Apr 09 2009 Andrew Garner
+- Updating for Rackspace
+
+* Wed Feb 25 2009 Ryan Lowe
+- Initial build (I owe JayKim)
diff --git a/sources b/sources
index e69de29..9403553 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+180dbb5662fd66291d01913e0fe34842 mysql-mmm-2.2.1.pdf
+f5f8b48bdf89251d3183328f0249461e mysql-mmm-2.2.1.tar.gz