updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / glc-git / PKGBUILD
blob455ccee4bae112efcc9cc786a51a773f3b280b72
1 # Maintainer: doorknob60 < doorknob60 at gmail dot com >
2 # Contributor: kumico <kumico@kh.nu>
3 pkgname=glc-git
4 pkgver=20110501
5 pkgrel=1
6 pkgdesc="An ALSA & OpenGL capture tool for Linux. (-git version)"
7 arch=('i686' 'x86_64')
8 url="https://github.com/nullkey/glc"
9 install=glc-git.install
10 source=('Copyright')
11 license=('CUSTOM')
12 depends=('libpng' 'alsa-lib' 'libgl')
13 makedepends=('cmake' 'git' 'mesa')
14 provides=('glc')
15 conflicts=('glc')
17 md5sums=('d706bd101063967583d3e4f98e0bf14a')
18 sha1sums=('8df4c92df2a6ddefccc5ee16d05298c7e8351094')
20 _gitname="glc"
21 _gitroot="git://github.com/nullkey/glc.git"
23 build() {
24         cd $srcdir
25         mods=('glc' 'glc-support' 'elfhacks' 'packetstream')
26         for mod in ${mods[@]}; do
27                 msg "Gitting $mod"
28                 if [ -d "$mod" ]; then
29                         cd "$mod"
30                         git pull origin || return 1
31                         cd ..
32                 else
33                         git clone "git://github.com/nullkey/$mod" || return 1
34                 fi
35         done
36         
37         ln -sf $srcdir/elfhacks $srcdir/glc/elfhacks
38         ln -sf $srcdir/packetstream $srcdir/glc/packetstream
39         ln -sf $srcdir/glc-support $srcdir/glc/support
40         
41         msg "GIT checkout done or server timeout"
42         msg "Starting Build Sequence"
43         
44         DESTDIR=$pkgdir/usr
45         MLIBDIR="lib"
46         if [ $CARCH == "x86_64" ]; then
47                 MLIBDIR="lib64"
48                 CFLAGS="$CFLAGS -m64"
49         else
50                 MLIBDIR="lib"
51         fi
52         export CMAKE_INCLUDE_PATH="$srcdir/glc/elfhacks/src:$srcdir/glc/packetstream/src"
53         export CMAKE_LIBRARY_PATH="$srcdir/glc/elfhacks/build/src:$srcdir/glc/packetstream/build/src"
54         
55         mods=('elfhacks' 'packetstream' 'glc')
56         for mod in ${mods[@]}; do
57                 msg "Building $mod..."
58                 [ -d $mod/build ] || mkdir $mod/build
59                 cd $mod/build
60                 
61                 cmake .. \
62                         -DCMAKE_INSTALL_PREFIX:PATH="${DESTDIR}" \
63                         -DCMAKE_BUILD_TYPE:STRING="Release" \
64                         -DCMAKE_C_FLAGS_RELEASE_RELEASE:STRING="${CFLAGS}" > /dev/null \
65                         -DMLIBDIR="${MLIBDIR}" \
66                         || return 1
67                 make || return 1
68                 cd ../..
69         done
70         
71         
72         for mod in ${mods[@]}; do
73                 msg "Installing $mod to pkgdir..."
74                 cd $srcdir/$mod/build
75                 make install || return 1
76         done
77         
78         install -d -m755 $pkgdir/usr/share/glc/scripts
79         install -m755 $srcdir/glc/scripts/capture.sh $pkgdir/usr/share/glc/scripts/capture.sh
80         install -m755 $srcdir/glc/scripts/play.sh $pkgdir/usr/share/glc/scripts/play.sh
81         install -m755 $srcdir/glc/scripts/encode.sh $pkgdir/usr/share/glc/scripts/encode.sh
82         install -d -m755 $pkgdir/usr/share/licenses/glc
83         install -m644 $srcdir/Copyright $pkgdir/usr/share/licenses/glc/Copyright