summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9582969f305e761d4c5befbae6003291eaa5f98f (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
# Maintainer:  Chris Severance aur.severach aATt spamgourmet dott com

# cli functionality has been tested.
# Web functionality has not been tested.

set -u
pkgname='mysqlconvertertool-git'
pkgver=r7.0fc9af5
pkgrel=1
pkgdesc='A fork of the MySQL Converter Tool (mysql to mysqli)'
arch=('any')
url='https://github.com/philip/MySQLConverterTool'
license=('PHP')
depends=('php')
makedepends=('git')
provides=("${pkgname%%-*}=1.0")
conflicts=("${pkgname%%-*}")
_srcdir="MySQLConverterTool"
source=("git+https://github.com/philip/MySQLConverterTool.git")
sha256sums=('SKIP')

pkgver() {
  set -u
  cd "${_srcdir}"
  printf "1.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  set +u
}

prepare(){
  set -u
  cd "${_srcdir}"
  #sed -i -e "s:^require_once(':&/usr/lib/mysqlconvertertool/:g" 'Converter.php' 'cli.php'
  set +u
}

package(){
  set -u
  cd "${_srcdir}"
  install -d "${pkgdir}/usr/lib/mysqlconvertertool"
  mv 'Function' 'GUI' 'Converter.php' 'cli.php' 'index.php' "${pkgdir}/usr/lib/mysqlconvertertool/"

  install -Dm755 <(cat << EOF
#!/usr/bin/bash
php -d 'open_basedir=NULL' -d 'include_path=/usr/lib/mysqlconvertertool/' -f /usr/lib/mysqlconvertertool/cli.php -- "\$@"
EOF
  ) "${pkgdir}/usr/bin/mysqlconvertertool"
  set +u
}
set +u