# $Id: PKGBUILD 130598 2015-04-03 21:22:56Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=kcmsystemd
pkgver=1.1.0
pkgrel=2
pkgdesc="Systemd control module for KDE"
arch=('i686' 'x86_64')
url='https://github.com/rthomsen/kcmsystemd'
license=(GPL)
depends=(kconfigwidgets boost-libs)
makedepends=(extra-cmake-modules python boost)
optdepends=('kde-cli-tools: to edit unit files' 'kwrite: to edit unit files')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rthomsen/kcmsystemd/archive/$pkgver.tar.gz")
md5sums=('8d385b1b2f9c0f054a8de16a50dcbaaa')

prepare() {
  mkdir -p build

# fix kdesu path (FS#44396)
  sed -e 's|/lib/libexec/kdesu|/lib/kf5/kdesu|' -i $pkgname-$pkgver/src/kcmsystemd.cpp
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
   -DCMAKE_INSTALL_PREFIX=/usr \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_INSTALL_LIBDIR=lib \
   -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
