# Depends on: dconf gtk3 libcanberra libwnck libnotify

description="Notification daemon for MATE"
url="https://mate-desktop.org/"
packager="tnut <tnut@nutyx.org>"
contributors="fanch,tnut,greg,jayce"

name=mate-notification-daemon
version=1.20.1

source=(http://pub.mate-desktop.org/releases/${version%.*}/$name-$version.tar.xz)

build() {

  cd $name-$version
  ./configure  --prefix=/usr \
          --libexecdir=/usr/lib/${name}
  make
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make DESTDIR=$PKG install
  
}

uptodate() {
feed=https://github.com/mate-desktop/$name/releases.atom 
exec="lynx -read_timeout=20 -dump -listonly -nonumbers $feed"
ligne=1 # nombre de notification ? afficher
$exec $feed | grep title | \
sed "s@<title>@@" | \
sed "s@</title>@@" | \
sed "s@v@@" | sed "s@ @@g" | \
head -n $(($ligne+1 )) | \
tail -n $(($ligne))
}
