summaryrefslogtreecommitdiff
path: root/community/python-pmw/PKGBUILD
blob: d220c84b88ff0783b8cf93b7bc0bfd531940bc7b (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
45
46
47
48
49
50
51
52
53
54
55
56
# $Id: PKGBUILD 108607 2014-03-29 19:51:02Z arcanis $
# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
# Contributor: kfgz <kfgz at interia dot pl>
# Contributor: Michael Krauss <hippodriver at gmx dot net>
# Contributor: dsa

pkgbase=python-pmw
pkgname=('python2-pmw' 'python-pmw')
pkgver=2.0.0
pkgrel=1
pkgdesc="A toolkit for high-level compound widgets in Python using the Tkinter module"
arch=('i686' 'x86_64')
url="http://pmw.sourceforge.net/"
license=('MIT')
depends=('python' 'python2' 'tk')
source=(${pkgname}-${pkgver}.tar.gz::http://sourceforge.net/projects/pmw/files/Pmw-${pkgver}.tar.gz/download
        "LICENSE.txt")
md5sums=('c7c3f26c4f5abaa99807edefee578fc0'
         '28b047a148c1780eddcf4bed6b150123')

prepare() {
  cp -r "Pmw-${pkgver}" "Pmw-${pkgver}-py2"
  # change python to python2
  cd "${srcdir}/Pmw-${pkgver}-py2"
  sed -i "s|python|python2|g" "Pmw/Pmw_2_0_0/tests/All.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_2_0_0/bin/bundlepmw.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_2_0_0/demos/All.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_1_3_3/tests/ManualTests.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_1_3_3/tests/All.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_1_3_3/bin/bundlepmw.py"
  sed -i "s|python|python2|g" "Pmw/Pmw_1_3_3/demos/All.py"
}

build() {
  cd "${srcdir}/Pmw-${pkgver}"
  python setup.py build

  cd "${srcdir}/Pmw-${pkgver}-py2"
  python2 setup.py build
}

package_python-pmw() {
  depends=('python' 'tk')

  cd "Pmw-${pkgver}"
  python setup.py install --prefix=/usr --root="${pkgdir}"
  install -Dm644 "${srcdir}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python2-pmw() {
  depends=('python2' 'tk')

  cd "Pmw-${pkgver}-py2"
  python2 setup.py install --prefix=/usr --root="${pkgdir}"
  install -Dm644 "${srcdir}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}