summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 73602d32bfe358bd96c8cde5d27757a0cfd05e34 (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
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: Sabart Otto - Seberm <seberm[at]gmail[dot]com>

# TODO: The editor is stuck in the first database and won't let me into any others.

if [ ! -s 'PKGBUILD.local' ]; then
  cat > 'PKGBUILD.local' << EOF
# adminer-editor or another name for your link
_opt_WWWName='adminer-editor' # default: adminer-editor
#_opt_WWWName=''

# Supply a long hex code generated at https://www.grc.com/passwords.htm
# Your server will be at http://localhost/adminer-editor-LONGHEXCODE/
# This will make it hard to find on a public facing server.
# Bookmark the address.
_opt_HexCode='' # default: blank
#opt_HexCode=''

# A change to either of these and you must restart httpd
EOF
fi
. 'PKGBUILD.local'

set -u
if [ ! -z "${_opt_HexCode}" ]; then
  _opt_HexCode="-${_opt_HexCode}"
fi

_pkgname='adminer-editor'
pkgname="${_pkgname}"
pkgver=4.3.0
pkgrel=1
pkgdesc='Database data editing tool written in PHP'
arch=('any')
url='https://www.adminer.org/en/editor/'
license=('Apache')
depends=('php')
optdepends=('mariadb' 'apache' 'postgresql' 'sqlite' 'sqlite2')
_verwatch=("${url}" '/static/download/[0-9\.]\+/editor-\([0-9\.]\+\).php' 'l')
install="${_pkgname}.install"
#source=("http://downloads.sourceforge.net/adminer/editor-${pkgver}.php")
source=("https://www.adminer.org/static/download/${pkgver}/editor-${pkgver}.php")
sha256sums=('3615039440284a8afc20a9ae29f1627b4826e06d635c82ff8ea7077cd50697f9')

package() {
  set -u

  install -Dpm644 "${srcdir}/editor-${pkgver}.php" "${pkgdir}/usr/share/webapps/${_pkgname}/index.php"

  # Its similar to phpMyAdmin
  install -Dpm644 <(cat << EOF
# Installed by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
# http://aur.archlinux.org/
Alias /${_opt_WWWName}${_opt_HexCode} "/usr/share/webapps/${_pkgname}"
<Directory "/usr/share/webapps/${_pkgname}">
  AllowOverride All
  Options FollowSymlinks
    Require all granted
    php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"
</Directory>
EOF
  ) "${pkgdir}/etc/webapps/${_pkgname}/apache.example.conf"

  install -Dpm644 "${pkgdir}/etc/webapps/${_pkgname}/apache.example.conf" "${pkgdir}/etc/httpd/conf/extra/httpd-${_pkgname}.conf"
  set +u
}
set +u