updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / caffeine / PKGBUILD
blob0e24e02d75bc84c1e85664d8e9c0f95c22d54b76
1 # Maintainer: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
2 # Contributor: LookTJ/Taylor Lookabaugh <jesus {dot} christ {dot} i {dot} love {at} gmail {dot} com>
3 # Contributor: alessandro_ufms
5 pkgname=caffeine
6 pkgver=424
7 pkgrel=1
8 pkgdesc="A system applet that allows you to inhibit the screensaver and the sleep power saving mode in an easy way"
9 arch=('any')
10 url="https://launchpad.net/caffeine"
11 license=('GPL')
12 depends=('dbus-python' 'gtk2' 'python2-gobject' 'python-notify' 'python-xlib' 'python2' 'dconf' 'pyxdg' 'kaa-metadata' 'hicolor-icon-theme')
13 makedepends=('bzr')
14 options=('!libtool' '!emptydirs')
15 install=caffeine.install
16 source=('https://launchpadlibrarian.net/85513438/patch.diff')
17 sha512sums=('7da99040796528f8654518d498e9749a826469aad7d14734f4de2a395032677fa0fdc590371e883edf96294cf8fe062533daddfcb13abfa0d89d6e43f05ee795')
19 _bzrtrunk="lp:caffeine"
20 _bzrmod="caffeine"
22 build()
24   cd "${srcdir}"
25   msg "Connecting to Bazaar server...."
27   if [[ -d "${_bzrmod}" ]]; then
28     cd "${_bzrmod}" && bzr pull "${_bzrtrunk}" -r "${pkgver}"
29     msg "The local files are updated."
30   else
31     bzr branch "${_bzrtrunk}" "${_bzrmod}" -q -r "${pkgver}"
32   fi  
33   msg "Bazaar checkout done or server timeout"
35   # export without .bzr directory
36   cd "${srcdir}"
37   rm -rf "${_bzrmod}-build"
38   bzr export "${_bzrmod}-build" -q -d "${_bzrmod}"
40   cd "${srcdir}/${_bzrmod}-build"
42   # Thanks to AndrĂ© Ericson for the patch!
43   # https://bugs.launchpad.net/caffeine/+bug/892663
44   patch -Np0 -i "${srcdir}/patch.diff"
46   # use python2 for version 2, instead of python (version 3)
47   for i in utils core procmanager main applicationinstance __init__ flash_detect; do
48     sed 's/python/python2/' -i caffeine/${i}.py
49   done
52 package() {
53   cd "${srcdir}/${_bzrmod}-build"
54   python2 setup.py install --root="${pkgdir}"