summaryrefslogtreecommitdiff
path: root/libre/mcomix/PKGBUILD
blob: f77b1877d5776cc8e97d41f718ac2ba908f3ea7e (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
57
58
59
# $Id: PKGBUILD 159677 2016-01-31 09:13:54Z schuay $
# Maintainer (Arch): schuay <jakob.gruber@gmail.com>
# Contributor (Arch): Ray Powell <ray_al@xphoniexx.net>
# Maintainer: André Silva <emulatorman@parabola.nu>

pkgname=mcomix
pkgver=1.2
pkgrel=1.parabola1
pkgdesc="A user-friendly, customizable image viewer specifically designed to handle comic books, without nonfree unrar support"
arch=('any')
url="http://sourceforge.net/projects/mcomix/"
license=('GPL')
depends=('pygtk' 'python2-pillow' 'xdg-utils' 'python2' \
         'desktop-file-utils' 'hicolor-icon-theme' 'python2-setuptools')
makedepends=('gettext' 'intltool')
conflicts=('comix' 'mcomix-libre')
replaces=('comix' 'mcomix-libre')
install='mcomix.install'
source=("http://downloads.sourceforge.net/project/mcomix/MComix-${pkgver}/mcomix-${pkgver}.tar.bz2"
        'libre.patch')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # Remove nonfree unRAR support
  rm -v mcomix/archive/rar{,_external}.py
  rm -v mime/icons/*/application-x-cbr.png
  patch -Np1 -i ${srcdir}/libre.patch
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # https://www.archlinux.org/todo/replace-pil-with-pillow/
  sed -i 's/import Image/from PIL import Image/' mime/comicthumb

  # python2 fix
  for file in $(grep -Rl "/usr/bin/env python" .);
  do
    sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' $file
  done
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}

  export PYTHONPATH=${pkgdir}/usr/lib/python2.7/site-packages/
  mkdir -p $PYTHONPATH

  python2 setup.py install --prefix=/usr --optimize=1 \
    --single-version-externally-managed --root=${pkgdir}

  install -Dm755 mime/comicthumb ${pkgdir}/usr/bin/comicthumb
  install -Dm644 mime/comicthumb.1.gz ${pkgdir}/usr/share/man/man1/comicthumb.1.gz
  install -Dm644 mime/comicbook.schemas ${pkgdir}/usr/share/gconf/schemas/mcomix.schemas
}

md5sums=('c879c6eb5888a80781b87c10c5de826c'
         '2fc7a69a673fbc4be5d1567489dd9b6e')