updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / retro-fossil / PKGBUILD
blobe92827ba3850d4da95607c49bdb1c652dff8b057
1 pkgname=retro-fossil
2 pkgver=11
3 pkgrel=4
4 pkgdesc="Retro is a portable, stack-based language with roots in Forth."
5 arch=('i686' 'x86_64')
6 url="http://retroforth.com"
7 license=('Public Domain')
8 makedepends=('fossil' 'docutils')
9 provides=('retro')
10 install=
11 changelog=$pkgname.changelog
12 source=()
13 md5sums=()
15 _fossil_repo="http://rx-core.org/rx.fossil"
16 _fossil_name="rx"
18 build() {
19   
20   [ -e "$startdir/$_fossil_name"  ] || ( cd $startdir; fossil clone $_fossil_repo $_fossil_name )
21   [ -e "$srcdir/$_fossil_name"    ] || ( cd $srcdir; ln -s $startdir/$_fossil_name $_fossil_name )
22   [ -e "$srcdir/$pkgname-$pkgver" ] || ( mkdir $srcdir/$pkgname-$pkgver; )
24   cd $srcdir/$pkgname-$pkgver
26   if [ -e "_FOSSIL_" ] ; then
27     fossil pull
28   else
29     fossil open $srcdir/$_fossil_name
30   fi
32   sed '/define GLOBAL/ s#/local##' -i src/vm/retro.c 
34   msg "creating tools"
35   make tools
36   msg "creating vm"
37   make c
38   msg "creating image"
39   make image
40   if [[ "$CARCH" == "x86_64" ]]; then
41     msg "recreating 64-bit vm"
42     make CFLAGS=-DRX64 c
43     ./convert
44   fi
45   msg "generating documentation"
46   make update-library-docs
47   make docs
52 package() {
53   cd "$srcdir/$pkgname-$pkgver"
54   mkdir -p $pkgdir/usr/{lib/retro,bin,share/{man/man1,retro,licenses/retro,doc/retro/library}}
55   
56   gzip -c9 doc/retro.1 > $pkgdir/usr/share/man/man1/retro.1.gz
57   xz -c9 LICENSE > $pkgdir/usr/share/licenses/retro/LICENSE.xz
58   xz -c9 src/core.rx > $pkgdir/usr/share/retro/core.rx.xz
59   install -m755 retro $pkgdir/usr/bin/retro
61   if [[ "$CARCH" == "x86_64" ]]; then
62     install -m644 retroImage64 $pkgdir/usr/share/retro
63   else
64     install -m644 retroImage $pkgdir/usr/share/retro
65   fi
67   cp doc/*.html $pkgdir/usr/share/doc/retro
68   cp doc/library/*.html $pkgdir/usr/share/doc/retro/library
69   cp src/library/* $pkgdir/usr/lib/retro
73 # vim:set ts=2 sw=2 et: