### this file is sourced not run
PKGVER=0.5
PKGBUILD=1
PKGARCH=noarch

# source: james
TARBALL=puppy_icon_theme-$PKGVER.tar.bz2
MD5SUM=b42e94d4c588cd60e0fba60cf539a4c6
SRC_URL=http://distro.ibiblio.org/fatdog/source/710/$TARBALL
BUNDLE=

SLACKREQ=''
SLACKDESC="puppy-icon-theme: puppy-icon-theme $PKGVER (Puppy Standard icon theme)
puppy-icon-theme: 
puppy-icon-theme: The Puppy icon theme contains almost-complete Freedesktop standard 
puppy-icon-theme: scalable icons which is the standard icon for Puppy Linux.
puppy-icon-theme: Icons credits to to zigbert, technosaurus and 01micko.
puppy-icon-theme: 
puppy-icon-theme: This package contains modification to support Fatdog themeing too.
puppy-icon-theme: 
puppy-icon-theme: 
puppy-icon-theme: https://github.com/puppylinux-woof-CE/puppy_icon_theme
puppy-icon-theme: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/puppy_icon_theme*
	export THEME=Puppy-Standard
	sed -i -e "s/NAME=.*/NAME=$THEME/" build.conf &&
	sed -i -e 's/^tar/#tar/' build_theme && # don't package
	make && 
	make install &&
	pkg_build_slackdesc &&
	
	# Add Fatdog icon theme symlinks
	THEMEDIR=/usr/share/pixmaps/themes/${THEME}48
	ICONDIR=/usr/share/icons/$THEME/scalable
	FALLBACK=/usr/share/pixmaps/themes/puppy48
	install -d m644 $THEMEDIR &&
	cd $THEMEDIR &&
	for p in \
		abc48.png:apps/document.svg \
		archive48.png:mimetypes/application-x-compressed-tar.svg \
		audio48.png:mimetypes/audio.svg \
		bigred48.png: \
		bluetooth48.png: \
		camera48.png:devices/photocamera.svg \
		card48.png: \
		chat48.png:apps/chat.svg \
		clipboard48.png:actions/paste.svg \
		clock48.png: \
		configuration48.png:categories/preferences.svg \
		connect48.png:actions/refresh.svg \
		console48.png:apps/terminal.svg \
		contact48.png:apps/book_address.svg \
		controlpanel48.png:devices/graphics.svg \
		date48.png:apps/calendar.svg \
		dog48.png: \
		draw48.png: \
		drive48.png:devices/harddisk.svg \
		edit48.png:apps/edit.svg \
		email48.png:apps/mail.svg \
		error.xpm: \
		file-manager48.png: \
		floppy48.png:devices/floppy.svg \
		folder48.png:places/directory.svg \
		games48.png:categories/game_card.svg \
		go48.png: \
		gparted48.png: \
		hammer48.png: \
		help48.png:apps/help.svg \
		home48.png:actions/home.svg \
		invisible96x8.png: \
		keyboard48.png:devices/keyboard.svg \
		lamp48.png: \
		language48.png:apps/country_keyboard.svg \
		lock-screen48.png: \
		login48.png:actions/quit.svg \
		module24.xpm: \
		mouse48.png:devices/mouse.svg \
		multimedia48.png:categories/multimedia.svg \
		network48.png:places/network2.svg \
		ok.xpm: \
		optical48.png:devices/dvdrom.svg \
		paint48.png:apps/paint.svg \
		pc2pc48.png: \
		pc48.png:devices/computer.svg \
		penguin48.png: \
		pet48.png:mimetypes/application-pet.svg \
		pet48x.png:mimetypes/application-pet.svg \
		present48.png: \
		printer48.png:devices/print.svg \
		pupnews48.png: \
		puppy-bone48.gif: \
		question.xpm: \
		save48.png: \
		scanner48.png:devices/scanner.svg \
		shutdown48.png: \
		speedometer48.png: \
		spread48.png: \
		squashfs-image48.png:mimetypes/application-x-squashfs-image.svg \
		system48.png:categories/application-x-executable.svg \
		system-monitor48.png: \
		touchpad48.png: \
		trashcan_empty48.png: \
		trashcan_full48.png: \
		tsclient48.png: \
		update48.png: \
		usb48.png: \
		usbdrv48.png:devices/disk_usb.svg \
		users48.png: \
		utility48.png: \
		webedit48.png:apps/edit_html.svg \
		wifi48.png: \
		word48.png: \
		www48.png:apps/internet.svg \
		x48.png: \
		x.png: 
	do
		tgt=${p%:*}
		src=${p#*:}
		if [ $src ]; then
			ln -s $ICONDIR/$src $tgt
		else
			ln -s $FALLBACK/$tgt $tgt # fallback
		fi
	done
}


