#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk

# oversized .svg files
OVERSIZED_FILES :=

build/example-content::
	mkdir -p build/usr/share/example-content
#	for i in *.svg; do \
#	  echo "Processing $$i"; \
#	  dir=`dirname $$i`; \
#	  file=`basename $$i`; \
#	  if echo $(OVERSIZED_FILES) | grep -q $$i; then \
#	    inkscape -w 1500 --export-png=build/usr/share/example-content/$${file/svg/png} \
#		$$dir/$$file; \
#	  else \
#	    inkscape --export-png=build/usr/share/example-content/$${file/svg/png} \
#		$$dir/$$file; \
#	  fi; \
#	done

	mkdir -p build/usr/share/example-content/logos
	cp -p logos/*.png build/usr/share/example-content/logos

	rm -rf build/usr/lib/openoffice/share/gallery
	mkdir -p build/usr/lib/openoffice/share/gallery
	find $(CURDIR)/build/usr/share/example-content/logos -name "*.png" \
	  > build/example-content.filelist
	xvfb-run -a /usr/lib/openoffice/program/gengal \
	  --name "Ubuntu" \
	  --path $(CURDIR)/build/usr/lib/openoffice/share/gallery \
	  --destdir $(CURDIR)/build --number-from "60" \
	    `cat build/example-content.filelist | xargs`

clean::
	rm -rf build
