Skip to content

Commit 438ed04

Browse files
committed
.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.
1 parent 6f142ee commit 438ed04

File tree

8 files changed

+83
-50
lines changed

8 files changed

+83
-50
lines changed

debian/additions/mariadb.cnf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# MariaDB-specific config file.
2+
# Read by /etc/mysql/my.cnf
3+
4+
[client]
5+
# Default is Latin1, if you need UTF-8 set this (also in server section)
6+
#default-character-set = utf8
7+
8+
[mysqld]
9+
#
10+
# * Character sets
11+
#
12+
# Default is Latin1, if you need UTF-8 set all this (also in client section)
13+
#
14+
#default-character-set = utf8
15+
#default-collation = utf8_general_ci
16+
#character_set_server = utf8
17+
#collation_server = utf8_general_ci
18+
#
19+
# * Fine Tuning
20+
#
21+
max_connections = 100
22+
connect_timeout = 5
23+
wait_timeout = 600
24+
sort_buffer_size = 4M
25+
bulk_insert_buffer_size = 16M
26+
tmp_table_size = 32M
27+
max_heap_table_size = 32M
28+
#
29+
# * MyISAM
30+
#
31+
key_buffer_size = 128M
32+
table_cache = 400
33+
myisam_sort_buffer_size = 512M
34+
concurrent_insert = 2
35+
read_buffer_size = 2M
36+
read_rnd_buffer_size = 1M

debian/additions/my.cnf

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
# MariaDB database server configuration file.
22
#
3-
# =================================================================
4-
# Base configuration courtesy of Open Query (http://openquery.com/)
5-
# For production use, case-specific preparation is still required.
6-
# 2009-10-07
7-
#
8-
# This is *not* an optimised config, merely a more sane baseline:
9-
# - InnoDB default (e.g., ACID out-of-the-box, same as on Windows)
10-
# - strict mode (for proper input checks, same as on Windows)
11-
# - various other useful settings
12-
# - make use of MariaDB/Percona/OurDelta enhancements/extensions
13-
#
14-
# For tuning assistance, please see http://openquery.com/services
15-
# =================================================================
16-
#
173
# You can copy this file to one of:
184
# - "/etc/mysql/my.cnf" to set global options,
195
# - "~/.my.cnf" to set user-specific options.
@@ -32,8 +18,6 @@
3218
[client]
3319
port = 3306
3420
socket = /var/run/mysqld/mysqld.sock
35-
# Default is Latin1, if you need UTF-8 set this (also in server section)
36-
#default-character-set = utf8
3721

3822
# Here is entries for some specific programs
3923
# The following values assume you have at least 32M ram
@@ -58,43 +42,21 @@ lc_messages_dir = /usr/share/mysql
5842
lc_messages = en_US
5943
skip-external-locking
6044
#
61-
# * Character sets
62-
#
63-
# Default is Latin1, if you need UTF-8 set all this (also in client section)
64-
#
65-
#default-character-set = utf8
66-
#default-collation = utf8_general_ci
67-
#character_set_server = utf8
68-
#collation_server = utf8_general_ci
69-
#
7045
# Instead of skip-networking the default is now to listen only on
7146
# localhost which is more compatible and is not less secure.
7247
bind-address = 127.0.0.1
7348
#
7449
# * Fine Tuning
7550
#
76-
max_connections = 100
77-
connect_timeout = 5
78-
wait_timeout = 600
7951
max_allowed_packet = 16M
8052
thread_cache_size = 128
81-
sort_buffer_size = 4M
82-
bulk_insert_buffer_size = 16M
83-
tmp_table_size = 32M
84-
max_heap_table_size = 32M
8553
#
8654
# * MyISAM
8755
#
8856
# This replaces the startup script and checks MyISAM tables if needed
8957
# the first time they are touched. On error, make copy and try a repair.
9058
myisam_recover = BACKUP
91-
key_buffer_size = 128M
9259
#open-files-limit = 2000
93-
table_cache = 400
94-
myisam_sort_buffer_size = 512M
95-
concurrent_insert = 2
96-
read_buffer_size = 2M
97-
read_rnd_buffer_size = 1M
9860
#
9961
# * Query Cache Configuration
10062
#

debian/dist/Debian/control

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Package: mysql-common
7171
Section: database
7272
Architecture: all
7373
Depends: ${shlibs:Depends}, ${misc:Depends}
74-
Provides: mariadb-common
7574
Description: MariaDB database common files (e.g. /etc/mysql/my.cnf)
7675
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
7776
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)
8079
.
8180
This package includes files needed by all versions of the client library
8281
(e.g. /etc/mysql/my.cnf).
82+
83+
Package: mariadb-common
84+
Section: database
85+
Architecture: all
86+
Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends}
87+
Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
88+
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
89+
server. SQL (Structured Query Language) is the most popular database query
90+
language in the world. The main goals of MariaDB are speed, robustness and
91+
ease of use.
8392
.
84-
Due to libmysqlclient15off package depends, this package has not yet been
85-
renamed to mariadb-common. It does, however, already contain a new my.cnf
86-
file with mariadb-specific configuration options.
93+
This package includes files needed by all versions of the client library
94+
(e.g. /etc/mysql/conf.d/mariadb.cnf).
8795

8896
Package: mariadb-client-core-5.5
8997
Architecture: any

debian/dist/Debian/rules

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,16 @@ install: build
172172
mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/
173173
mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/
174174

175-
# mysql-common: We now provide our own config file.
176-
# can't be mariadb-common, other packages insist
175+
# mysql-common: We provide our own version of this package for
176+
# completeness, but we can use an existing version; mariadb-specic
177+
# stuff is in mariadb-common
177178
install -d $(TMP)/etc/mysql
178179
install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf
179180

181+
# mariadb-common: MariaDB-specific config stuff.
182+
install -d $(TMP)/etc/mysql/conf.d
183+
install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf
184+
180185
# mariadb-client
181186
install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/
182187
install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/

debian/dist/Ubuntu/control

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Package: mysql-common
7171
Section: database
7272
Architecture: all
7373
Depends: ${shlibs:Depends}, ${misc:Depends}
74-
Provides: mariadb-common
7574
Description: MariaDB database common files (e.g. /etc/mysql/my.cnf)
7675
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
7776
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)
8079
.
8180
This package includes files needed by all versions of the client library
8281
(e.g. /etc/mysql/my.cnf).
82+
83+
Package: mariadb-common
84+
Section: database
85+
Architecture: all
86+
Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends}
87+
Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
88+
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
89+
server. SQL (Structured Query Language) is the most popular database query
90+
language in the world. The main goals of MariaDB are speed, robustness and
91+
ease of use.
8392
.
84-
Due to libmysqlclient15off package depends, this package has not yet been
85-
renamed to mariadb-common. It does, however, already contain a new my.cnf
86-
file with mariadb-specific configuration options.
93+
This package includes files needed by all versions of the client library
94+
(e.g. /etc/mysql/conf.d/mariadb.cnf).
8795

8896
Package: mariadb-client-core-5.5
8997
Architecture: any

debian/dist/Ubuntu/rules

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,16 @@ install: build
172172
mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/
173173
mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/
174174

175-
# mysql-common: We now provide our own config file.
176-
# can't be mariadb-common, other packages insist
175+
# mysql-common: We provide our own version of this package for
176+
# completeness, but we can use an existing version; mariadb-specic
177+
# stuff is in mariadb-common
177178
install -d $(TMP)/etc/mysql
178179
install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf
179180

181+
# mariadb-common: MariaDB-specific config stuff.
182+
install -d $(TMP)/etc/mysql/conf.d
183+
install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf
184+
180185
# mariadb-client
181186
install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/
182187
install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/

debian/mariadb-common.files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
etc/mysql/conf.d/mariadb.cnf

debian/mariadb-common.postrm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash -e
2+
3+
if [ "$1" = "purge" ]; then
4+
rmdir /etc/mysql/conf.d 2>/dev/null || true
5+
rmdir /etc/mysql 2>/dev/null || true
6+
fi
7+
8+
#DEBHELPER#

0 commit comments

Comments
 (0)