summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 48c95c7661ca1b7adcd4f1b3c91b6aee3c406ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Contributor: Lex Black <autumn-wind@web.de>
# Contributor: sqrlfish at gmail dot com

pkgname=python-gyb-git
_pkgname=got-your-back
pkgver=1.34.r0.g79f3da5
pkgrel=1
pkgdesc="Command line tool for backing up Gmail messages to your computer"
arch=('any')
url="https://github.com/jay0lee/${_pkgname}"
license=('Apache')
makedepends=('python-setuptools' 'git')
depends=('python>=3.5.0'
         'python-google-api-python-client')
provides=('gyb')
conflicts=("${_pkgname}")
options=(!emptydirs)
source=("git+https://github.com/jay0lee/${_pkgname}.git")
sha256sums=('SKIP')


pkgver() {
  cd "$_pkgname"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd "${_pkgname}"
	# Gyb uses the executable path for storing both client secrets, configuration
	# files, and flag files (like nobrowser.txt.)  We'll instead use
	# /usr/share/gyb/ for the static secrets, and the current directory for
	# anything user-configurable. This makes gyb behave as if the executable was
	# located in the current working directory, as is described in README.txt
	sed -i "s/CLIENT_SECRETS = getProgPath()/CLIENT_SECRETS = '\/usr\/share\/gyb\/'/" gyb.py
	sed -i "s/os\.path\.dirname(os\.path\.realpath(sys\.argv\[0\]))/os\.path\.curdir/" gyb.py
}

package() {
	cd "${_pkgname}"
	install -D -m755 gyb.py "${pkgdir}/usr/bin/gyb"
	install -D -m644 client_secrets.json "${pkgdir}/usr/share/gyb/client_secrets.json"
}

# vim:set ts=2 sw=2 et: