]> git.gag.com Git - fw/altos/blob - contrib/arch-linux/PKGBUILD-git.altos
altosui: Add new filename filters
[fw/altos] / contrib / arch-linux / PKGBUILD-git.altos
1 # Original contributor: Bob Finch <w9ya@qrpqrci.net>
2 pkgname=altos-git
3 pkgver=20101125
4 pkgrel=1
5 pkgdesc="Software solutions for high powered rocketry avionics"
6 arch=('i686' 'x86_64')
7 url="http://www.altusmetrum.org/AltOS/"
8 license=('GPL')
9 provides=('altos')
10 conflicts=('altos')
11 depends=('openssl>=1.0.0' 'libusb1' 'plplot-svn' 'nickle' 'flite' 'kernel26>=2.6.33' 'fop'\
12          'gconf' 'alsa-oss' 'swig' 'libglade' 'freetts' 'jdk>=6u21' 'jfreechart' 'jcommon')
13 makedepends=('git' 'docbook-xsl=1.76.0' 'sdcc=2.9.0-2_patched' 'nsis' 'tar' 'gzip' 'zip')
14 optdepends=('uucp: cu is included & is a bare boned terminal 2 serial program'
15             'cutemon: gui-based minimal terminal to serial program'
16             'google-earth: useful for viewing the kml files of the flight path')
17 options=('docs')
18
19 _gitroot="git://git.gag.com/fw/altos"
20 _gitname="altos"
21 _pkgname="altosui"
22 _libname="libaltos"
23
24 build() {
25   cd "$srcdir"
26   msg "Connecting to GIT server...."
27   
28   if [ -d $_gitname ] ; then
29     cd $_gitname && git pull origin
30     msg "The local files are updated."
31   else
32     git clone $_gitroot
33   fi
34   
35   msg "GIT checkout done or server timeout"
36   msg "Starting make..."
37   
38   rm -rf "$srcdir/$_gitname-build"
39   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
40   
41   #
42   # BUILD HERE
43   #
44   
45   sh /etc/profile.d/jdk.sh
46   
47   cd "$srcdir/$_gitname-build"
48   ./autogen.sh --prefix=/usr --with-jvm=/opt/java/include/\
49    --with-freetts=/usr/share/java/freetts/lib --with-jcommon=/usr/share/java/jcommon/lib\
50    --with-jfreechart=/usr/share/java/jfreechart/lib\
51   # --with-fat-dir=$srcdir
52   # Use this ^ for placing all 3 "fat" packages (linux,mac,windows) into a numbered dir.
53   
54   cd "$srcdir/$_gitname-build/$_pkgname/"
55   sed -i 's:\$(datadir)/java:\$(datadir)/java/altos:' Makefile
56   # This ^ places altosui.jar in an 'altos' subdirectory.
57   sed -i 's:\${exec_prefix}/bin:\${exec_prefix}/share/java/altos:' Makefile
58   # This ^ relocates altosui to allow for an aoss wrapper script.
59   sed -i 's|:/usr/share/java/\*|:/usr/share/java/*:$(JCOMMON)/*:$(JFREECHART)/*|' Makefile
60   # This ^ fixes compilation to include reference to jcommon.jar .
61   sed -i 's:cp -p $(JFREECHART_CLASS):cp -p $(JFREECHART_CLASS) $(JCOMMON_CLASS):' Makefile
62   # This ^ includes jcommon.jar in the macosx fat package.
63   
64   cd "$srcdir/$_gitname-build/$_pkgname/$_libname/"
65   sed -i 's:$(JVM_INCLUDE):/opt/java/include\ -I/opt/java/include/linux:' Makefile
66   # This ^ enables both jni.h and jni_md.h to be found as required.
67   
68   cd "$srcdir/$_gitname-build/doc"
69   sed -i 's:stylesheet/docbook-xsl:xsl-stylesheets-1.76.0:' Makefile
70   # This ^ fixes archlinux's use of a specfic reference.
71   
72   cd "$srcdir/$_gitname-build"
73   make || return 1
74   
75   cd "$srcdir/$_gitname-build/doc"
76   make all
77   
78   cd "$srcdir/$_gitname-build/$_pkgname"
79   make fat
80 }
81
82 package() {
83   cd "$srcdir/$_gitname-build"
84   make DESTDIR="$pkgdir/" install
85   
86   mkdir -p $startdir/pkg/usr/share/altos
87   install -m 644 src/telemetrum-v1.0-* $startdir/pkg/usr/share/altos/
88   install -m 644 src/teledongle-v0.2-* $startdir/pkg/usr/share/altos/
89   
90   mkdir -p $startdir/pkg/usr/share/pixmaps
91   mkdir -p $startdir/pkg/usr/share/applications
92   install -m644 debian/*.xpm $startdir/pkg/usr/share/pixmaps
93   install -m644 debian/*.desktop $startdir/pkg/usr/share/applications
94   
95   echo "#!/bin/sh" > holding.bin
96   echo ". aoss /usr/share/java/altos/altosui" >> holding.bin
97   install -D -m 755 holding.bin $startdir/pkg/usr/bin/$_pkgname
98   
99   mkdir -p $startdir/pkg/usr/share/doc/altos
100   install -m 644 doc/*.html $startdir/pkg/usr/share/doc/altos/
101   install -m 644 doc/*.pdf $startdir/pkg/usr/share/doc/altos/
102 }