summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01d6df9a88cf2d36d797636131e399993e683456 (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
# Maintainer: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: yar

pkgname=stlviewer-git
pkgver=20150602
pkgrel=1
pkgdesc="Simple command line tool to view STL files"
arch=('i686' 'x86_64')
depends=('freeglut')
makedepends=('gcc' 'git' 'glu' 'python2')
url="https://github.com/vishpat/stlviewer/wiki"
license=('custom')
source=(git+https://github.com/vishpat/stlviewer
        LICENSE)
sha256sums=('SKIP'
            'f43ca3551171a46b73b45c0cb37f57408294feea87f7a840a5dc642edf6f68b2')
provides=('stlviewer')
conflicts=('stlviewer')

pkgver() {
  cd ${pkgname%-git}
  git log -1 --format="%cd" --date=short | sed "s|-||g"
}

prepare() {
  cd ${pkgname%-git}

  msg 'Fixing Python version...'
  find . -type f -print0 | xargs -0 sed -i 's#/usr/bin/python#/usr/bin/python2#g'
  find . -type f -print0 | xargs -0 sed -i 's#/usr/bin/env python#/usr/bin/env python2#g'
}

build() {
  cd ${pkgname%-git}

  msg 'Compiling...'
  python2 compile.py
}

package() {
  cd ${pkgname%-git}

  msg 'Installing executable...'
  install -D -m755 stlviewer "${pkgdir}/usr/bin/stlviewer"

  msg 'Installing license...'
  install -D -m644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE"

  msg 'Cleaning up pkgdir...'
  find "$pkgdir" -type d -name .git -exec rm -r '{}' +
}