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

# source: post BLFS 7.8 2016-01-05
TARBALL=ghostscript-$PKGVER.tar.bz2
MD5SUM=aa125af368d89b3dbd15fc379f13375f
SRC_URL=http://downloads.ghostscript.com/public/$TARBALL
BUNDLE=

SLACKREQ='expat32 freetype2_32 libjpeg-turbo32 libpng32 libtiff32 lcms2_32 
cairo32 fontconfig32 gtk2_32 cups32 libjasper32 libopenjpeg32'
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* 
	
	# BLFS 7.8 patch to build with system-zlib
	sed -i 's/ZLIBDIR=src/ZLIBDIR=$includedir/' configure.ac configure &&
	
	# 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	
}


