#!/bin/sh

# Build distribution zipfiles for librsvg on Win32: Runtime,
# developer, engine and loader.

ZIP=/tmp/librsvg-2.40.1.zip
DEVZIP=/tmp/librsvg-dev-2.40.1.zip
ENGINEZIP=/tmp/svg-gtk-engine-2.40.1.zip
LOADERZIP=/tmp/svg-gdk-pixbuf-loader-2.40.1.zip

# The DLL name generated by libtool with the passed --version-info
DLLNAME=librsvg-2-2.dll

cd d:/usr
rm $ZIP

zip $ZIP -@ <<EOF
bin/$DLLNAME
EOF

rm $DEVZIP
zip -r -D $DEVZIP -@ <<EOF
bin/rsvg-convert.exe
bin/rsvg-view.exe
include/librsvg-2.0
lib/librsvg-2.dll.a
lib/pkgconfig/librsvg-2.0.pc
EOF

rm $ENGINEZIP
zip $ENGINEZIP lib/gtk-2.0/@GTK2_BINARY_VERSION@/engines/libsvg.dll

rm $LOADERZIP
mkdir -p lib/gdk-pixbuf-2.0/2.10.0/loaders
mv d:/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll lib/gdk-pixbuf-2.0/2.10.0/loaders
rm -f d:/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll.a
rm -f d:/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.la
zip $LOADERZIP lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll
