# $Id: PKGBUILD 138307 2015-08-13 18:48:22Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=systemd-kcm
pkgver=1.2.1
pkgrel=1
pkgdesc="Systemd control module for KDE"
arch=('i686' 'x86_64')
url='https://github.com/rthomsen/kcmsystemd'
license=(GPL)
depends=(kio)
makedepends=(extra-cmake-modules python)
conflicts=(kcmsystemd)
replaces=(kcmsystemd)
source=("http://download.kde.org/stable/$pkgname/$pkgname-$pkgver.tar.xz")
md5sums=('9081233ce9bb356eaacc5ab247c6dbb2')

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
}
