#!/bin/sh

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then
  echo "Usage: $0 <version> <libdir> <includedir> [destdir]"
  exit 1
fi

version="$1"
libdir="$2"
includedir="$3"
destdir="$4"

cat << EOF > "$destdir$libdir/pkgconfig/ucx.pc"
libdir=$libdir
includedir=$includedir

Name: ucx
Description: UAP Common Extensions
Version: $version
Libs: -L\${libdir} -lucx
Cflags: -I\${includedir}
EOF
