From 438ed0408c69faa9e5c4c026e24ef52eac62f08e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jan 2012 12:55:12 +0100 Subject: [PATCH] .deb packaging fixes: make mariadb-common a real package, which depends on mysql-common and places mariadb-specific stuff in /etc/mysql/conf.d/mariadb.cnf. This should allow to co-exist with default Debian mysql-common package and help resolve dependencies when installing mariadb among multiple available versions of MySQL from different repositories. --- debian/additions/mariadb.cnf | 36 ++++++++++++++++++++++++++++++++++ debian/additions/my.cnf | 38 ------------------------------------ debian/dist/Debian/control | 16 +++++++++++---- debian/dist/Debian/rules | 9 +++++++-- debian/dist/Ubuntu/control | 16 +++++++++++---- debian/dist/Ubuntu/rules | 9 +++++++-- debian/mariadb-common.files | 1 + debian/mariadb-common.postrm | 8 ++++++++ 8 files changed, 83 insertions(+), 50 deletions(-) create mode 100644 debian/additions/mariadb.cnf create mode 100644 debian/mariadb-common.files create mode 100644 debian/mariadb-common.postrm diff --git a/debian/additions/mariadb.cnf b/debian/additions/mariadb.cnf new file mode 100644 index 00000000000..12db9581469 --- /dev/null +++ b/debian/additions/mariadb.cnf @@ -0,0 +1,36 @@ +# MariaDB-specific config file. +# Read by /etc/mysql/my.cnf + +[client] +# Default is Latin1, if you need UTF-8 set this (also in server section) +#default-character-set = utf8 + +[mysqld] +# +# * Character sets +# +# Default is Latin1, if you need UTF-8 set all this (also in client section) +# +#default-character-set = utf8 +#default-collation = utf8_general_ci +#character_set_server = utf8 +#collation_server = utf8_general_ci +# +# * Fine Tuning +# +max_connections = 100 +connect_timeout = 5 +wait_timeout = 600 +sort_buffer_size = 4M +bulk_insert_buffer_size = 16M +tmp_table_size = 32M +max_heap_table_size = 32M +# +# * MyISAM +# +key_buffer_size = 128M +table_cache = 400 +myisam_sort_buffer_size = 512M +concurrent_insert = 2 +read_buffer_size = 2M +read_rnd_buffer_size = 1M diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf index 1a176cc1dc1..ed19dcf5fc9 100644 --- a/debian/additions/my.cnf +++ b/debian/additions/my.cnf @@ -1,19 +1,5 @@ # MariaDB database server configuration file. # -# ================================================================= -# Base configuration courtesy of Open Query (http://openquery.com/) -# For production use, case-specific preparation is still required. -# 2009-10-07 -# -# This is *not* an optimised config, merely a more sane baseline: -# - InnoDB default (e.g., ACID out-of-the-box, same as on Windows) -# - strict mode (for proper input checks, same as on Windows) -# - various other useful settings -# - make use of MariaDB/Percona/OurDelta enhancements/extensions -# -# For tuning assistance, please see http://openquery.com/services -# ================================================================= -# # You can copy this file to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. @@ -32,8 +18,6 @@ [client] port = 3306 socket = /var/run/mysqld/mysqld.sock -# Default is Latin1, if you need UTF-8 set this (also in server section) -#default-character-set = utf8 # Here is entries for some specific programs # The following values assume you have at least 32M ram @@ -58,43 +42,21 @@ lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking # -# * Character sets -# -# Default is Latin1, if you need UTF-8 set all this (also in client section) -# -#default-character-set = utf8 -#default-collation = utf8_general_ci -#character_set_server = utf8 -#collation_server = utf8_general_ci -# # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1 # # * Fine Tuning # -max_connections = 100 -connect_timeout = 5 -wait_timeout = 600 max_allowed_packet = 16M thread_cache_size = 128 -sort_buffer_size = 4M -bulk_insert_buffer_size = 16M -tmp_table_size = 32M -max_heap_table_size = 32M # # * MyISAM # # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched. On error, make copy and try a repair. myisam_recover = BACKUP -key_buffer_size = 128M #open-files-limit = 2000 -table_cache = 400 -myisam_sort_buffer_size = 512M -concurrent_insert = 2 -read_buffer_size = 2M -read_rnd_buffer_size = 1M # # * Query Cache Configuration # diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 7de203fd3f0..562459618ec 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -71,7 +71,6 @@ Package: mysql-common Section: database Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} -Provides: mariadb-common Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -80,10 +79,19 @@ Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) . This package includes files needed by all versions of the client library (e.g. /etc/mysql/my.cnf). + +Package: mariadb-common +Section: database +Architecture: all +Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends} +Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf) + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. . - Due to libmysqlclient15off package depends, this package has not yet been - renamed to mariadb-common. It does, however, already contain a new my.cnf - file with mariadb-specific configuration options. + This package includes files needed by all versions of the client library + (e.g. /etc/mysql/conf.d/mariadb.cnf). Package: mariadb-client-core-5.5 Architecture: any diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules index 06b5b108e10..3c060c99c88 100755 --- a/debian/dist/Debian/rules +++ b/debian/dist/Debian/rules @@ -172,11 +172,16 @@ install: build mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ - # mysql-common: We now provide our own config file. - # can't be mariadb-common, other packages insist + # mysql-common: We provide our own version of this package for + # completeness, but we can use an existing version; mariadb-specic + # stuff is in mariadb-common install -d $(TMP)/etc/mysql install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf + # mariadb-common: MariaDB-specific config stuff. + install -d $(TMP)/etc/mysql/conf.d + install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf + # mariadb-client install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/ install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index fd72e8d4fb2..8594ee9616b 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -71,7 +71,6 @@ Package: mysql-common Section: database Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} -Provides: mariadb-common Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -80,10 +79,19 @@ Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) . This package includes files needed by all versions of the client library (e.g. /etc/mysql/my.cnf). + +Package: mariadb-common +Section: database +Architecture: all +Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends} +Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf) + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. . - Due to libmysqlclient15off package depends, this package has not yet been - renamed to mariadb-common. It does, however, already contain a new my.cnf - file with mariadb-specific configuration options. + This package includes files needed by all versions of the client library + (e.g. /etc/mysql/conf.d/mariadb.cnf). Package: mariadb-client-core-5.5 Architecture: any diff --git a/debian/dist/Ubuntu/rules b/debian/dist/Ubuntu/rules index 2446566fd3f..f0ece68641d 100755 --- a/debian/dist/Ubuntu/rules +++ b/debian/dist/Ubuntu/rules @@ -172,11 +172,16 @@ install: build mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ - # mysql-common: We now provide our own config file. - # can't be mariadb-common, other packages insist + # mysql-common: We provide our own version of this package for + # completeness, but we can use an existing version; mariadb-specic + # stuff is in mariadb-common install -d $(TMP)/etc/mysql install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf + # mariadb-common: MariaDB-specific config stuff. + install -d $(TMP)/etc/mysql/conf.d + install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf + # mariadb-client install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/ install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ diff --git a/debian/mariadb-common.files b/debian/mariadb-common.files new file mode 100644 index 00000000000..f37e46c45fe --- /dev/null +++ b/debian/mariadb-common.files @@ -0,0 +1 @@ +etc/mysql/conf.d/mariadb.cnf diff --git a/debian/mariadb-common.postrm b/debian/mariadb-common.postrm new file mode 100644 index 00000000000..027592f816e --- /dev/null +++ b/debian/mariadb-common.postrm @@ -0,0 +1,8 @@ +#!/bin/bash -e + +if [ "$1" = "purge" ]; then + rmdir /etc/mysql/conf.d 2>/dev/null || true + rmdir /etc/mysql 2>/dev/null || true +fi + +#DEBHELPER#