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

# source: james
TARBALL=netpbm-free_$PKGVER.orig.tar.xz
MD5SUM=d8de206911ce13db9291b00c7704199a
SRC_URL=http://deb.debian.org/debian/pool/main/n/netpbm-free/$TARBALL
# original source is at https://sourceforge.net/p/netpbm/code/HEAD/tree/
# but they didn't publish the "advanced" version yet at time of build
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 are 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: https://netpbm.sourceforge.net/
"

### 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/* {shared,static}link/* /usr/lib64  &&
	
	#fix symlink
	rm -f /usr/lib64/libnetpbm.so     && 
	ln -sf 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
}

# vim: ft=sh:
