### this file is sourced not run
PKGVER=10.64.1
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=netpbm-advanced-10.64.1.tar.bz2
MD5SUM=8790f193b21b1c25e0aaffed3c2de0d0
SRC_URL=http://distro.ibiblio.org/fatdog/source/700/$TARBALL
BUNDLE=

SLACKREQ='libjpeg-turbo libtiff libpng libxml2' # libjbigkit is compile-time
SLACKDESC='netpbm-advanced: netpbm-advanced 10.64.1 (Image manipulation utilities)  
netpbm-advanced:  
netpbm-advanced: Netpbm is a toolkit for manipulation of graphic images, 
netpbm-advanced: including conversion of images between a variety of different 
netpbm-advanced: formats. There are over 300 separate tools in the package 
netpbm-advanced: including converters for about 100 graphics formats. Examples 
netpbm-advanced: of the sort of image manipulation we'\''re talking about are: 
netpbm-advanced: Shrinking an image by 10%; Cutting the top half off of an 
netpbm-advanced: image; Making a mirror image; Creating a sequence of images 
netpbm-advanced: that fade from one image to another.  
netpbm-advanced:
'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/netpbm* &&
	cp $CHROOT_DIR/tmp/pkg/netpbm-config.mk config.mk
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/netpbm*
	#./configure
	make $MAKEFLAGS && 
	make package PKGDIR=/tmp/netpbm &&
	
	# install 
	#./installnetpbm
	cd /tmp/netpbm                &&
	cp -a bin/* /usr/bin           &&
	cp -a include/* /usr/include   &&
	cp -a lib/* link/* /usr/lib64  &&
	
	#fix symlink
	rm -f /usr/lib64/libnetpbm.so     && 
	ln -sf /usr/lib64/libnetpbm.so.11 /usr/lib64/libnetpbm.so &&
	
	cp -a man/* /usr/share/man     &&
	mkdir -p /usr/share/netpbm     &&
	cp -a misc/* /usr/share/netpbm &&
	
	sed "s|@VERSION@|$(cat VERSION)|; 
	     s|@DATADIR@|/usr/share/netpbm|; 
	     s|@LINKDIR@|/usr/lib64|; 
	     s|@INCLUDEDIR@|/usr/include|; 
	     s|@BINDIR@|/usr/bin|; 1,2d;" config_template \
	     > /usr/bin/netpbm-config &&
	     
	sed "s|@VERSION@|$(cat VERSION)|; 
	     s|@DATADIR@|/usr/share/netpbm|; 
	     s|@LINKDIR@|/usr/lib64|; 
	     s|@INCLUDEDIR@|/usr/include|; 
	     s|@BINDIR@|/usr/bin|; 1,2d;" /tmp/netpbm*/buildtools/pkgconfig_template \
	     > /usr/lib64/pkgconfig/netpbm.pc &&
	
	pkg_build_slackdesc
}


