diff options
author | James Meyer <james.meyer@operamail.com> | 2010-10-23 18:17:40 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2010-10-23 18:19:39 (GMT) |
commit | adbcf19958300e9b6598990184c8815b945ba0ee (patch) | |
tree | f4283c850ac0ac202c17e78a637ee7ca8147621b /abs/core/mysql | |
parent | 61a68250df10d29b624650948484898334ff22d0 (diff) | |
download | linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.zip linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.gz linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.bz2 |
Removed old core and extra from repo. Renamed -testing to core/extra. This will setup the base for the testing branch.
Diffstat (limited to 'abs/core/mysql')
-rw-r--r-- | abs/core/mysql/PKGBUILD | 153 | ||||
-rw-r--r-- | abs/core/mysql/__changelog | 15 | ||||
-rw-r--r-- | abs/core/mysql/my.cnf | 18 | ||||
-rw-r--r-- | abs/core/mysql/mysql-no-clients.patch | 65 | ||||
-rw-r--r-- | abs/core/mysql/mysql.install | 20 | ||||
-rwxr-xr-x | abs/core/mysql/mysqld | 67 | ||||
-rw-r--r-- | abs/core/mysql/mysqld.conf.d | 1 | ||||
-rw-r--r-- | abs/core/mysql/skip-abi-check.patch | 13 |
8 files changed, 177 insertions, 175 deletions
diff --git a/abs/core/mysql/PKGBUILD b/abs/core/mysql/PKGBUILD index c91ac41..ed65173 100644 --- a/abs/core/mysql/PKGBUILD +++ b/abs/core/mysql/PKGBUILD @@ -1,56 +1,109 @@ -# $Id: PKGBUILD 23595 2009-01-11 13:14:19Z douglas $ -# Maintainer: Alexander Baldeck <alexander@archlinux.org> +# $Id: PKGBUILD 88432 2010-08-23 17:32:08Z pierre $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> +# Contributor: Douglas Soares de Andrade <douglas@archlinux.org> # Contributor: judd <jvinet@zeroflux.org> -pkgname=mysql -pkgver=5.0.75 -pkgrel=4 -pkgdesc="A fast SQL database server" -arch=(i686 x86_64) -backup=(etc/my.cnf etc/conf.d/mysqld) -depends=("mysql-clients>=${pkgver}" 'tcp_wrappers') -makedepends=('libtool') -url=('http://www.mysql.com/') -options=('!libtool') -optdepends=('perl-dbi' 'perl-dbd-mysql') + +pkgbase=mysql +pkgname=('libmysqlclient' 'mysql-clients' 'mysql') +pkgver=5.1.50 +pkgrel=1 +arch=('i686' 'x86_64') license=('GPL') -source=(ftp://ftp.pucpr.br/mysql/Downloads/MySQL-5.0/mysql-${pkgver}.tar.gz - mysql-no-clients.patch - mysqld - my.cnf - mysqld.conf.d) +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/${pkgbase}-${pkgver}.tar.gz" + 'mysqld' + 'my.cnf' + 'skip-abi-check.patch') build() { - # PIC - cd ${startdir}/src/${pkgname}-${pkgver} - patch -Np1 -i ${startdir}/src/mysql-no-clients.patch || return 1 - ./configure --prefix=/usr --libexecdir=/usr/sbin \ - --without-debug --without-docs --without-bench --without-readline \ - --with-innodb --enable-local-infile --with-openssl \ - --with-charset=latin1 --with-collation=latin1_general_ci \ - --with-extra-charsets=complex --enable-thread-safe-client \ - --with-libwrap --with-berkeley-db --with-embedded-server - - # fixes - sed -i -e 's/^.*HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE.*$/#define\ HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE/g' include/config.h || return 1 - sed -i -e 's/size_socket/socklen_t/g' sql/mysqld.cc || return 1 - - pushd include || return - make || return 1 - popd - pushd libmysql - make link_sources get_password.lo || return - popd - make || return 1 - make DESTDIR=${startdir}/pkg install - rm -rf ${startdir}/pkg/usr/{mysql-test,sql-bench} - install -D -m644 ../my.cnf ${startdir}/pkg/etc/my.cnf - install -D -m755 ../mysqld ${startdir}/pkg/etc/rc.d/mysqld - install -D -m644 ../mysqld.conf.d ${startdir}/pkg/etc/conf.d/mysqld - rm -f ${startdir}/pkg/usr/bin/mysql_config + cd "${srcdir}/${pkgbase}-${pkgver}" + patch -Np0 -i "${srcdir}/skip-abi-check.patch" + # CFLAGS/CXXFLAGS as suggested upstream + CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \ + CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \ + ./configure --prefix=/usr \ + --libexecdir=/usr/sbin \ + --localstatedir=/var \ + --sysconfdir=/etc/mysql \ + --without-docs \ + --without-readline \ + --with-ssl \ + --with-libwrap \ + --with-charset=utf8 \ + --with-collation=utf8_general_ci \ + --with-extra-charsets=complex \ + --with-embedded-server \ + --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ + --enable-local-infile \ + --with-plugins=partition,ftexample,archive,blackhole,federated,heap,innobase,innodb_plugin,ndbcluster + make +} + +package_libmysqlclient(){ + pkgdesc="MySQL client libraries" + depends=('openssl' 'zlib' 'gcc-libs' 'tcp_wrappers') + + cd "${srcdir}/${pkgbase}-${pkgver}" + for dir in include libmysql libmysql_r libmysqld; do + make -C ${dir} DESTDIR="${pkgdir}" install + done + install -m644 include/*.h "${pkgdir}/usr/include/mysql/" + + install -d "${pkgdir}/usr/bin" + install -m755 scripts/mysql_config "${pkgdir}/usr/bin/" + + # 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 } -md5sums=('a234f0a60a7f8c290d9875cba3a2c5a2' - 'e892aac36cbeb57f0e003ec0936afb3b' - 'cfff3585dd70cde3ac1ce69e64008733' - '078f6e824d6097d558bcf7c16d508d92' - 'd81d1f51e9ee6941425a63456d07cb21') +package_mysql-clients(){ + pkgdesc="MySQL client tools" + depends=('libmysqlclient') + + cd "${srcdir}/${pkgbase}-${pkgver}/client" + make DESTDIR="${pkgdir}" install + + # provided by libmysqlclient + rm -rf "${pkgdir}/usr/lib/" + + # provided by mysql + rm -f "${pkgdir}"/usr/bin/{mysql_upgrade,mysqlbinlog,mysqltest} +} + +package_mysql(){ + pkgdesc="A fast SQL database server" + backup=('etc/my.cnf' 'etc/mysql/my.cnf') + install=mysql.install + depends=('mysql-clients') + optdepends=('perl-dbi' 'perl-dbd-mysql') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make DESTDIR=${pkgdir} install + + install -Dm644 ${srcdir}/my.cnf ${pkgdir}/etc/mysql/my.cnf + install -Dm755 ${srcdir}/mysqld ${pkgdir}/etc/rc.d/mysqld + + # provided by libmysqlclient + rm -f ${pkgdir}/usr/bin/{mysql_config,mysql_client_test_embedded,mysqltest_embedded} + rm -f ${pkgdir}/usr/lib/mysql/libmysqlclient* + rm -f ${pkgdir}/usr/lib/mysql/libmysqld.a + rm -f ${pkgdir}/usr/include/mysql/*.h + + # provided by mysql-clients + rm -f ${pkgdir}/usr/bin/{mysql,mysqladmin,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap} + + # not needed + rm -rf ${pkgdir}/usr/{mysql-test,sql-bench} + rm -f ${pkgdir}/usr/lib/mysql/plugin/*.a +} +md5sums=('23bac4a0aafd683b077dac146ce2701f' + '2234207625baa29b2ff7d7b4f088abce' + '175b269b665019689d786f5af0968046' + 'a97e574945e19de3908575b956241026') diff --git a/abs/core/mysql/__changelog b/abs/core/mysql/__changelog index aa066aa..3362584 100644 --- a/abs/core/mysql/__changelog +++ b/abs/core/mysql/__changelog @@ -1,13 +1,2 @@ -my.cnf --enable networking --datadir /data/srv/mysql --query_cache_size --tmp_table_size --max_heap_table_size --thread_cache_size --table_cache - -mysqld - -redirect output to /dev/null - --skip-name-resolve - replace mkdir with mkdir -p +using default arch pkgbuild +my.cnf has data dir modified to use /data/srv diff --git a/abs/core/mysql/my.cnf b/abs/core/mysql/my.cnf index e13331e..4eaeaa0 100644 --- a/abs/core/mysql/my.cnf +++ b/abs/core/mysql/my.cnf @@ -1,4 +1,8 @@ -# mysql config file for LinHES. +# 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 @@ -8,27 +12,22 @@ [client] #password = your_password port = 3306 -socket = /tmp/mysql.sock +socket = /var/run/mysqld/mysqld.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 -socket = /tmp/mysql.sock +socket = /var/run/mysqld/mysqld.sock datadir = /data/srv/mysql -skip-locking +skip-external-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 16K myisam_sort_buffer_size = 8M -query_cache_size = 8M -tmp_table_size = 36M -max_heap_table_size = 24M -thread_cache_size = 4 -table_cache = 96 # 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. @@ -114,7 +113,6 @@ server-id = 1 #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 diff --git a/abs/core/mysql/mysql-no-clients.patch b/abs/core/mysql/mysql-no-clients.patch deleted file mode 100644 index e1fb5e0..0000000 --- a/abs/core/mysql/mysql-no-clients.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -ruN mysql-5.0.51.orig/Makefile.in mysql-5.0.51/Makefile.in ---- mysql-5.0.51.orig/Makefile.in 2007-12-07 12:59:21.000000000 +0000 -+++ mysql-5.0.51/Makefile.in 2007-12-07 13:03:21.000000000 +0000 -@@ -376,7 +376,7 @@ - SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \ - @readline_topdir@ sql-common scripts \ - @thread_dirs@ pstack \ -- @sql_union_dirs@ @man_dirs@ tests \ -+ strings mysys dbug extra regex bdb innobase myisam myisammrg heap vio sql @man_dirs@ tests \ - netware @libmysqld_dirs@ \ - @bench_dirs@ support-files @tools_dirs@ - -diff -ruN mysql-5.0.51.orig/include/Makefile.in mysql-5.0.51/include/Makefile.in ---- mysql-5.0.51.orig/include/Makefile.in 2007-12-07 12:59:20.000000000 +0000 -+++ mysql-5.0.51/include/Makefile.in 2007-12-07 13:00:12.000000000 +0000 -@@ -557,7 +557,6 @@ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done - install: $(BUILT_SOURCES) -- $(MAKE) $(AM_MAKEFLAGS) install-am - install-exec: install-exec-am - install-data: install-data-am - uninstall: uninstall-am -diff -ruN mysql-5.0.51.orig/tests/Makefile.in mysql-5.0.51/tests/Makefile.in ---- mysql-5.0.51.orig/tests/Makefile.in 2007-12-07 12:59:20.000000000 +0000 -+++ mysql-5.0.51/tests/Makefile.in 2007-12-07 13:01:51.000000000 +0000 -@@ -96,7 +96,7 @@ - am_mysql_client_test_OBJECTS = mysql_client_test.$(OBJEXT) \ - my_memmem.$(OBJEXT) - mysql_client_test_OBJECTS = $(am_mysql_client_test_OBJECTS) --am__DEPENDENCIES_1 = $(top_builddir)/libmysql/libmysqlclient.la -+am__DEPENDENCIES_1 = /usr/lib/mysql/libmysqlclient.so - am__DEPENDENCIES_2 = - mysql_client_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) -@@ -106,7 +106,7 @@ - thread_test_SOURCES = thread_test.c - thread_test_OBJECTS = thread_test.$(OBJEXT) - thread_test_LDADD = $(LDADD) --thread_test_DEPENDENCIES = $(top_builddir)/libmysql/libmysqlclient.la -+thread_test_DEPENDENCIES = /usr/lib/mysql/libmysqlclient.so - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include - depcomp = $(SHELL) $(top_srcdir)/depcomp - am__depfiles_maybe = depfiles -@@ -405,7 +405,7 @@ - $(openssl_includes) - - LDADD = @CLIENT_EXTRA_LDFLAGS@ \ -- $(top_builddir)/libmysql/libmysqlclient.la -+ /usr/lib/mysql/libmysqlclient.so - - mysql_client_test_LDADD = $(LDADD) $(CXXLDFLAGS) - mysql_client_test_SOURCES = mysql_client_test.c\ -diff -ruN mysql-5.0.51.orig/tools/Makefile.in mysql-5.0.51/tools/Makefile.in ---- mysql-5.0.51.orig/tools/Makefile.in 2007-12-07 12:59:19.000000000 +0000 -+++ mysql-5.0.51/tools/Makefile.in 2007-12-07 13:02:32.000000000 +0000 -@@ -369,7 +369,7 @@ - $(openssl_includes) - - LDADD = @CLIENT_EXTRA_LDFLAGS@ \ -- $(top_builddir)/libmysql_r/libmysqlclient_r.la \ -+ /usr/lib/mysql/libmysqlclient_r.so \ - @openssl_libs@ @yassl_libs@ @ZLIB_LIBS@ - - mysqltestmanager_SOURCES = mysqlmanager.c diff --git a/abs/core/mysql/mysql.install b/abs/core/mysql/mysql.install new file mode 100644 index 0000000..9e9011d --- /dev/null +++ b/abs/core/mysql/mysql.install @@ -0,0 +1,20 @@ +post_install(){ + groupadd -g 89 mysql &>/dev/null + useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null + usr/bin/mysql_install_db --user=mysql + chown -R mysql:mysql var/lib/mysql &>/dev/null +} + +post_upgrade(){ + getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null + getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null +} + +post_remove(){ + if getent passwd mysql >/dev/null 2>&1; then + userdel mysql + fi + if getent group mysql >/dev/null 2>&1; then + groupdel mysql + fi +} diff --git a/abs/core/mysql/mysqld b/abs/core/mysql/mysqld index 5857df8..1ac88a7 100755 --- a/abs/core/mysql/mysqld +++ b/abs/core/mysql/mysqld @@ -1,48 +1,35 @@ #!/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 -PID=`pidof -o %PPID /usr/sbin/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 -p $MYSQLD_ROOT - /usr/bin/mysql_install_db --datadir=$MYSQLD_ROOT --user=mysql 2>/dev/null 1>/dev/null - chown -R mysql.mysql $MYSQLD_ROOT -fi +getPID() { + echo $(pgrep -u mysql mysqld 2>/dev/null); +} case "$1" in start) - stat_busy "Starting MySQL" - if [ -z "$PID" ]; then - /usr/bin/mysqld_safe --skip-name-resolve --datadir=$MYSQLD_ROOT >/dev/null 2>/dev/null & + stat_busy "Starting MySQL Server" + [ ! -d /var/run/mysqld ] && install -d -g mysql -o mysql /var/run/mysqld &>/dev/null + if [ -z "$(getPID)" ]; then + /usr/bin/mysqld_safe --user=mysql &>/dev/null & if [ $? -gt 0 ]; then stat_fail exit 1 else - sleep 1 # wait on children - PID=`pidof -o %PPID /usr/sbin/mysqld` - if [ -z "$PID" ]; then + 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 $PID >/var/run/mysqld.pid + echo $(getPID) > /var/run/mysqld/mysqld.pid add_daemon mysqld stat_done fi @@ -54,16 +41,25 @@ case "$1" in ;; stop) - stat_busy "Stopping MySQL" - if [ ! -z "$PID" ]; then - kill $PID &> /dev/null + stat_busy "Stopping MySQL Server" + if [ ! -z "$(getPID)" ]; then + timeo=30 + kill $(getPID) &> /dev/null if [ $? -gt 0 ]; then stat_fail exit 1 - else - rm -f /var/run/mysqld.pid &>/dev/null + fi + while [ ! -z "$(getPID)" -a $timeo -gt 0 ]; do + sleep 1 + let timeo=${timeo}-1 + done + if [ -z "$(getPID)" ]; then + rm -f /var/run/mysqld/mysqld.pid &>/dev/null rm_daemon mysqld stat_done + else + stat_fail + exit 1 fi else stat_fail @@ -73,10 +69,9 @@ case "$1" in restart) $0 stop - sleep 3 $0 start ;; *) - echo "usage: $0 {start|stop|restart}" + echo "usage: $0 {start|stop|restart}" esac exit 0 diff --git a/abs/core/mysql/mysqld.conf.d b/abs/core/mysql/mysqld.conf.d deleted file mode 100644 index 10b7098..0000000 --- a/abs/core/mysql/mysqld.conf.d +++ /dev/null @@ -1 +0,0 @@ -MYSQLD_ROOT="/data/srv/mysql" diff --git a/abs/core/mysql/skip-abi-check.patch b/abs/core/mysql/skip-abi-check.patch new file mode 100644 index 0000000..6791deb --- /dev/null +++ b/abs/core/mysql/skip-abi-check.patch @@ -0,0 +1,13 @@ +--- Makefile.in.orig 2010-05-28 20:03:46.507224494 +0200 ++++ Makefile.in 2010-05-28 20:04:05.737221909 +0200 +@@ -1126,10 +1126,8 @@ + # + + abi_check: $(API_PREPROCESSOR_HEADER) +- $(MAKE) abi_headers="$^" do_abi_check + + abi_check_all: $(TEST_PREPROCESSOR_HEADER) +- $(MAKE) abi_headers="$^" do_abi_check + + do_abi_check: + set -ex; \ |