summaryrefslogtreecommitdiff
path: root/extra/perl-dbd-mysql/PKGBUILD
blob: 11e53a1febec93d2ffe5ffebe87a6bb175ddabb8 (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
# $Id: PKGBUILD 143774 2011-11-29 02:55:27Z kevin $
# Maintainer: kevin <kevin@archlinux.org>
# Contributor: Eric Johnson <eric@coding-zone.com>

pkgname=perl-dbd-mysql
_realname=DBD-mysql
pkgver=4.020
pkgrel=1
pkgdesc="Perl/CPAN DBD::mysql module for interacting with MySQL via DBD"
arch=(i686 x86_64 'mips64el')
license=('GPL' 'PerlArtistic')
url="http://search.cpan.org/dist/${_realname}/"
depends=('libmysqlclient' 'perl-dbi' 'perl>=5.14.0')
makedepends=('mysql')
options=(!emptydirs)
source=(http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/${_realname}-${pkgver}.tar.gz)
md5sums=('a2bf8808bbd45298e84dde06afbd58e9')

build() {
  cd ${srcdir}/${_realname}-${pkgver}

  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor --testsocket=/tmp/socket.mysql
  make
}

check() {
  cd ${srcdir}/${_realname}-${pkgver}
  mkdir -p /tmp/mysql_test
  mysql_install_db \
     --basedir=/usr \
     --datadir=/tmp/mysql_test
  mysqld -P 17999 \
     --socket=/tmp/socket.mysql \
     --datadir=/tmp/mysql_test &
  sleep 10
  DAEMON_PORT=$!
  make test || true
  kill -9 $DAEMON_PORT
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make install DESTDIR=${pkgdir}

  # remove perllocal.pod and .packlist
  find ${pkgdir} -name perllocal.pod -delete
  find ${pkgdir} -name .packlist -delete
}