### this file is sourced not run
PKGVER=10.0.0
PKGBUILD=1
PKGARCH=i686

# source: BLFS 11.3
TARBALL=ghostscript-10.0.0.tar.xz
MD5SUM=c75560fdd05dc1f1daa33415156d5a20
SRC_URL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/$TARBALL
BUNDLE=

SLACKREQ='cups32 fontconfig32 freetype2_32 lcms2_32 libjpeg-turbo32 libpng32 libtiff32 libopenjpeg2_32 cairo32'
SLACKDESC="ghostscript32: ghostscript32 $PKGVER (Postscript renderer)  
ghostscript32:  
ghostscript32: Ghostscript is a versatile processor for PostScript data with the 
ghostscript32: ability to render PostScript to different targets.  
ghostscript32: 
ghostscript32: This contains 32-bit version of the library.
ghostscript32: 
ghostscript32: 
ghostscript32: 
ghostscript32: 
ghostscript32:
"
SLACKSUG=ghostscript-std-fonts

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf etc bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/ghostscript* 

	# this will prevent installation to complete, so clean it out first
	rm -rf /usr/share/ghostscript &&
	
	# delete obsolete library
	rm -rf zlib freetype lcms2mt jpeg libpng openjpeg &&
	
	# start build
	./configure --prefix=/usr --libdir=/usr/$LIBDIR --disable-compile-inits \
	--with-system-libtiff  &&
	
	#{ make $MAKEFLAGS    || make ;    } &&
	{ make $MAKEFLAGS so || make so ; } &&
	#make install &&
	
	make soinstall &&
	#install -v -m644 base/*.h /usr/include/ghostscript &&
	#ln -sfvn ghostscript /usr/include/ps &&

	#mv -v /usr/share/doc/ghostscript/$PKGVER /usr/share/doc/ghostscript-$PKGVER  &&
	#rm -rfv /usr/share/doc/ghostscript &&
	#cp -r examples/ /usr/share/ghostscript/$PKGVER/ &&
	
	pkg_build_slackdesc	
}
