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

# source: james
TARBALL=netpbm-advanced-$PKGVER.tar.gz
MD5SUM=0c5d0a0539be9b4cfde082655f8f853c
SRC_URL=https://github.com/t6/netpbm/archive/v${PKGVER}.tar.gz
BUNDLE=

SLACKREQ='libjpeg-turbo libtiff libpng libxml2' # libjbigkit is compile-time
SLACKDESC="netpbm-advanced: netpbm-advanced $PKGVER (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 ../pkg/config.mk . &&
	true
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/netpbm*
	#./configure; return 1
	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    && # don't have this anymore
	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
}


