# Contributor: Ethan Schoonover, es@ethanschoonover.com
pkgname=offlineimap-git
pkgver=20110401
pkgrel=1
pkgdesc="A powerful IMAP/Maildir synchronization tool"
url="http://wiki.github.com/nicolas33/offlineimap/"
arch=('any')
license=('GPL2')
depends=('python2')
makedepends=('git' 'python2-setupdocs')
conflicts=('offlineimap')
provides=('offlineimap')
_gitroot="git://github.com/nicolas33/offlineimap.git"
_gitname="offlineimap"
build() {
msg 'Connecting to GIT server...'
if [[ -d $_gitname ]]; then
( cd $_gitname; git pull origin )
msg 'The local files are updated.'
else
git clone $_gitroot $_gitname
fi
msg "GIT checkout done or server timeout"
msg "Starting make..."
rm -rf $_gitname-build
git clone $_gitname{,-build}
cd $_gitname-build
sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
$(find ./ -name '*.py')
make man
}
package() {
cd $_gitname-build
python2 setup.py install --prefix=${pkgdir}/usr
install -D -m644 offlineimap.conf.minimal ${pkgdir}/usr/share/offlineimap/offlineimap.conf.minimal
install -D -m644 offlineimap.conf ${pkgdir}/usr/share/offlineimap/offlineimap.conf
install -D -m644 offlineimap.1 ${pkgdir}/usr/share/man/man1/offlineimap.1
}