updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / phpsysinfo / PKGBUILD
blob5d335083e88cec2aa298a97bef581a6a534c4261
1 # ExContributor: Cagnulein <cagnulein@tin.it>
2 # Contributor: Filip <fila@pruda.com>
4 pkgname=phpsysinfo
5 pkgver=3.0.15
6 pkgrel=1
7 pkgdesc="PHP script that displays information about the host being accessed."
8 arch=('any')
9 license=('GPL2')
10 url="http://phpsysinfo.sourceforge.net/"
11 backup=(etc/webapps/phpsysinfo/config.php
12         etc/webapps/phpsysinfo/.htaccess
13         etc/webapps/phpsysinfo/plugins/{BAT,ipmi,MDStatus,PS,PSStatus,Quotas,SMART,SNMPPInfo,UpdateNotifier}.config.php)
14 depends=('php')
15 optdepends=('lm_sensors: for providing temperature')
16 source=(http://downloads.sourceforge.net/sourceforge/phpsysinfo/phpsysinfo/$pkgver/$pkgname-$pkgver.tar.gz)
17 md5sums=('90b65354bf41c17beac5ac0c5336762c')
19 build() {
21   _destdir=$pkgdir/usr/share/webapps/phpsysinfo
22   _destdir_etc=$pkgdir/etc/webapps/phpsysinfo
23   
24   install -dm755 ${_destdir}
25   install -dm755 ${_destdir_etc}/plugins
26   
27   cp -r $srcdir/$pkgname/* ${_destdir}
28   
29   # fix all the 755 perms on files
30   find ${_destdir}/* -type f -exec chmod 644 {} \;
31   find ${_destdir}/* -type d -exec chmod 755 {} \;
32   
33   #etc
34   mv ${_destdir}/config.php.new ${_destdir_etc}/config.php
35   ln -s /etc/webapps/phpsysinfo/config.php ${_destdir}/config.php
36   touch ${_destdir_etc}/.htaccess
37   ln -s /etc/webapps/phpsysinfo/.htaccess ${_destdir}/.htaccess
38   
39   #plugins
40   for _plugin_name in BAT ipmi MDStatus PS PSStatus Quotas SMART SNMPPInfo UpdateNotifier; do
41         mv ${_destdir}/plugins/${_plugin_name}/${_plugin_name}.config.php ${_destdir_etc}/plugins/${_plugin_name}.config.php
42         ln -s /etc/webapps/phpsysinfo/plugins/${_plugin_name}.config.php ${_destdir}/plugins/${_plugin_name}/${_plugin_name}.config.php
43   done
44    
45   # apache
46   cat >${_destdir_etc}/apache.example.conf <<EOF
47         Alias /phpsysinfo "/usr/share/webapps/phpsysinfo"
48         <Directory "/usr/share/webapps/phpsysinfo">
49                 PHP_ADMIN_FLAG safe_mode off
50                 PHP_ADMIN_VALUE open_basedir none
51                 AllowOverride All
52                 Options FollowSymlinks
53                 Order allow,deny
54                 Allow from all
55         </Directory>
56 EOF