From 52a1683f7552947bd059bf1a42d08f08af794961 Mon Sep 17 00:00:00 2001 From: Norikatsu Shigemura Date: Wed, 5 Feb 2003 15:34:09 +0000 Subject: o Definitely fix building on -current. o Really overwrite databases when OVERWRITE_DB is set. o Automatically skip installing databases if they already exist (unless OVERWRITE_DB is set). PR: ports/47945 Submitted by: Alex Dupre (maintainer) --- databases/mysql40-server/Makefile | 27 ++++------------------ .../mysql40-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql41-server/Makefile | 27 ++++------------------ .../mysql41-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql50-server/Makefile | 27 ++++------------------ .../mysql50-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql51-server/Makefile | 27 ++++------------------ .../mysql51-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql54-server/Makefile | 27 ++++------------------ .../mysql54-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql55-server/Makefile | 27 ++++------------------ .../mysql55-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/mysql60-server/Makefile | 27 ++++------------------ .../mysql60-server/files/patch-sql::mysqld.cc | 12 ++++++++++ databases/percona55-server/Makefile | 27 ++++------------------ .../percona55-server/files/patch-sql::mysqld.cc | 12 ++++++++++ 16 files changed, 136 insertions(+), 176 deletions(-) create mode 100644 databases/mysql40-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql41-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql50-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql51-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql54-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql55-server/files/patch-sql::mysqld.cc create mode 100644 databases/mysql60-server/files/patch-sql::mysqld.cc create mode 100644 databases/percona55-server/files/patch-sql::mysqld.cc diff --git a/databases/mysql40-server/Makefile b/databases/mysql40-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql40-server/Makefile +++ b/databases/mysql40-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql40-server/files/patch-sql::mysqld.cc b/databases/mysql40-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql40-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql41-server/Makefile b/databases/mysql41-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql41-server/Makefile +++ b/databases/mysql41-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql41-server/files/patch-sql::mysqld.cc b/databases/mysql41-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql41-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql50-server/Makefile b/databases/mysql50-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql50-server/Makefile +++ b/databases/mysql50-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql50-server/files/patch-sql::mysqld.cc b/databases/mysql50-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql50-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql51-server/Makefile b/databases/mysql51-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql51-server/Makefile +++ b/databases/mysql51-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql51-server/files/patch-sql::mysqld.cc b/databases/mysql51-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql51-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql54-server/Makefile b/databases/mysql54-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql54-server/Makefile +++ b/databases/mysql54-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql54-server/files/patch-sql::mysqld.cc b/databases/mysql54-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql54-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql55-server/Makefile b/databases/mysql55-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql55-server/Makefile +++ b/databases/mysql55-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql55-server/files/patch-sql::mysqld.cc b/databases/mysql55-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql55-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/mysql60-server/Makefile b/databases/mysql60-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/mysql60-server/Makefile +++ b/databases/mysql60-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/mysql60-server/files/patch-sql::mysqld.cc b/databases/mysql60-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/mysql60-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) diff --git a/databases/percona55-server/Makefile b/databases/percona55-server/Makefile index 783868f9fbdf..2d9589d95207 100644 --- a/databases/percona55-server/Makefile +++ b/databases/percona55-server/Makefile @@ -39,7 +39,6 @@ CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-bench \ --without-extra-tools \ --with-libwrap \ - --with-raid \ --with-mysqlfs \ --with-vio \ --with-low-memory \ @@ -102,8 +101,7 @@ pre-fetch: @${ECHO} " WITH_OPENSSL=yes Enable secure connections." @${ECHO} " DB_DIR=directory Set alternate directory for database files" @${ECHO} " (default is /var/db/mysql)." - @${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization" - @${ECHO} " (useful for upgrades)." + @${ECHO} " OVERWRITE_DB=yes Re-initialize default databases" @${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional" @${ECHO} " DNS check before inserting local hostname to" @${ECHO} " mysql database" @@ -118,27 +116,12 @@ pre-configure: @${FALSE} .endif -.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB) -pre-install: - @${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}." - @${ECHO} "" - @${ECHO} "In order to preserve your existing data, you should:" - @${ECHO} " - dump all your databases" - @${ECHO} " - kill mysql if it is running" - @${ECHO} " - delete the ${DB_DIR} directory" - @${ECHO} " - run 'make install'" - @${ECHO} " - start up mysql" - @${ECHO} " - re-create all of your database" - @${ECHO} " - re-load your data" - @${ECHO} "" - @${ECHO} "If you understand the consequences of this upgrade, please re-build this" - @${ECHO} "port with the environment variable OVERWRITE_DB defined." - @${FALSE} -.endif - post-install: .if !defined(PACKAGE_BUILDING) -.if !defined(SKIP_INSTALL_DB) +.if exists(${DB_DIR}) && defined(OVERWRITE_DB) + @${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true +.endif +.if !exists(${DB_DIR}) || defined(OVERWRITE_DB) .if defined(SKIP_DNS_CHECK) ${PREFIX}/bin/mysql_install_db --force .else diff --git a/databases/percona55-server/files/patch-sql::mysqld.cc b/databases/percona55-server/files/patch-sql::mysqld.cc new file mode 100644 index 000000000000..1d0288494fb5 --- /dev/null +++ b/databases/percona55-server/files/patch-sql::mysqld.cc @@ -0,0 +1,12 @@ +--- sql/mysqld.cc.orig Wed Feb 5 01:55:03 2003 ++++ sql/mysqld.cc Wed Feb 5 01:57:06 2003 +@@ -104,7 +104,8 @@ + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +-#ifdef __STDC__ ++#include ++#if defined(__STDC__) && __FreeBSD_version < 500000 + #define my_fromhost(A) fromhost(A) + #define my_hosts_access(A) hosts_access(A) + #define my_eval_client(A) eval_client(A) -- cgit v1.2.3