summaryrefslogtreecommitdiff
path: root/community/cinnamon-screensaver/PKGBUILD
blob: 66ed0d014204c208f0746a0cc764341b21955656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Alexandre Filgueira <alexfilgueira@cinnarch.com>
# Based on gnome-screensaver package:
# Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Jan de Groot <jgc@archlinux.org>

pkgname=cinnamon-screensaver
pkgver=2.0.0
pkgrel=1
pkgdesc="Screensaver designed to integrate well with the Cinnamon desktop."
arch=('i686' 'x86_64')
license=('GPL')
url="https://github.com/linuxmint/cinnamon-screensaver"
backup=(etc/pam.d/cinnamon-screensaver)
depends=('cinnamon' 'cinnamon-desktop')
makedepends=('intltool' 'gnome-common')
options=(!emptydirs)
source=($pkgname-$pkgver.tar.gz::https://github.com/linuxmint/cinnamon-screensaver/archive/$pkgver.tar.gz
       cinnamon-screensaver.pam
       fix-dbus-compatibility.patch
       lock_screen_on_suspend.patch)
sha256sums=('90da7f811892f667202ecd1240091f9c4d253eebe223bbfedb3d544dd68b3fc7'
            'b6ea9e2eb586d94bcabb617a8f1c2958111df87afdbb51f645882bccdc15cbda'
            'eebd1d056c21d2d3f60fb954677b9214fd1d575ed1c2bbb56326cedf41a39eb6'
            '516c479558576c6c5a2509abfcbf4fdafb5953d252e7a4ab972f9db6137daca8')

prepare() {
  cd $pkgname-$pkgver

  # Fix compatibility with gnome-screensaver's D-Bus interface and various fixes
  patch -Np1 -i ${srcdir}/fix-dbus-compatibility.patch

  # Lock screen on suspend with systemd
  patch -Np1 -i ${srcdir}/lock_screen_on_suspend.patch
}

build() {
  cd $pkgname-$pkgver

  ./autogen.sh --prefix=/usr --sysconfdir=/etc \
               --libexecdir=/usr/lib/cinnamon-screensaver \
               --localstatedir=/var \
               --with-mit-ext --with-systemd
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 ../cinnamon-screensaver.pam "$pkgdir/etc/pam.d/cinnamon-screensaver"

  # Autostart only in Cinnamon
  cp "$pkgdir/etc/xdg/autostart/cinnamon-screensaver.desktop" \
    "$pkgdir/etc/xdg/autostart/cinnamon2d-screensaver.desktop"
  sed -i 's/^OnlyShowIn=.*/OnlyShowIn=GNOME;/' \
    "$pkgdir"/etc/xdg/autostart/cinnamon{,2d}-screensaver.desktop
  echo 'AutostartCondition=GNOME3 if-session cinnamon' \
    >> "$pkgdir/etc/xdg/autostart/cinnamon-screensaver.desktop"
  echo 'AutostartCondition=GNOME3 if-session cinnamon2d' \
    >> "$pkgdir/etc/xdg/autostart/cinnamon2d-screensaver.desktop"
}