diff options
author | Chris Severance | 2015-08-20 07:42:44 -0400 |
---|---|---|
committer | Chris Severance | 2015-08-20 07:42:44 -0400 |
commit | 8545edee8773a154b1251c2f63820b65fee3ac51 (patch) | |
tree | 10385d96260a8daa110d49423d07f8d837a3d3e6 | |
parent | c85570da2d140a89ed1134eecc5facf533841beb (diff) | |
download | aur-8545edee8773a154b1251c2f63820b65fee3ac51.tar.gz |
Adjustable www name, fix version
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 93 | ||||
-rw-r--r-- | adminer.install | 33 |
3 files changed, 88 insertions, 46 deletions
@@ -1,6 +1,6 @@ pkgbase = adminer-git - pkgdesc = Adminer (formerly phpMinAdmin) is a full-featured MySQL management tool written in PHP. GIT version. - pkgver = v4.1.0.r0.g6aed2f5 + pkgdesc = a full-featured MySQL management tool written in PHP. Formerly phpMinAdmin. + pkgver = 4.2.2.r0.g596f8df pkgrel = 1 url = http://www.adminer.org install = adminer.install @@ -14,10 +14,10 @@ pkgbase = adminer-git optdepends = postgresql optdepends = sqlite: for sqlite3 optdepends = sqlite2 - provides = adminer + provides = adminer=4.2.2 conflicts = adminer source = adminer-git::git://adminer.git.sourceforge.net/gitroot/adminer/adminer - md5sums = SKIP + sha256sums = SKIP pkgname = adminer-git @@ -1,48 +1,77 @@ -# Maintainer: Sabart Otto - Seberm <seberm[at]gmail[dot].com +# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com +# Contributor: Sabart Otto - Seberm <seberm[at]gmail[dot].com # Contributor: Uzsolt -pkgname=adminer-git -_gitname=adminer +[ ! -s 'PKGBUILD.local' ] && cat > 'PKGBUILD.local' << EOF +# adminer or another name for your link +_opt_WWWName='adminer' # default: adminer +#_opt_WWWName='' -pkgver=v4.1.0.r0.g6aed2f5 +# Supply a long hext code generated at https://www.grc.com/passwords.htm +# Your server will be at http://localhost/adminer-LONGHEXCODE/ +# This will make it hard to find on a public facing server. +# Save your server as a link. +_opt_HexCode='' # default: blank +#opt_HexCode='' +EOF +. 'PKGBUILD.local' + +set -u +test ! -z "${_opt_HexCode}" && _opt_HexCode="-${_opt_HexCode}" + +_pkgname='adminer' +pkgname="${_pkgname}-git" +pkgver=4.2.2.r0.g596f8df pkgrel=1 -pkgdesc="Adminer (formerly phpMinAdmin) is a full-featured MySQL management tool written in PHP. GIT version." -url="http://www.adminer.org" +pkgdesc='a full-featured MySQL management tool written in PHP. Formerly phpMinAdmin.' arch=('any') +url='http://www.adminer.org' license=('Apache License, Version 2.0') -install= depends=('php') optdepends=('mariadb' 'apache' 'adminer-skins: various CSS skins for adminer' 'postgresql' 'sqlite: for sqlite3' 'sqlite2') -conflicts=("adminer") -provides=('adminer') makedepends=('git') -install=adminer.install -source=("$pkgname"::'git://adminer.git.sourceforge.net/gitroot/adminer/adminer') - -md5sums=('SKIP') - +provides=("${_pkgname}=${pkgver%%.r*}") +conflicts=("${_pkgname}") +install="${_pkgname}.install" +_verurl="${url}" +_versed='http://downloads.sourceforge.net/adminer/adminer-\([0-9\.]\+\).php' +_veropt='l' +source=("${pkgname}::git://adminer.git.sourceforge.net/gitroot/adminer/adminer") +sha256sums=('SKIP') pkgver() { - cd "$srcdir/$pkgname" - git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g' + set -u + cd "${srcdir}/${pkgname}" + git describe --long --tags | sed -e 's/^v//g' -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' + set +u } package() { - _instdir=$pkgdir/usr/share/webapps/$_gitname - mkdir -p ${_instdir} $pkgdir/etc/webapps/$_gitname $pkgdir/etc/httpd/conf/extra - - cp -R $srcdir/$pkgname/$_gitname/* $_instdir - - # It's similar to phpMyAdmin - cat >$pkgdir/etc/webapps/$_gitname/apache.example.conf <<EOF - Alias /${_gitname} "/usr/share/webapps/${_gitname}" - <Directory "/usr/share/webapps/${_gitname}"> - AllowOverride All - Options FollowSymlinks - Require all granted - php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/" - </Directory> + set -u + cd "${srcdir}/${pkgname}" + + install -d "${pkgdir}/usr/share/webapps/" + cp -pR "${_pkgname}" "${pkgdir}/usr/share/webapps/" + + # .. is unreachable with our php_admin_value open_basedir limits. + sed -i -e 's:../adminer/::g' $(grep -lr '../adminer/' "${pkgdir}/usr/share/webapps/") + + # 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 - cp $pkgdir/etc/webapps/$_gitname/apache.example.conf $pkgdir/etc/httpd/conf/extra/httpd-${_gitname}.conf -# echo "Include conf/extra/httpd-${pkgname}.conf" >> $pkgdir/etc/httpd/conf/httpd.conf + ) "${pkgdir}/etc/webapps/${_pkgname}/apache.example.conf" + + install -Dpm644 "${pkgdir}/etc/webapps/${_pkgname}/apache.example.conf" "${pkgdir}/etc/httpd/conf/extra/httpd-${_pkgname}.conf" + #echo "Include conf/extra/httpd-${pkgname}.conf" >> ${pkgdir}/etc/httpd/conf/httpd.conf + set +u } +set +u diff --git a/adminer.install b/adminer.install index 4e4ac3de7b2f..9a17b48cf0fd 100644 --- a/adminer.install +++ b/adminer.install @@ -1,17 +1,30 @@ -TEXT=' -If you want to access adminer interface by your apache server, run following command as root:\n -echo "Include conf/extra/httpd-adminer.conf" >> /etc/httpd/conf/httpd.conf\n\n +_instname='Adminer' +_instwww="${_instname,,}" +_instwww="${_instwww// /-}" +_inststr="Include conf/extra/httpd-${_instwww}.conf" +_instfile='/etc/httpd/conf/httpd.conf' -And restart your apache running "rc.d restart httpd"\n -Or (if you are using systemd) "systemctl restart httpd"\n\n - -After you can browse adminer on http://localhost/adminer\n'; +post_install() { + if ! grep -ql "^${_inststr}"'$' "${_instfile}"; then + local TEXT=" +If you want to access ${_instname} by your Apache server, run following command as root: +echo '${_inststr}' >> '${_instfile}' +And restart your Apache running 'rc.d restart httpd' +Or (if you are using systemd) 'systemctl restart httpd' -post_install() { - echo -e $TEXT; +After you can browse ${_instname} on http://localhost/${_instwww}"; + echo -e "${TEXT}" + fi } post_upgrade() { - echo -e $TEXT; + post_install +} + +post_remove() { + if grep -ql "^${_inststr}"'$' "${_instfile}"; then + echo "To completely remove ${_instname}, remove its include from ${_instfile}" + echo 'and restart your httpd server' + fi } |