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

# source: BLFS 11.3
TARBALL=gnumeric-$PKGVER.tar.xz
MD5SUM=76ab216b25c48b4f5fbf05f73e1ca7d9
SRC_URL=https://download.gnome.org/sources/gnumeric/1.12/$TARBALL
BUNDLE=

SLACKREQ='gtk3 libgoffice libgsf gnome-icon-theme' # itstool build-time only
SLACKDESC="gnumeric: gnumeric $PKGVER (Spreadsheet program)  
gnumeric:  
gnumeric: An sophisticated spreadsheet program that can read MS-Excel files.  
gnumeric: 
gnumeric: This is a minimal build - no support for python or perl functions.
gnumeric: 
gnumeric: 
gnumeric: 
gnumeric: 
gnumeric: 
gnumeric: 
"
SLACKINSTALL='glib-compile-schemas ./usr/share/glib-2.0/schemas'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/gnumeric*
	#return 1
	
	#touch doc/C/gnumeric-C.omf.out # so we don't need to install rarian
	CONFFLAGS="$CONFFLAGS --disable-static --disable-schemas-compile \
	    --without-python --without-perl" &&
	pkg_build_autoconf && 
	pkg_build_slackdesc &&
	rm -f /usr/share/icons/hicolor/icon-theme.cache &&
	
	# ROX MIME handlers
	mkdir -p /etc/xdg/rox.sourceforge.net/{MIME-types,SendTo} &&

	# install default handler for generic. We don't do it, as libreoffice does this.
	#ln -sfv  /usr/bin/gnumeric /etc/xdg/rox.sourceforge.net/MIME-types/application_x-gnumeric &&

	# install generic "Send To" handler
	ln -sfv  /usr/share/applications/gnumeric.desktop /etc/xdg/rox.sourceforge.net/SendTo/gnumeric  &&

	# install MIME-speciic "Edit with" handlers
	MIMES=".application_vnd.sun.xml.calc
		.application_vnd.ms-excel
		.application_excel
		.application_vnd.oasis.opendocument.spreadsheet-template
		.text_x-comma-separated-values
		.text_spreadsheet
		.application_vnd.oasis.opendocument.spreadsheet
		.application_x-gnumeric" &&
	mkdir -p /etc/xdg/rox.sourceforge.net/SendTo &&
	(cd /etc/xdg/rox.sourceforge.net/SendTo &&
	mkdir -p $MIMES &&
	for p in $MIMES; do
		cd $p &&
		ln -sfv /usr/share/applications/gnumeric.desktop Edit-with-Gnumeric &&
		cd ..
	done
	) &&

	true
}
