#!/bin/bash -eu

# python
find "$UB_INSTALLDIR" -name __pycache__ -type d -exec rm -r {} +
find "$UB_INSTALLDIR" \( -name \*.pyc -o -name \*.pyo \) -delete

# perl
if [ -d "$UB_INSTALLDIR/usr/lib/perl5" ]; then
	find "$UB_INSTALLDIR/usr/lib/perl5" -name "perllocal.pod" -type f -delete
fi

# gtk-doc
if [ ! -f "$UB_INSTALLDIR/usr/bin/gtkdocize" ] ; then
if [ -d "$UB_INSTALLDIR/usr/share/gtk-doc" ]; then
	rm -rf "$UB_INSTALLDIR/usr/share/gtk-doc"
fi
fi

# xvpics
find "$UB_INSTALLDIR" -name .xvpics -delete

# .la
find "$UB_INSTALLDIR" -name *.la -delete
