[arch-commits] Commit in mysql/repos (6 files)

Andrea Scarpino andrea at archlinux.org
Tue Nov 17 15:21:50 EST 2009


    Date: Tuesday, November 17, 2009 @ 15:21:49
  Author: andrea
Revision: 58937

package splitted; upstream release; changed configuration, .pid and .sock path (FS#14488)

Added:
  mysql/repos/extra-i686/
  mysql/repos/extra-i686/PKGBUILD
  mysql/repos/extra-i686/my.cnf
  mysql/repos/extra-i686/mysql.install
  mysql/repos/extra-i686/mysqld
  mysql/repos/extra-i686/mysqld.conf.d

---------------+
 PKGBUILD      |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 my.cnf        |  149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mysql.install |    4 +
 mysqld        |   90 +++++++++++++++++++++++++++++++++
 mysqld.conf.d |    1 
 5 files changed, 385 insertions(+)

Added: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD	                        (rev 0)
+++ extra-i686/PKGBUILD	2009-11-17 20:21:49 UTC (rev 58937)
@@ -0,0 +1,141 @@
+# $Id: PKGBUILD 58936 2009-11-17 20:14:17Z andrea $
+# Maintainer: Andrea Scarpino <andrea at archlinux.org>
+# Contributor: Douglas Soares de Andrade <douglas at archlinux.org>
+# Contributor: judd <jvinet at zeroflux.org>
+
+pkgbase=mysql
+pkgname=('libmysqlclient' 'mysql-clients' 'mysql')
+pkgver=5.1.40
+pkgrel=1
+pkgdesc="A fast SQL database server"
+arch=('i686' 'x86_64')
+license=('GPL')
+url=('http://www.mysql.com/')
+makedepends=('tcp_wrappers' 'zlib' 'perl' 'openssl' 'libtool' 'patch')
+options=('!libtool')
+source=("http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.1/mysql-$pkgver.tar.gz"
+        'mysqld'
+        'my.cnf'
+        'mysqld.conf.d')
+md5sums=('32e7373c16271606007374396e6742ad'
+         'c093cc7eef5934f56f8bc775b559904b'
+         '0ee035590ffc61d32de994f461fd2bd2'
+         '4a9077fc95ec6db1d5420e0cdc74d31c')
+
+build() {
+  cd ${srcdir}/${pkgbase}-${pkgver}
+
+  ./configure --prefix=/usr \
+    --libexecdir=/usr/sbin \
+    --localstatedir=/var \
+    --sysconfdir=/etc/mysql \
+    --without-docs \
+    --without-readline \
+    --with-ssl \
+    --with-libwrap \
+    --with-charset=latin1 \
+    --with-collation=latin1_general_ci \
+    --with-extra-charsets=complex \
+    --with-embedded-server \
+    --enable-local-infile \
+    --with-plugins=partition,ftexample,archive,blackhole,federated,heap,innobase,ndbcluster
+}
+
+package_libmysqlclient(){
+  pkgdesc="MySQL client libraries"
+  depends=('openssl' 'zlib' 'gcc-libs' 'tcp_wrappers')
+  
+  cd ${srcdir}/${pkgbase}-${pkgver}
+  for dir in include strings mysys dbug storage regex extra vio sql; do
+    pushd ${dir} || return 1
+    make || return 1
+    popd
+  done
+  for dir in libmysql libmysql_r libmysqld; do
+    pushd ${dir} || return 1
+    make link_sources
+    make || return 1
+    make DESTDIR=${pkgdir} install
+    popd
+  done
+  cd include
+  make DESTDIR=${pkgdir} install
+
+  # Copy missing includes
+  install -m644 *.h ${pkgdir}/usr/include/mysql
+
+  cd ../scripts
+  make mysql_config
+  install -d ${pkgdir}/usr/bin
+  install -m755 mysql_config ${pkgdir}/usr/bin || return 1
+  
+  # create library symlinks in /usr/lib
+  ln -sf mysql/libmysqlclient.so.16 $pkgdir/usr/lib/libmysqlclient.so.16
+  ln -sf libmysqlclient.so.16 $pkgdir/usr/lib/libmysqlclient.so
+  ln -sf libmysqlclient.so.16 $pkgdir/usr/lib/libmysqlclient.so.1
+  ln -sf mysql/libmysqlclient_r.so.16  $pkgdir/usr/lib/libmysqlclient_r.so.16
+  ln -sf libmysqlclient_r.so.16 $pkgdir/usr/lib/libmysqlclient_r.so
+  ln -sf libmysqlclient_r.so.16 $pkgdir/usr/lib/libmysqlclient_r.so.1
+}
+
+package_mysql-clients(){
+  pkgdesc="MySQL client tools"
+  depends=("libmysqlclient>=${pkgver}")
+  
+  cd ${srcdir}/${pkgbase}-${pkgver}
+  pushd include || return
+    make || return 1
+  popd
+
+  pushd libmysql
+    make link_sources get_password.lo || return
+  popd 
+  
+  for dir in strings regex mysys dbug extra; do
+    pushd ${dir} || return 1
+    make || return 1
+    popd
+  done
+
+  cd client
+
+  sed -i -e 's|\$(top_builddir)/libmysql/libmysqlclient.la|/usr/lib/mysql/libmysqlclient.so|g' Makefile
+  make link_sources
+  make || return 1
+  make DESTDIR=${pkgdir} install
+
+  # Removing libmysql stuff
+  rm -rf $pkgdir/usr/lib/
+}
+
+package_mysql(){
+  backup=('etc/my.cnf' 'etc/mysql/my.cnf' 'etc/conf.d/mysqld')
+  depends=('mysql-clients')
+  optdepends=('perl-dbi' 'perl-dbd-mysql')
+  install=mysql.install
+
+  cd ${srcdir}/${pkgbase}-${pkgver}
+  pushd include || return
+    make || return 1
+  popd
+    
+  pushd libmysql
+    make link_sources get_password.lo || return
+  popd
+  
+  make || return 1
+  make DESTDIR=${pkgdir} install
+
+  rm -rf ${pkgdir}/usr/{mysql-test,sql-bench,lib,include}
+  install -D -m644 ../my.cnf ${pkgdir}/etc/mysql/my.cnf
+  install -D -m755 ../mysqld ${pkgdir}/etc/rc.d/mysqld
+  install -D -m644 ../mysqld.conf.d ${pkgdir}/etc/conf.d/mysqld
+
+  # Cleanup files provided by the other packages
+  rm -f ${pkgdir}/usr/bin/{mysql,mysql_config,mysql_client_test_embedded,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest,mysqltest_embedded}
+  rm -rf ${pkgdir}/usr/{include,lib}
+
+  # create directory for PID file
+  install -d ${pkgdir}/var/run/mysqld
+}
+

Added: extra-i686/my.cnf
===================================================================
--- extra-i686/my.cnf	                        (rev 0)
+++ extra-i686/my.cnf	2009-11-17 20:21:49 UTC (rev 58937)
@@ -0,0 +1,149 @@
+# mysql config file for medium systems.
+#
+# This is for a system with little memory (32M - 64M) where MySQL plays
+# a important part and systems up to 128M where MySQL is used together with
+# other programs (like a web server)
+#
+# One can in this file use all long options that the program supports.
+# If you want to know which options a program support, run the program
+# with --help option.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password	= your_password
+port		= 3306
+socket		= /tmp/mysqld/mysql.sock
+
+# Here follows entries for some specific programs
+
+# The MySQL server
+[mysqld]
+port		= 3306
+socket		= /tmp/mysqld/mysql.sock
+datadir		= /var/lib/mysql
+skip-locking
+key_buffer = 16M
+max_allowed_packet = 1M
+table_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 16K
+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.
+# All interaction with mysqld must be made via Unix sockets or named pipes.
+# Note that using this option without enabling named pipes on Windows
+# (via the "enable-named-pipe" option) will render mysqld useless!
+# 
+skip-networking
+
+# Replication Master Server (default)
+# binary logging is required for replication
+#log-bin
+
+# required unique id between 1 and 2^32 - 1
+# defaults to 1 if master-host is not set
+# but will not function as a master if omitted
+server-id	= 1
+
+# Replication Slave (comment out master section to use this)
+#
+# To configure this host as a replication slave, you can choose between
+# two methods :
+#
+# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
+#    the syntax is:
+#
+#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
+#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
+#
+#    where you replace <host>, <user>, <password> by quoted strings and
+#    <port> by the master's port number (3306 by default).
+#
+#    Example:
+#
+#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
+#    MASTER_USER='joe', MASTER_PASSWORD='secret';
+#
+# OR
+#
+# 2) Set the variables below. However, in case you choose this method, then
+#    start replication for the first time (even unsuccessfully, for example
+#    if you mistyped the password in master-password and the slave fails to
+#    connect), the slave will create a master.info file, and any later
+#    change in this file to the variables' values below will be ignored and
+#    overridden by the content of the master.info file, unless you shutdown
+#    the slave server, delete master.info and restart the slaver server.
+#    For that reason, you may want to leave the lines below untouched
+#    (commented) and instead use CHANGE MASTER TO (see above)
+#
+# required unique id between 2 and 2^32 - 1
+# (and different from the master)
+# defaults to 2 if master-host is set
+# but will not function as a slave if omitted
+#server-id       = 2
+#
+# The replication master for this slave - required
+#master-host     =   <hostname>
+#
+# The username the slave will use for authentication when connecting
+# to the master - required
+#master-user     =   <username>
+#
+# The password the slave will authenticate with when connecting to
+# the master - required
+#master-password =   <password>
+#
+# The port the master is listening on.
+# optional - defaults to 3306
+#master-port     =  <port>
+#
+# binary logging - not required for slaves, but recommended
+#log-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 BDB tables
+#bdb_cache_size = 4M
+#bdb_max_lock = 10000
+
+# Uncomment the following if you are using InnoDB tables
+#innodb_data_home_dir = /var/lib/mysql
+#innodb_data_file_path = ibdata1:10M:autoextend
+#innodb_log_group_home_dir = /var/lib/mysql
+#innodb_log_arch_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 = 16M
+#innodb_additional_mem_pool_size = 2M
+# Set .._log_file_size to 25 % of buffer pool size
+#innodb_log_file_size = 5M
+#innodb_log_buffer_size = 8M
+#innodb_flush_log_at_trx_commit = 1
+#innodb_lock_wait_timeout = 50
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+#no-auto-rehash
+# Remove the next comment character if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[mysqlhotcopy]
+interactive-timeout

Added: extra-i686/mysql.install
===================================================================
--- extra-i686/mysql.install	                        (rev 0)
+++ extra-i686/mysql.install	2009-11-17 20:21:49 UTC (rev 58937)
@@ -0,0 +1,4 @@
+post_upgrade() {
+  echo ">> MySQL configuration file now is into /etc/mysql/ directory."
+  echo ">> Remember to replace it with your old configuration file."
+}

Added: extra-i686/mysqld
===================================================================
--- extra-i686/mysqld	                        (rev 0)
+++ extra-i686/mysqld	2009-11-17 20:21:49 UTC (rev 58937)
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+MYSQLD_ROOT="/var/lib/mysql"
+# source application-specific settings
+[ -f /etc/conf.d/mysqld ] && . /etc/conf.d/mysqld
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+getPID() {
+   echo $(pgrep -u mysql mysqld);
+}
+
+if [ ! `egrep '^mysql:' /etc/group` ]; then
+  stat_busy "Adding mysql group"
+  groupadd -g 89 mysql
+  stat_done
+fi
+if [ ! `egrep '^mysql:' /etc/passwd` ]; then
+  stat_busy "Adding mysql user"
+  useradd -u 89 -g mysql -d $MYSQLD_ROOT -s /bin/false mysql
+  [ -d $MYSQLD_ROOT ] && chown -R mysql:mysql $MYSQLD_ROOT
+  stat_done
+fi
+
+if [ ! -d $MYSQLD_ROOT ]; then
+  mkdir $MYSQLD_ROOT
+  /usr/bin/mysql_install_db --datadir=$MYSQLD_ROOT --user=mysql
+  chown -R mysql:mysql $MYSQLD_ROOT
+fi
+
+case "$1" in
+  start)
+    stat_busy "Starting MySQL"
+    if [ -z "$(getPID)" ]; then
+       /usr/bin/mysqld_safe --datadir=$MYSQLD_ROOT &>/dev/null &
+      if [ $? -gt 0 ]; then
+        stat_fail
+        exit 1
+      else
+        timeo=30
+        while [ $timeo -gt 0 ]; do
+          response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break
+          echo "$response" | grep -q "mysqld is alive" && break
+          sleep 1
+          let timeo=${timeo}-1
+        done
+        if [ $timeo -eq 0 ]; then
+          stat_fail
+          exit 1
+        else
+          echo $(getPID) >/var/run/mysqld/mysqld.pid
+          add_daemon mysqld
+          stat_done
+        fi
+      fi
+    else
+      stat_fail
+      exit 1
+    fi
+    ;;
+
+  stop)
+    stat_busy "Stopping MySQL"
+    if [ ! -z "$(getPID)" ]; then
+      kill $(getPID) &> /dev/null
+      if [ $? -gt 0 ]; then
+        stat_fail
+        exit 1
+      else
+        rm -f /var/run/mysqld/mysqld.pid &>/dev/null
+        rm_daemon mysqld
+        stat_done
+      fi
+    else
+      stat_fail
+      exit 1
+    fi
+    ;;
+
+  restart)
+    $0 stop
+    sleep 3
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+exit 0


Property changes on: mysql/repos/extra-i686/mysqld
___________________________________________________________________
Added: svn:executable
   + *

Added: extra-i686/mysqld.conf.d
===================================================================
--- extra-i686/mysqld.conf.d	                        (rev 0)
+++ extra-i686/mysqld.conf.d	2009-11-17 20:21:49 UTC (rev 58937)
@@ -0,0 +1 @@
+MYSQLD_ROOT="/var/lib/mysql"



More information about the arch-commits mailing list