updated on Mon Jan 16 20:00:43 UTC 2012
[aur-mirror.git] / notmuch-git / PKGBUILD
blobdb4013bd7d39ddc831b8d0d69ce9b8966b178c4b
1 # Maintainer: Mark Foxwell <fastfret79@archlinux.org.uk>
2 # Contributor: Olivier Ramonat <olivier at ramonat dot fr>
3 # Contributor: Richard Murri <admin@richardmurri.com>
5 pkgname=notmuch-git
6 pkgver=20111207
7 pkgrel=1
8 pkgdesc="Notmuch is not much of an email program"
9 arch=('i686' 'x86_64')
10 url="http://notmuchmail.org/"
11 license=('GPL3')
12 depends=('xapian-core' 'gmime')
13 makedepends=('git' 'talloc' 'python2')
14 provides=('notmuch')
15 conflicts=('notmuch')
16 optdepends=('emacs: for using the emacs interface'
17             'vim: for using the vim interface'
18             'python2: for using the python bindings'
19             'gnupg: for email encryption')
21 _gitroot="git://notmuchmail.org/git/notmuch"
22 _gitname="notmuch"
24 build() {
25   cd "$srcdir"
26   msg "Connecting to GIT server...."
28   if [ -d $_gitname ] ; then
29     cd $_gitname && git pull origin
30     msg "The local files are updated."
31   else
32     git clone $_gitroot $_gitname
33   fi
35   msg "GIT checkout done or server timeout"
36   msg "Starting make..."
38   rm -rf "$srcdir/$_gitname-build"
39   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
40   cd "$srcdir/$_gitname-build"
42   ./configure --prefix=/usr --sysconfdir=/etc --zshcompletiondir=/usr/share/zsh/site-functions
43   make
46 package(){
47   cd "$srcdir/$_gitname-build"
48   make DESTDIR="$pkgdir/" LIBDIR_IN_LDCONFIG=0 install
50   install -D notmuch $pkgdir/usr/sbin/notmuch
52   mkdir -p $pkgdir/usr/share/vim/vimfiles/{plugin,syntax}
54   cd vim && make PREFIX="$pkgdir/usr/share/vim/vimfiles" install
56   # Install python bindings
58   cd $srcdir/$_gitname-build/bindings/python
60   find "." -name '*.py' -print0 |xargs -0 \
61       sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
62       -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'
63   ln -s ../../lib/libnotmuch.so.1 libnotmuch.so.1
64   env LD_LIBRARY_PATH="." python2 setup.py build
65   env LD_LIBRARY_PATH="." python2 setup.py install --prefix=/usr --root=$pkgdir