summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 47ff2f8b7e96a480aac5f7d2927f0d9e2979c650 (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
60
61
62
63
64
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>

pkgname=transolution
pkgver=0_4b8
pkgrel=1
pkgdesc="Computer Aided Translation (CAT) suite supporting the XLIFF standard"
arch=('any')
url="http://sourceforge.net/projects/eviltrans/"
license=('GPL')
depends=('python2' 'pygtk' 'desktop-file-utils' 'hicolor-icon-theme' 'xdg-utils')
optdepends=('4suite')
install=$pkgname.install
source=($pkgname.tar.bz2::http://bitbucket.org/fredrik_corneliusson/$pkgname/get/d91da181993c.bz2
        $pkgname.desktop)
sha256sums=('f9ab8dbedde7ba62af4aae56502027f1bb0af0c00c5d93b61d34a10d9a3330b3'
            '672bf984c3d12b3bf967d3980ea591c22c710f4a5bb80ffe33753f9d904238d5')

package() {
  cd "${srcdir}"/fredrik_corneliusson-transolution-*

  install -d "${pkgdir}"/usr/share/$pkgname \
             "${pkgdir}"/usr/bin \
             "${pkgdir}"/usr/share/$pkgname/filters

  cp -r * "${pkgdir}"/usr/share/$pkgname
  rm "${pkgdir}"/usr/share/$pkgname/*{bat,txt,ico,png}
  find "${pkgdir}"/usr/share/$pkgname/$pkgname -type f -exec chmod 644 "{}" \;
  install -Dm644 readme.txt "${pkgdir}"/usr/share/$pkgname/README

#links to run files
  for i in *.py
    do ln -s /usr/share/$pkgname/$i "${pkgdir}"/usr/bin/$i
  done

#icons and .desktop file
  install -Dm644 icon_16x16.png \
    "${pkgdir}"/usr/share/icons/hicolor/16x16/apps/$pkgname.png
  install -Dm644 icon_32x32.png \
    "${pkgdir}"/usr/share/icons/hicolor/32x32/apps/$pkgname.png
  install -Dm644 "${srcdir}"/$pkgname.desktop \
    "${pkgdir}"/usr/share/applications/$pkgname.desktop

# python2 fix
  cd "${pkgdir}"/usr/share/transolution
  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

#make executable
  cd "${pkgdir}"/usr/share/$pkgname/
  for i in *.py
    do chmod +x $i
  done

#links to filter files for easy use
  cd "${pkgdir}"/usr/share/$pkgname/$pkgname/filters/filter_settings
  for i in *.ini
    do ln -s /usr/share/$pkgname/$pkgname/filters/filter_settings/$i \
      "${pkgdir}"/usr/share/$pkgname/filters/$i
  done

  rm "${pkgdir}"/usr/{bin/win_setup.py,share/$pkgname/win_setup.py}
}