summaryrefslogtreecommitdiff
path: root/community/notmuch/PKGBUILD
blob: eb58ef8fce75c0e533139bfcd0833a91db51f186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# $Id: PKGBUILD 90768 2013-05-13 18:27:06Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: fauno <fauno at kiwwwi.com.ar>
# Contributor: Olivier Ramonat <olivier at ramonat dot fr>
# Contributor: Richard Murri <admin@richardmurri.com>

pkgbase=notmuch
pkgname=('notmuch' 'notmuch-vim' 'notmuch-mutt' 'notmuch-runtime')
pkgver=0.15.2
pkgrel=3
arch=('i686' 'x86_64')
url="http://notmuchmail.org/"
license=('GPL3')
makedepends=('python2' 'python' 'emacs' 'gnupg' 'ruby' 'pkgconfig' 'xapian-core' 'gmime' 'talloc')
options=(!distcc !makeflags)
source=("http://notmuchmail.org/releases/${pkgname}-${pkgver}.tar.gz")
md5sums=('e86968dfcd7ffaf162b7b87de56b7f18')

prepare(){
    #cp -dpr --no-preserve=ownership "$srcdir/$pkgname-$pkgver" "$srcdir/$pkgname-runtime-$pkgver"
    cp -dpr --no-preserve=ownership "$srcdir/${pkgname}-$pkgver"/bindings/python{,2}

    find "$srcdir/${pkgname}-${pkgver}/bindings/python" -name '*.py' -exec sed -i -e '1s,python$,python3,' {} +
    find "$srcdir/${pkgname}-${pkgver}/bindings/python2" -name '*.py' -exec sed -i -e '1s,python$,python2,' {} +
}
build() {
    cd "$srcdir/${pkgname}-$pkgver"

    ./configure --prefix=/usr --sysconfdir=/etc \
		--includedir=/usr/include \
		--without-zsh-completion

    make 

    (cd "${srcdir}/$pkgname-${pkgver}/contrib/${pkgname}-mutt"
    make ${pkgname}-mutt.1)

    cd bindings/ruby
    ruby extconf.rb

	cd "$srcdir/${pkgname}-${pkgver}/bindings/python"
	python setup.py build

	cd "$srcdir/${pkgname}-${pkgver}/bindings/python2"
	python2 setup.py build
}

package_notmuch-runtime(){
    pkgdesc="Runtime for notmuch and notmuch-mutt"
    depends=('xapian-core' 'gmime' 'talloc')
    cd "$srcdir/${pkgbase}-$pkgver"
    make DESTDIR="$pkgdir/" LIBDIR_IN_LDCONFIG=0 install
	chmod 755 $pkgdir/usr/bin/notmuch
}


package_notmuch-vim(){
	pkgdesc="Vim plugins for notmuch"
	depends=('notmuch-runtime')
    mkdir -p "$pkgdir"/usr/share/vim/vimfiles/{plugin,syntax}
    make -C "$srcdir/$pkgbase-$pkgver/vim" prefix="$pkgdir/usr/share/vim/vimfiles" install
}


package_notmuch(){
    pkgdesc="Notmuch is not much of an email program"
    depends=('notmuch-runtime')
    optdepends=('emacs: for using the emacs interface'
                'vim: for using the vim interface'
                'python2: for using the python2 bindings'
                'ruby: for using the ruby bindings'
                'gnupg: for email encryption')

    cd "$srcdir/${pkgname}-$pkgver"

    # Install python bindings
    cd "$srcdir/${pkgname}-${pkgver}/bindings/python2"
    #env LD_LIBRARY_PATH="." python2 setup.py install --prefix=/usr --root="$pkgdir"
	python2 setup.py install --prefix=/usr --root="$pkgdir"

    cd "$srcdir/${pkgname}-${pkgver}/bindings/python"
    #env LD_LIBRARY_PATH="." python setup.py install --prefix=/usr --root="$pkgdir"
	python setup.py install --prefix=/usr --root="$pkgdir"

    # Install ruby bindings
    cd "$srcdir/${pkgname}-${pkgver}/bindings/ruby"
    sed -i -e 's,/site_ruby,,g' Makefile
    make exec_prefix=$pkgdir/usr prefix=/usr install

}

package_notmuch-mutt(){
    pkgdesc="The mail indexer"
    depends=('notmuch-runtime' 'perl-mailtools' 'perl-mail-box' 'perl-term-readline-gnu' 'perl-string-shellquote' 'perl-file-which')
    cd "$srcdir/$pkgbase-$pkgver"

    install -Dm755 "contrib/$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname"
    install -Dm644 "contrib/$pkgname/${pkgname}.1" "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz"
}

#vim: set filetype=PKGBUILD sw=4 ts=4 et