# -*- shell-script -*-
#
# Contributor: Adrian C. <anrxc..sysphere.org>
pkgname=vicious-git
pkgver=20121215
_luaver="5.2"
pkgrel=1
pkgdesc="Modular widget library for window managers"
arch=("any")
url="http://git.sysphere.org/vicious/about/"
license=("GPL2")
depends=("lua")
makedepends=("git")
optdepends=("awesome: for which vicious was mainly written for"
"hddtemp: for the HDD Temp widget type"
"alsa-utils: for the Volume widget type"
"wireless_tools: for the Wireless widget type"
"curl: for widget types accessing network resources")
install="${pkgname}.install"
_gitroot=http://git.sysphere.org/vicious
_gitname=vicious
build() {
cd "${srcdir}"
# Download or update the library
msg "Connecting to GIT server over HTTP..."
if [[ -d "${_gitname}" ]]; then
(cd "${_gitname}" && git pull origin)
msg "The local repository was updated."
else
git clone "${_gitroot}" "${_gitname}"
msg "The remote repository was cloned."
fi
msg "GIT sync done, or server error (contact the maintainer)."
# Install the vicious library
install -d "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}"
install -m644 "${_gitname}/"*.lua "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}"
# Install vicious widgets
install -d "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}/widgets"
install -m644 "${_gitname}/widgets/"*.lua "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}/widgets"
# Install user contributed widgets
install -d "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}/contrib"
install -m644 "${_gitname}/contrib/"*.lua "${pkgdir}/usr/share/lua/${_luaver}/${_gitname}/contrib"
# Install the documentation
install -D -m644 "${_gitname}/CHANGES" "${pkgdir}/usr/share/doc/${_gitname}/CHANGES"
install -m644 "${_gitname}/TODO" "${pkgdir}/usr/share/doc/${_gitname}"
install -m644 "${_gitname}/README" "${pkgdir}/usr/share/doc/${_gitname}"
install -m644 "${_gitname}/LICENSE" "${pkgdir}/usr/share/doc/${_gitname}"
}