summaryrefslogtreecommitdiff
path: root/community/imdbpy/PKGBUILD
blob: accdb0c1962d724b1f3fa8fc843cb453a0e17368 (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
# $Id: PKGBUILD 67897 2012-03-15 23:14:25Z ebelanger $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: lang2 <wenzhi.liang@gmail.com>

pkgname=imdbpy
_realname=IMDbPY
pkgver=4.8.2
pkgrel=2
pkgdesc="Python bindings for the Internet Movie Database (IMDb)"
url="http://imdbpy.sourceforge.net/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('python2')
makedepends=('python2-distribute')
optdepends=('python2-lxml' 'python2-sqlalchemy' 'python2-sqlobject')
source=(http://downloads.sourceforge.net/$pkgname/$_realname-$pkgver.tar.gz)
md5sums=('6644540206c5023cb332637089d5342d')

build(){
  cd "$srcdir/$_realname-$pkgver"

  # python2 fix
  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

  python2 setup.py install --root="$pkgdir" --optimize=1

  # fix paths
  # WTH is upstream doing?
  # TODO: report upstream about this nasty
  mv "$pkgdir/usr/etc" "$pkgdir"
  mkdir -p "$pkgdir/usr/share/doc"
  #mv "$pkgdir/usr/imdb" "$pkgdir/usr/share"
  mv "$pkgdir/usr/doc" "$pkgdir/usr/share/doc/imdb"
}