#Packager: Dimitris Tzemos <dijemos@gmail.com>

pkgname=kodi-addon-pvr-iptvsimple
pkgver=2.4.14
pkgrel=1dj
_koditarget=Krypton
_gitname=pvr.iptvsimple
_kodiver=17.5
source=("https://github.com/kodi-pvr/${_gitname}/archive/${pkgver}-${_koditarget}.tar.gz"
        "https://github.com/xbmc/xbmc/archive/${_kodiver}-${_koditarget}.tar.gz")

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"IPTV Simple PVR client addon for Kodi"
)


build() {
	mkdir -p "pvr.iptvsimple-${pkgver}-${_koditarget}/build"
	cd "pvr.iptvsimple-${pkgver}-${_koditarget}/build"

	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib${LIBDIRSUFFIX}/kodi \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_SHARED_LIBS=1 \
		-DADDONS_TO_BUILD=pvr.iptvsimple \
		-DADDONS_SRC_PREFIX=../.. \
		../../xbmc-${_kodiver}-${_koditarget}/project/cmake/addons
	make || return 1
	
	cd "pvr.iptvsimple-${pkgver}-${_koditarget}/build"
	install -d "${PKG}/usr" || return 1
	## Use these lines to install 
	#mv .install/lib "${PKG}/usr/lib${LIBDIRSUFFIX}/"
	#mv .install/share "${PKG}/usr/"
	
	## Or Use these lines to install (Both are working)
	mv .install/lib "${PKG}/usr/share/"
	cp -R .install/share "${PKG}/usr/"
} 
