mysql: update to 5.5.27 and finally switch to systemd.

This commit is contained in:
Juan RP 2012-08-06 07:21:26 +02:00
parent 50e1b7814a
commit 754e6ade81
25 changed files with 139 additions and 287 deletions

View file

@ -480,9 +480,8 @@ libecpg_compat.so.3 postgresql-libs-8.4.2_1
libecpg.so.6 postgresql-libs-8.4.2_1
libpgtypes.so.3 postgresql-libs-8.4.2_1
libpq.so.5 postgresql-libs-8.4.2_1
libmysqlclient_r.so.16 libmysqlclient-5.1.14_1
libmysqlclient.so.16 libmysqlclient-5.1.14_1
libndbclient.so.16 libndbclient-5.1.14_1
libmysqlclient_r.so.18 libmysqlclient-5.5.27_1
libmysqlclient.so.18 libmysqlclient-5.5.27_1
libgssapi_krb5.so.2 mit-krb5-libs-1.8_1
libgssrpc.so.4 mit-krb5-libs-1.8_1
libk5crypto.so.3 mit-krb5-libs-1.8_1

View file

@ -1 +0,0 @@
mysql

View file

@ -1 +0,0 @@
mysql

View file

@ -1 +0,0 @@
mysql

View file

@ -1 +0,0 @@
mysql

View file

@ -2,32 +2,7 @@
#
case ${ACTION} in
post)
cat << _EOF
==========================================================================
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER
To do so, start the server with:
$ /etc/init.d/mysqld start
and then issue the following commands:
$ mysqladmin -u root password 'new-password'
$ mysqladmin -u root -h $hostname password 'new-password'
Alternatively you can run:
$ mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
Don't forget that you should also tweak /etc/mysql/my.cnf
for server settings. Additional configuration files are available
in the /usr/share/mysql/my-*.cnf files.
==========================================================================
_EOF
usr/bin/mysql_install_db --user=mysql --basedir=/usr
chown -R mysql:mysql var/lib/mysql
;;
esac

View file

@ -1,13 +1,14 @@
# Example MySQL config file for large systems.
# MySQL config file for medium systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var) or
# ~/.my.cnf to set user-specific options.
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@ -17,26 +18,24 @@
[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysqld.sock
socket = /run/mysqld/mysqld.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
skip-locking
key_buffer_size = 256M
socket = /run/mysqld/mysqld.sock
datadir = /var/lib/mysql
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
@ -44,7 +43,7 @@ thread_concurrency = 8
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
skip-networking
# Replication Master Server (default)
# binary logging is required for replication
@ -113,20 +112,16 @@ server-id = 1
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/
#innodb_log_group_home_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
#innodb_additional_mem_pool_size = 20M
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
@ -141,8 +136,8 @@ no-auto-rehash
#safe-updates
[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

View file

@ -0,0 +1,7 @@
#!/bin/sh
while true; do
response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break
echo "$response" | grep -q "mysqld is alive" && break
sleep 1
done

View file

@ -1,10 +0,0 @@
# Configuration file for MySQL server.
#
# Directory to store database files. Set to /var/lib/mysql by default.
#
#MYSQLD_DATADIR=/var/lib/mysql
#
# Additional arguments to be passed to the MySQL server daemon.
# Please note that you should also tweak /etc/mysql/my.cnf.
#
#MYSQLD_ARGS=""

View file

@ -1,47 +0,0 @@
#!/sbin/runscript
#
: ${MYSQLD_PIDFILE:=/var/run/mysqld/mysqld.pid}
: ${MYSQLD_DATADIR=/var/lib/mysql}
depend()
{
need net localmount
provide mysqld
}
start_pre()
{
if [ ! -d /var/run/mysqld ]; then
mkdir -p /var/run/mysqld
chown mysqld:mysqld /var/run/mysqld
fi
if [ ! -d ${MYSQLD_DATADIR} ]; then
ebegin "Initializing MySQL datadir: ${MYSQLD_DATADIR}"
mkdir -p ${MYSQLD_DATADIR}
/usr/bin/mysql_install_db --datadir=${MYSQLD_DATADIR} \
--user=mysqld 2>&1 >/dev/null && \
chown -R mysqld:mysqld ${MYSQLD_DATADIR}
eend $?
fi
}
start()
{
ebegin "Starting MySQL server"
start-stop-daemon --start --user mysqld:mysqld \
--pidfile ${MYSQLD_PIDFILE} --background \
--exec /usr/sbin/mysqld -- \
--basedir=/usr --datadir=${MYSQLD_DATADIR} \
--user=mysqld --pid-file=${MYSQLD_PIDFILE} \
--external-locking ${MYSQLD_ARGS} 2>&1 >/dev/null
eend $?
}
stop()
{
ebegin "Stopping MySQL server"
start-stop-daemon --stop --pidfile ${MYSQLD_PIDFILE}
eend $?
}

View file

@ -0,0 +1,11 @@
[Unit]
Description=MySQL Server
[Service]
User=mysql
ExecStart=/usr/bin/mysqld --user=mysql
ExecStartPost=/usr/lib/systemd/scripts/mysqld-post
Restart=always
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1 @@
d /run/mysqld 0755 mysql mysql -

View file

@ -1,23 +1,14 @@
# Template file for 'libmysqlclient-devel'.
#
depends="libstdc++-devel libmysqlclient>=5.1.54"
depends="libmysqlclient>=${version}_${revision}"
short_desc="MySQL database development files"
long_desc="${long_desc}
This package includes development libraries and header files."
noverifyrdeps=yes
do_install()
{
do_install() {
vmove usr/bin/mysql_config usr/bin
vmove usr/share/man/man1/mysql_config.1 usr/share/man
vmove "usr/include/mysql/*.h" usr/include/mysql
vmove usr/lib/mysql/libmysqlclient*.a usr/lib/mysql
vmove usr/share/aclocal usr/share
for p in *example* mypluglib* *.a; do
vmove usr/lib/mysql/plugin/${p} usr/lib/mysql/plugin
done
vmove usr/share/man/man1/mysql_config.1 usr/share/man/man1
vmove usr/include usr
vmove "usr/lib/*.a" usr/lib
}

View file

@ -1,8 +1,7 @@
libpthread.so.0
libcrypt.so.1
libnsl.so.1
libm.so.6
libz.so.1
libssl.so.1
libcrypto.so.1
libc.so.6
libdl.so.2

View file

@ -5,9 +5,6 @@ long_desc="${long_desc}
This package includes the client library."
do_install()
{
mkdir -p ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/mysql/libmysqlclient*.so* ${DESTDIR}/usr/lib
do_install() {
vmove "usr/lib/libmysqlclient*.so*" usr/lib
}

View file

@ -1,14 +0,0 @@
# Template file for 'libmysqld-devel'.
#
depends="glibc libmysqlclient-devel"
short_desc="MySQL embedded database development files"
long_desc="${long_desc}
This package includes the client library."
do_install()
{
mkdir -p ${DESTDIR}/usr/lib/mysql
mv ${SRCPKGDESTDIR}/usr/lib/mysql/*.a ${DESTDIR}/usr/lib/mysql
}

View file

@ -1,21 +0,0 @@
# Template file for 'libndbclient-devel'.
#
depends="glibc libndbclient"
short_desc="MySQL NDB (Network Database) development files"
long_desc="${long_desc}
This package includes the NDB development files."
noverifyrdeps=yes
do_install()
{
mkdir -p ${DESTDIR}/usr/{bin,lib} ${DESTDIR}/usr/share/man/man1
mv ${SRCPKGDESTDIR}/usr/lib/mysql/libndbclient*.a ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/bin/ndb_config ${DESTDIR}/usr/bin
mv ${SRCPKGDESTDIR}/usr/share/man/man1/ndb_config.1 \
${DESTDIR}/usr/share/man/man1
mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr
}

View file

@ -1,5 +0,0 @@
libpthread.so.0
libcrypt.so.1
libnsl.so.1
libm.so.6
libc.so.6

View file

@ -1,14 +0,0 @@
# Template file for 'libndbclient'.
#
depends="zlib"
short_desc="MySQL NDB (Network Database) client library"
long_desc="${long_desc}
This package includes the NDB client library."
do_install()
{
mkdir -p ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/mysql/libndbclient*.so* ${DESTDIR}/usr/lib
}

View file

@ -4,11 +4,9 @@ libcrypto.so.1
libz.so.1
libstdc++.so.6
libc.so.6
libmysqlclient_r.so.16
libmysqlclient.so.16
libm.so.6
libdl.so.2
libcrypt.so.1
libwrap.so.0
libreadline.so.6
libgcc_s.so.1 i686
libncursesw.so.6
librt.so.1

View file

@ -1,18 +1,13 @@
# Template file for 'mysql-client'.
#
depends="ncurses-libs perl>=0"
depends="perl"
short_desc="MySQL database client binaries"
long_desc="${long_desc}
This package includes the client binaries and the additional tools
innotop and mysqlreport."
do_install()
{
mkdir -p ${DESTDIR}/usr/{,s}bin ${DESTDIR}/usr/share/man/man{1,8}
do_install() {
for f in innochecksum innotop myisam_ftdump mysql mysql_client_test \
mysql_client_test_embedded mysqldumpslow mysqlbinlog \
mysql_find_rows mysql_fix_extensions mysql_waitpid mysqlaccess \
@ -21,16 +16,14 @@ do_install()
mysqlslap mysqltest_embedded mysqlmanager mysqltest \
mysqlhotcopy mysql_upgrade mysql_zap; do
if [ -f ${SRCPKGDESTDIR}/usr/bin/${f} ]; then
mv ${SRCPKGDESTDIR}/usr/bin/${f} ${DESTDIR}/usr/bin
vmove usr/bin/${f} usr/bin
elif [ -f ${SRCPKGDESTDIR}/usr/sbin/${f} ]; then
mv ${SRCPKGDESTDIR}/usr/sbin/${f} ${DESTDIR}/usr/sbin
vmove usr/sbin/${f} usr/sbin
fi
if [ -f ${SRCPKGDESTDIR}/usr/share/man/man1/${f}.1 ]; then
mv ${SRCPKGDESTDIR}/usr/share/man/man1/${f}.1 \
${DESTDIR}/usr/share/man/man1
vmove usr/share/man/man1/${f}.1 usr/share/man/man1
elif [ -f ${SRCPKGDESTDIR}/usr/share/man/man8/${f}.8 ]; then
mv ${SRCPKGDESTDIR}/usr/share/man/man8/${f}.8 \
${DESTDIR}/usr/share/man/man8
vmove usr/share/man/man8/${f}.8 usr/share/man/man8
fi
done
}

View file

@ -1,7 +0,0 @@
libpthread.so.0
libstdc++.so.6
libm.so.6
libc.so.6
libreadline.so.6
libz.so.1
libgcc_s.so.1 i686

View file

@ -1,22 +0,0 @@
# Template file for 'mysql-ndb'.
#
depends="ncurses-libs"
short_desc="MySQL NDB (Network Database) binaries"
long_desc="${long_desc}
This package includes the binaries for the MySQL NDB (Network Database)
component."
do_install()
{
mkdir -p ${DESTDIR}/usr/{,s}bin ${DESTDIR}/usr/share/man/man{1,8}
mv ${SRCPKGDESTDIR}/usr/bin/ndb_* ${DESTDIR}/usr/bin
mv ${SRCPKGDESTDIR}/usr/sbin/ndb* ${DESTDIR}/usr/sbin
mv ${SRCPKGDESTDIR}/usr/share/man/man1/ndb* \
${DESTDIR}/usr/share/man/man1
mv ${SRCPKGDESTDIR}/usr/share/man/man8/ndb* \
${DESTDIR}/usr/share/man/man8
}

View file

@ -1,12 +1,11 @@
libpthread.so.0
libz.so.1
libwrap.so.0
libdl.so.2
libssl.so.1
libcrypto.so.1
libcrypt.so.1
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6
libnsl.so.1
librt.so.1
libncursesw.so.6

View file

@ -1,24 +1,15 @@
# Template file for 'mysql'
pkgname=mysql
version=5.1.54
distfiles="http://downloads.mysql.com/archives/mysql-5.1/$pkgname-$version.tar.gz"
build_style=gnu-configure
configure_args="--sysconfdir=/etc/mysql
--with-libwrap --with-charset=utf8 --with-collation=utf8_general_ci
--with-extra-charsets=complex --with-embedded-server --enable-local-infile
--with-unix-socket-path=/var/run/mysqld/mysqld.sock --enable-assembler
--with-pthread --with-named-curses-libs=\"-lncursesw\" --with-ssl=/usr
--with-zlib-dir=/usr --with-fast-mutexes --with-big-tables
--with-plugins=all --with-embedded-privilege-control --with-mysqlmanager
--with-mysqld-user=mysqld --enable-thread-safe-client
--libexecdir=/usr/sbin --without-readline"
revision=5
version=5.5.27
revision=1
depends="mysql-client"
makedepends="libstdc++-devel zlib-devel tcp_wrappers-devel ncurses-devel openssl-devel readline-devel"
fulldepends="perl>=0 procps"
makedepends="perl cmake bison zlib-devel ncurses-devel openssl-devel readline-devel"
short_desc="The world's most popular open source database"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=84370fffc4fe277645fb3a5040d153ff567576b664f0663452be077826b7ab1f
homepage="https://www.mysql.com/products/community/"
license="GPL-2"
distfiles="http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.5/$pkgname-$version.tar.gz"
checksum=51ffafbd82039f8afbe5b3c26f15cc338ed6cd4f67e56d7dd33efaa28c9d99e4
long_desc="
MySQL is the world's most popular open source database software, with over
100 million copies of its software downloaded or distributed throughout
@ -28,30 +19,70 @@ long_desc="
the major problems associated with downtime, maintenance and administration
for modern, online applications."
# Fix build with gcc-4.4.
CFLAGS="-fPIC -fno-strict-aliasing"
CXXFLAGS="-fPIC -fno-strict-aliasing"
subpackages="libmysqlclient libmysqlclient-devel libndbclient"
subpackages="${subpackages} libndbclient-devel libmysqld-devel"
subpackages="${subpackages} mysql-client mysql-ndb"
conf_files="/etc/mysql/my.cnf /etc/conf.d/mysqld"
openrc_services="mysqld default false"
# Create mysqld user/group.
system_accounts="mysqld"
subpackages="libmysqlclient libmysqlclient-devel mysql-client"
conf_files="/etc/mysql/my.cnf"
systemd_services="mysqld.service on"
system_accounts="mysql"
mysqld_homedir="/var/lib/mysql"
do_configure() {
mkdir build
cd build
post_install()
{
# Remove tests
rm -rf ${DESTDIR}/usr/sql-bench ${DESTDIR}/usr/mysql-test
# Install config files and OpenRC service.
install -D -m640 ${FILESDIR}/my.cnf ${DESTDIR}/etc/mysql/my.cnf
install -D -m644 ${FILESDIR}/mysqld.confd ${DESTDIR}/etc/conf.d/mysqld
install -D -m755 ${FILESDIR}/mysqld.rc ${DESTDIR}/etc/init.d/mysqld
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc/mysql \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=ON \
-DINSTALL_INFODIR=share/mysql/docs \
-DINSTALL_MANDIR=share/man \
-DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_DOCREADMEDIR=share/mysql \
-DINSTALL_SUPPORTFILESDIR=share/mysql \
-DINSTALL_MYSQLSHAREDIR=share/mysql \
-DINSTALL_DOCDIR=share/mysql/docs \
-DINSTALL_SHAREDIR=share/mysql \
-DWITH_READLINE=ON \
-DWITH_ZLIB=system \
-DWITH_SSL=system \
-DWITH_LIBWRAP=OFF \
-DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \
-DWITH_EXTRA_CHARSETS=complex \
-DWITH_EMBEDDED_SERVER=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
-DCMAKE_C_FLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
-DCMAKE_CXX_FLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti"
}
do_build() {
cd build
make ${makejobs}
}
do_install() {
cd build
make DESTDIR=${DESTDIR} install
# Remove unneeded stuff.
rm -rf ${DESTDIR}/usr/{sql-bench,mysql-test,data}
rm -f ${DESTDIR}/usr/share/man/man1/mysql-test-run.pl.1
# Configuration file.
vinstall ${FILESDIR}/my.cnf 640 etc/mysql
# systemd service.
vinstall ${FILESDIR}/mysqld.service 644 usr/lib/systemd/system
vinstall ${FILESDIR}/mysqld-post 755 usr/lib/systemd/scripts
vinstall ${FILESDIR}/mysqld.tmpfilesd 644 usr/lib/tmpfiles.d mysqld.conf
}