1 # Maintainer: Andrea Repetto <darkraziel at libero dot it>
6 pkgdesc="Powershield 3 UPS Monitor for Riello UPS series"
8 url="http://www.riello-ups.com/?en/downloads/1/powershield3-free"
11 optdepends=('java-runtime: to execute the graphical utilities')
12 source=(upsmon.d ups-run-as-root
13 xupsetup.desktop xupsview.desktop xwizsetup.desktop)
14 md5sums=('e27cf56a3019669d198759ce464d3d20'
15 '4948b07103213041b911bf8571706911'
16 'a9db7ed077c02d14f3b2bf08a053ff76'
17 '55d6adbd80341faf59ff7ad0eb5765dd'
18 '7b0aeda87f3c5b02d6358be2802b5c70')
19 if [ "$CARCH" = "i686" ]; then
21 _pkg="$pkgname-$pkgver-linux-2.6-$_arch"
22 source+=("http://www.riello-ups.com/areaftp/Linux-RedHat-i386/$_pkg.rpm")
23 md5sums+=('0e32179283180315597aefc13f7b5895')
24 elif [ "$CARCH" = "x86_64" ]; then
26 _pkg="$pkgname-$pkgver-linux-2.6-$_arch"
27 source+=("http://www.riello-ups.com/areaftp/Linux-RedHat-x86_64/$_pkg.rpm")
28 md5sums+=('d38b3bde8b5d4457874d774934ae2756')
31 install=upsmon.install
32 backup=('opt/upsmon/upsmon.ini')
38 # Unpack the rpm package
42 install -D -m644 $srcdir/opt/$pkgname/License.txt \
43 "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
46 install -d $pkgdir/etc/rc.d/
47 install -D -m755 $srcdir/upsmon.d $pkgdir/etc/rc.d/upsmon
50 install -d $pkgdir/opt/$pkgname
51 cp -r $srcdir/opt/$pkgname/* $pkgdir/opt/$pkgname
53 # Replace init.d with rc.d in the start/stop/restart scripts
54 cd $pkgdir/opt/$pkgname
55 echo upsstart upsstop upsrestart | xargs sed -i 's/init.d/rc.d/'
57 # Copy files in /usr/bin
58 install -D -m755 $srcdir/ups-run-as-root $pkgdir/usr/bin/ups-run-as-root
60 # Create scripts for running applications
61 install -d $pkgdir/usr/bin
63 local _apps=(upsetup upsview xupsetup xupsview xwizsetup)
64 for _app in ${_apps[@]}; do
65 cat > $pkgdir/usr/bin/$_app <<EOF
71 chmod 755 $pkgdir/usr/bin/$_app
74 # Fix permissions for directories
75 chmod a+x $pkgdir/opt/upsmon/images
76 chmod a+x $pkgdir/opt/upsmon/html
79 install -d $pkgdir/usr/share/applications
80 install -D -m644 $srcdir/xupsetup.desktop $pkgdir/usr/share/applications/
81 install -D -m644 $srcdir/xupsview.desktop $pkgdir/usr/share/applications/
82 install -D -m644 $srcdir/xwizsetup.desktop $pkgdir/usr/share/applications/
85 # vim:set ts=2 sw=2 et: