summaryrefslogtreecommitdiffstats
path: root/abs/core/mysql/PKGBUILD
blob: 3ce1aeb7a2619ba2084c81c6031b243a80feb5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# $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>

pkgbase=mysql
pkgname=('libmysqlclient' 'mysql-clients' 'mysql')
pkgver=5.1.59
pkgrel=1
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/${pkgbase}-${pkgver}.tar.gz"
        'mysqld'
        'my.cnf'
        'skip-abi-check.patch')

build() {
  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 || return 1
}

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
}

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=('1e89816164692f44f768024db4bc05f6'
         '2234207625baa29b2ff7d7b4f088abce'
         'd60099985e68e36b156423fca6b50924'
         'a97e574945e19de3908575b956241026')