summaryrefslogtreecommitdiff
path: root/pcr/python2-potr/PKGBUILD
blob: e3cbe46514771cace1e73205b45da038d79b4b90 (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
# Maintainer (Arch): Michael Düll <mail@akurei.me>

pkgname=python2-potr
pkgver=1.0.0
pkgrel=4
pkgdesc="This is a pure Python2 OTR implementation; it does not bind to libotr."
arch=(any)
url="https://github.com/afflux/pure-python-otr"
license=('LGPL')
depends=('python2' 'python2-crypto')
conflicts=('python-potr-git' 'python-potr')
replaces=('python-potr')
#options=(!emptydirs)
source=("https://github.com/python-otr/pure-python-otr/archive/${pkgver}.tar.gz")
sha512sums=('46b0dab24cab68e695661c5982ba25823e39540ecef7e90693898342f44e52afa549d8708166ebef81474aee3f846d8b76690e3061fa1bc65147e804751f8f48')

PYTHON=`which python2`

#build() {
#  cd $srcdir/afflux*
#  set_python2
#  $PYTHON ./setup.py build
#}

prepare() {
  cd $srcdir/pure-python-otr-${pkgver}
  set_python2
}

package() {
  cd $srcdir/pure-python-otr-${pkgver}
  $PYTHON ./setup.py install --root=$pkgdir/
}

# To use python2 instead of default python v3.
set_python2() {
  for file in $(find . -name '*.py' -print); do
    sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' "${file}"
    sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' "${file}"
  done
}


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