# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../umlspeed/umlspeed.conf
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---

var_append makeinstopt ' ' "BIN_DIR=$root$bindir"
var_append makeinstopt ' ' "MAN_DIR=$root$mandir/man1"

hook_add postmake 5 'umlspeed_doc'
umlspeed_doc() {
	echo "Installing documentation..."
	cp -vfa doc/* $root$docdir/
	cp -vfa samples $root$docdir/
}

if pkginstalled vim; then
	pkgprefix -t vim

	hook_add postmake 5 'umlspeed_vim'
	umlspeed_vim() {
		local vimver=$( pkgprefix ver vim | tr -d '.' )
		local vimdir=$root$( pkgprefix datadir vim )/vim/vim$vimver

		mkdir -p "$vimdir/ftdetect/"
		cat <<-EOT > "$vimdir/ftdetect/umlspeed.vim"
		au BufNewFile,BufRead *.ums setf umlspeed
		EOT

		cp -avf syntax/umlspeed.vim $vimdir/syntax/
	}
fi