# Depends on: gssdp util-linux

description="An object-oriented UPNP framework"
url="http://gupnp.org/"
packager="tnut <tnut@nutyx.org>"
contributors="Fanchyannmaria"

name=gupnp
version=1.0.3
release=2

source=(http://ftp.gnome.org/pub/gnome/sources/gupnp/${version%.*}/${name}-${version}.tar.xz)

build() {
cd $name-$version
sed -i '1s|^#!.*python$|&2|' tools/gupnp-binding-tool
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-static --with-context-manager=linux
make
make DESTDIR=$PKG install
# Obsolet lib
rm $PKG/usr/lib/libgupnp-1.0.la
}
uptodate(){
local latest lastversion url
url="http://ftp.gnome.org/pub/gnome/sources/$name"
latest="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$url/?C=N\;O=D|grep [0-9]/$|head -1`"
lastversion="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$latest/?C=N\;O=D|grep LATEST|grep [0-9]$|cut -d "-" -f3`"
echo "$lastversion"
}
