#!/bin/bash -eu

if [ -f meson.build -a -f build/build.ninja ]; then
	DESTDIR="$UB_INSTALLDIR" ninja -C build install
elif [ -f CMakeLists.txt -a -f build/build.ninja ]; then
	DESTDIR="$UB_INSTALLDIR" ninja -C build install
elif [ -f CMakeLists.txt -a -f build/Makefile ]; then
	cd build; ub_makeinstall "$@"
elif [ -f Build.PL ]; then
	exec ./Build install destdir="$UB_INSTALLDIR"
elif [ -f pyproject.toml ]; then
	python3 -m installer --destdir="$UB_INSTALLDIR" dist/*.whl
else
	ub_makeinstall "$@"
fi

ub_fixpaths
