# Maintainer: Brad Fanella <cesura@archlinux.org>
# Contributor: Martin Wimpress <code@flexion.org>

pkgname=python2-caja
pkgver=1.20.2
pkgrel=1
pkgdesc="Python binding for Caja, to allow Caja property page and menu item extensions to be written in Python"
url="http://mate-desktop.org"
arch=('x86_64')
license=('GPL')
depends=('caja' 'python2-gobject')
makedepends=('intltool')
conflicts=('python2-caja-gtk3')
replaces=('python2-caja-gtk3')
source=("http://pub.mate-desktop.org/releases/${pkgver%.*}/python-caja-${pkgver}.tar.xz")
sha256sums=('eb349fc033ca8dad924b573ede74612d7fa83f6fea93d052d00f13b2c2af289b')

prepare() {
    	cd "python-caja-${pkgver}"
    	sed -i 's/python-config/python2-config/' configure
}

build() {
    	cd "python-caja-${pkgver}"
    	PYTHON=/usr/bin/python2 ./configure \
        	--prefix=/usr

    	#https://bugzilla.gnome.org/show_bug.cgi?id=656231
    	sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

   	 make
}

package() {
    	cd "python-caja-${pkgver}"
    	make DESTDIR="${pkgdir}" install
}
