# This is a MySQL-wsrep package description for ESP package manager # Debian specific part %product wsrep-enabled MySQL server %copyright MySQL AB, Codership Oy, All Rights Reserved %vendor Codership Oy %license COPYING %readme README %description MySQL server + wsrep patch (https://launchpad.net/codership-mysql) $mysql_version=${MYSQL_VER} $wsrep_version=${WSREP_VER} %version ${mysql_version}-${wsrep_version} %requires psmisc %requires debianutils 1.6 %requires libc6 2.4 %requires libdbi-perl %requires libdbd-mysql-perl 1.2202 %requires libgcc1 4.1.1 %requires libncurses5 5.6 %requires libstdc++6 4.1.1 %requires libwrap0 7.6 %requires perl %requires zlib1g 1.1.4 %requires lsof %replaces mysql-server-core 0.0.0 ${mysql_version} %replaces mysql-server-core-5.0 0.0.0 ${mysql_version} %replaces mysql-server-core-5.1 0.0.0 ${mysql_version} %replaces mysql-server 0.0.0 ${mysql_version} %replaces mysql-server-5.0 0.0.0 ${mysql_version} %replaces mysql-server-5.1 0.0.0 ${mysql_version} %provides mysql-server-core %provides mysql-server #%incompat mysql-server-core #%incompat mysql-server-core-4.1 #%incompat mysql-server-core-5.0 #%incompat mysql-server-core-5.1 #%incompat mysql-server #%incompat mysql-server-4.1 #%incompat mysql-server-5.0 #%incompat mysql-server-5.1 $prefix=/usr $CONF_DST=/etc/mysql $LIBS_DST=${prefix}/lib/mysql $PLUGIN_DST=${LIBS_DST}/plugin $SHAR_DST=${prefix}/share/mysql $SBIN_DST=${prefix}/sbin $BINS_DST=${prefix}/bin $DOCS_DST=${prefix}/share/doc/mysql-server-${MYSQL_MAJOR_VER}.${MYSQL_MINOR_VER} $MAN_DST=${prefix}/share/man # Distribution dependent files $SRC=$GALERA_SRC/scripts/mysql/debian $ETC=$SRC/etc d 755 root root /etc/init.d - f 755 root root /etc/init.d/mysql $SRC/mysql d 755 root root /etc/logrotate.d - f 755 root root /etc/logrotate.d/mysql-server $ETC/logrotate.d/mysql-server d 755 root root /etc/logcheck - d 755 root root /etc/logcheck/ignore.d.paranoid - f 644 root root /etc/logcheck/ignore.d.paranoid/mysql-server-${MYSQL_MAJOR_VER}_${MYSQL_MINOR_VER} $ETC/logcheck/ignore.d.paranoid/mysql-server-5_1 d 755 root root /etc/logcheck/ignore.d.server - f 644 root root /etc/logcheck/ignore.d.server/mysql-server-${MYSQL_MAJOR_VER}_${MYSQL_MINOR_VER} $ETC/logcheck/ignore.d.server/mysql-server-5_1 d 755 root root /etc/logcheck/ignore.d.workstation - f 644 root root /etc/logcheck/ignore.d.workstation/mysql-server-${MYSQL_MAJOR_VER}_${MYSQL_MINOR_VER} $ETC/logcheck/ignore.d.workstation/mysql-server-5_1 d 755 root root $CONF_DST f 755 root root $CONF_DST/debian-start $ETC/mysql/debian-start d 755 root root $CONF_DST/conf.d f 644 root root $CONF_DST/conf.d/mysqld_safe_syslog.cnf $ETC/mysql/conf.d/mysqld_safe_syslog.cnf d 755 root root $SHAR_DST - f 755 root root $SHAR_DST/debian-start.inc.sh $SRC/debian-start.inc.sh f 755 root root $SHAR_DST/echo_stderr $SRC/echo_stderr f 755 root root $BINS_DST/my_print_defaults_wsrep $MYSQL_SRC/extra/my_print_defaults ########################## # wsrep-specific files # ########################## c 640 mysql mysql $CONF_DST/conf.d/wsrep.cnf $MYSQL_SRC/support-files/wsrep.cnf f 755 root root $BINS_DST/wsrep_sst_common $MYSQL_SRC/scripts/wsrep_sst_common f 755 root root $BINS_DST/wsrep_sst_mysqldump $MYSQL_SRC/scripts/wsrep_sst_mysqldump f 755 root root $BINS_DST/wsrep_sst_rsync $MYSQL_SRC/scripts/wsrep_sst_rsync l 755 root root $BINS_DST/wsrep_sst_rsync_wan wsrep_sst_rsync #f 755 root root $BINS_DST/wsrep_sst_xtrabackup $MYSQL_SRC/scripts/wsrep_sst_xtrabackup f 644 root root $DOCS_DST/README-wsrep $MYSQL_SRC/Docs/README-wsrep f 644 root root $SHAR_DST/wsrep.cnf $MYSQL_SRC/support-files/wsrep.cnf f 644 root root $SHAR_DST/wsrep_notify $MYSQL_SRC/support-files/wsrep_notify ################################## # Distribution dependent scripts # ################################## $mysql_data=/var/lib/mysql # Add mysql group and user if there are none %preinstall </dev/null || addgroup --system mysql >/dev/null getent passwd mysql >/dev/null || \ adduser --system --disabled-login --ingroup mysql --home ${mysql_data} \ --gecos "MySQL Server" --shell /bin/false mysql >/dev/null [ -e "$BINS_DST/my_print_defaults" ] || \ ( cd $BINS_DST && ln -sf my_print_defaults_wsrep my_print_defaults ) EOF_PREINSTALL %postinstall </dev/null || exit $ ldconfig -n $LIBS_DST #test -d ${mysql_data} || (mysql_install_db --user=mysql --datadir=${mysql_data}) # it seems that we can run mysql_install_db regardless of existing tables. mysql_install_db --wsrep-on=0 --user=mysql --datadir=${mysql_data} --basedir=/usr # This is a fix/workaround for AppArmor profile provided with mysql-server deb [ ! -d /etc/apparmor.d/disable ] || \ ( cd /etc/apparmor.d/disable && ln -sf ../usr.sbin.mysqld ./ ) [ ! -x /etc/init.d/apparmor ] || /etc/init.d/apparmor restart EOF_POSTINSTALL %preremove </dev/null || exit $ [ ! -L $BINS_DST/my_print_defaults ] || rm -rf $BINS_DST/my_print_defaults [ ! -L /etc/apparmor.d/disable/usr.sbin.mysqld ] || rm -rf /etc/apparmor.d/disable/usr.sbin.mysqld [ ! -x /etc/init.d/apparmor ] || /etc/init.d/apparmor restart EOF_PREREMOVE #