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
8 pkgdesc="A system applet that allows you to inhibit the screensaver and the sleep power saving mode in an easy way"
10 url="https://launchpad.net/caffeine"
12 depends=('dbus-python' 'gtk2' 'python2-gobject' 'python-notify' 'python-xlib' 'python2' 'dconf' 'pyxdg' 'kaa-metadata' 'hicolor-icon-theme')
14 options=('!libtool' '!emptydirs')
15 install=caffeine.install
16 source=('https://launchpadlibrarian.net/85513438/patch.diff')
17 sha512sums=('7da99040796528f8654518d498e9749a826469aad7d14734f4de2a395032677fa0fdc590371e883edf96294cf8fe062533daddfcb13abfa0d89d6e43f05ee795')
19 _bzrtrunk="lp:caffeine"
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."
31 bzr branch "${_bzrtrunk}" "${_bzrmod}" -q -r "${pkgver}"
33 msg "Bazaar checkout done or server timeout"
35 # export without .bzr directory
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
53 cd "${srcdir}/${_bzrmod}-build"
54 python2 setup.py install --root="${pkgdir}"