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

# source: post BLFS 8.2 2018-06-08
TARBALL=ghostscript-$PKGVER.tar.gz
MD5SUM=5a47ab47cd22dec1eb5f51c06f1c9d9c
SRC_URL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs923/$TARBALL
BUNDLE=

SLACKREQ='expat32 freetype2_32 libjpeg-turbo32 libpng32 libtiff32 lcms2_32 
cairo32 fontconfig32 cups32 libjasper32'
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 expat freetype lcms2 jpeg libpng zlib tiff jasper lcms &&
	
	# start build
	./configure --prefix=/usr --libdir=/usr/$LIBDIR --disable-compile-inits \
	--enable-dynamic --with-system-libtiff  &&
	
	#{ make $MAKEFLAGS    || make ;    } && 
	{ make $MAKEFLAGS so || make so ; } &&

	#make install &&
	make soinstall &&
	
	#install -v -m644 base/*.h /usr/include/ghostscript &&
	#ln -v -s ghostscript /usr/include/ps &&
	#ln -sfvn ../ghostscript/$PKGVER/doc /usr/share/doc/ghostscript-$PKGVER &&
	pkg_build_slackdesc	
}


