summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAndy Weidenbaum2015-06-09 11:41:59 -0700
committerAndy Weidenbaum2015-06-09 11:41:59 -0700
commitc069690d30607fe77a2ed16d89f134a001a69e50 (patch)
treea0f62c0ed2b4cc09dd0eebcfd9cf045639778829 /PKGBUILD
downloadaur-stlviewer-git.tar.gz
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD51
1 files changed, 51 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..01d6df9a88cf
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,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 '{}' +
+}