summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mysql/PKGBUILD
blob: f05364dea6d2356284f61ec1e29d2a6c976b7c02 (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 81345 2010-05-28 20:08:31Z jgc $
# 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.47
pkgrel=2
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" || return 1
  # 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 || return 1
  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 || return 1
  done
  install -m644 include/*.h "${pkgdir}/usr/include/mysql/" || return 1

  install -d "${pkgdir}/usr/bin"
  install -m755 scripts/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')
  
  cd "${srcdir}/${pkgbase}-${pkgver}/client"
  make DESTDIR="${pkgdir}" install || return 1

  # 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 || return 1

  install -Dm644 ${srcdir}/my.cnf ${pkgdir}/etc/mysql/my.cnf || return 1
  install -Dm755 ${srcdir}/mysqld ${pkgdir}/etc/rc.d/mysqld || return 1

  # 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=('02b9964b3966832f3d6bc87524bfd73f'
         'cc9e26e8d4eee750c001939232b947e5'
         '078f6e824d6097d558bcf7c16d508d92'
         'a97e574945e19de3908575b956241026')