# $Id: PKGBUILD 240839 2015-06-14 20:32:35Z arojas $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Antonio Rojas <arojas@archlinux.org>

pkgname=bluedevil
pkgver=5.3.1
pkgrel=2
epoch=1
pkgdesc='Integrate the Bluetooth technology within KDE workspace and applications'
arch=('i686' 'x86_64')
url='https://projects.kde.org/projects/kde/workspace/bluedevil'
license=('GPL2')
depends=('bluez-qt' 'kio')
makedepends=('extra-cmake-modules' 'plasma-framework' 'kded')
conflicts=('bluedevil-frameworks')
replaces=('bluedevil-frameworks')
install="$pkgname.install"
groups=('plasma')
source=("http://download.kde.org/stable/plasma/$pkgver/$pkgname-$pkgver.tar.xz" 'bluez-qt-5.11.patch')
md5sums=('b75a7a3ace3a1c8d6b4410dd69bb4bc4'
         '7e77b162322c27084b56ca4d88af5d4b')

prepare() {
  mkdir -p build

# Port to bluez-qt 5.11 API
  cd $pkgname-$pkgver
  patch -p1 -i "$srcdir"/bluez-qt-5.11.patch
}

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

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