1 #Contributor: Daniel Isenmann <daniel [at] archlinux [dot] org>
2 pkgname=openclipart-png
5 pkgdesc="An archive of user contributed clip art that can be freely used (png-version for OpenOffice.org)."
6 url="http://www.openclipart.org"
10 depends=('openoffice-base>=3.0.1')
11 #for converting svg to png, because Openoffice doesn't support SVG
12 makedepends=('inkscape' 'optipng')
13 source=(http://openclipart.org/downloads/$pkgver/openclipart-$pkgver-svgonly.tar.bz2)
14 md5sums=('84e6ee889c8eb1208904e8e6f7004e63')
17 cd $startdir/src/openclipart-$pkgver-svgonly
18 #remove some (useless) images which inkscape cannot convert
19 rm -rf clipart/special
20 #convert all svg to png in width 600 pixel, aspect ratio save
21 echo "Converting svg to png... (be patient)"
22 find -name *svg -exec inkscape -f {} -e {}.png -w 600 \; &>/dev/null
23 #delete all svg images
24 find -name *svg -exec rm -f {} \;
25 #loseless compresson for smaller package size (it durations very long)
26 echo "Compressing png files... (be very patient)"
27 find -name *png -exec optipng -q {} \;
29 mkdir -p $startdir/pkg/opt/openoffice/basis-link/share/gallery/
30 rm -f $startdir/src/openclipart-$pkgver-svgonly/clipart/{PASSFAIL,README,TODO}
31 mv $startdir/src/openclipart-$pkgver-svgonly/clipart/* $startdir/pkg/opt/openoffice/basis-link/share/gallery/
32 #generating OpenOffice.org gallery files
33 for dir in `ls -1 $startdir/pkg/opt/openoffice/basis-link/share/gallery/` ; do
34 echo "Doing gallery $dir..."
35 find $startdir/pkg/opt/openoffice/basis-link/share/gallery/$dir -name "*.png" -and -not -type l >> $startdir/src/$dir.filelist
36 split -d -l 250 $startdir/src/$dir.filelist $startdir/src/$dir.filelist-
37 for file in $startdir/src/$dir.filelist-*; do
38 echo "Processing filelist $file"
39 /opt/openoffice/basis-link/program/gengal --name "$dir" --path "$startdir/pkg/opt/openoffice/basis-link/share/gallery/" --destdir "$startdir/pkg" --number-from "70" `cat $file`;