# Maintainer : Martin Wimpress <code@flexion.org>

pkgname=mate-power-manager
pkgver=1.8.1
_major=$(echo ${pkgver} | cut -d= -f2 | cut -d. -f1-2)
pkgrel=4
pkgdesc="Power management tool for the MATE desktop."
url="http://mate-desktop.org"
arch=('i686' 'x86_64')
license=('GPL')
depends=('dbus-glib' 'dconf' 'libcanberra' 'libgnome-keyring' 'libnotify'
         'libunique' 'upower')
makedepends=('docbook2x' 'docbook-xml' 'mate-common' 'mate-panel' 'xmlto' 'yelp-tools')
optdepends=('mate-panel: Set brightness and inhibit power management from the panel'
            'yelp: for reading MATE help documents')
groups=('mate-extra')
source=("http://pub.mate-desktop.org/releases/${_major}/${pkgname}-${pkgver}.tar.xz")
sha1sums=('0f2d509b8af30e79013de564ea9a0a3d7ccd7c93')
install=${pkgname}.install

prepare() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    #Work around a problem where the .sgml fail to parse.
    sed -e 's:@HAVE_DOCBOOK2MAN_TRUE@.*::' -i man/Makefile.in
}

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    ./configure \
        --prefix=/usr \
        --libexecdir=/usr/lib/${pkgname} \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --sbindir=/usr/bin \
        --enable-applets \
        --enable-unique
    make
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    make DESTDIR="${pkgdir}" install
}
