# Maintainer: Trevor SANDY <trevor[dot]sandy[at]gmail[dot]com>
pkgname=lpub3d
pkgver=2.0.20.711
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
arch=('x86_64' 'i686')
license=('GPL3')
depends=('qt5-base' 'qt5-tools')
makedepends=()
conflicts=()
replaces=()
backup=()
source=("lpub3d-git.tar.gz" "complete.zip" "lpub3dldrawunf.zip")
noextract=("complete.zip" "lpub3dldrawunf.zip")
md5sums=(SKIP SKIP SKIP)

prepare() {
	cd ${pkgname}-git
	# copy ldraw archive libraries
	if [ -f ../complete.zip ] ; then
		cp ../complete.zip mainApp/extras
	else
		echo "complete.zip not found here `pwd`"
	fi
	if [ -f ../lpub3dldrawunf.zip ] ; then
		cp ../lpub3dldrawunf.zip mainApp/extras
	else
		echo "lpub3dldrawunf.zip not found here `pwd`"
	fi

	# Qt5 configure
	export QT_SELECT=qt5
	if [ -x /usr/bin/qmake ] ; then
		qmake -makefile CONFIG+=release CONFIG+=pkg
	elif [ -x /usr/bin/qmake-qt5 ] ; then
		qmake-qt5 -makefile CONFIG+=release CONFIG+=pkg
	fi
}

build() {
	cd ${pkgname}-git
	make clean
	make
}

package() {
	cd ${pkgname}-git
	make INSTALL_ROOT=${pkgdir} install
}
