# Description : KDE Plasma çalışma alanı
# URL: https://www.kde.org/
# Packager: alihan-ozturk@hotmail.com
# Depends on: consolekit2 kf5-baloo kf5-kdesu kf5-kdewebkit kf5-kjsembed kf5-knotifyconfig kf5-krunner plasma-kwin kf5-kxmlrpcclient plasma-libkscreen plasma-libksysguard kf5-networkmanager-qt kf5-ktexteditor kf5-kwayland libdbusmenu-qt5 pm-utils gvfs plasma-kscreenlocker plasma-breeze plasma-kactivitymanagerd kholidays

name=plasma-workspace
version=5.8.1
release=1

source=( http://download.kde.org/stable/plasma/$version/$name-$version.tar.xz
         kscreensaver.pam)

build() {
cd $name-$version
cmake -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_BUILD_TYPE=Release  \
      -DLIB_INSTALL_DIR=lib       \
      -DBUILD_TESTING=OFF         \
      -Wno-dev
      
make
make DESTDIR=$PKG install

sed 's|qtpaths|qtpaths-qt5|' -i $PKG/usr/bin/startkde
sed 's|qtpaths|qtpaths-qt5|' -i $PKG/usr/bin/startplasmacompositor

mkdir -p $PKG/etc/pam.d

cat > $PKG/etc/pam.d/kde << "EOF"
# Begin /etc/pam.d/kde

auth     include        system-auth
account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/kde
EOF

install -v -dm755 $PKG/usr/share/xsessions
ln -sfv /usr/share/xsessions/plasma.desktop $PKG/usr/share/xsessions/kf5-plasma.desktop

install -D -m644 $SRC/kscreensaver.pam $PKG/etc/pam.d/kscreensaver
}
