#!/bin/bash

source debian/vars.sh

set -x
echo "FILE LIST"
find . -type f -print
echo "SYSCONFDIR" $_sysconfdir
mkdir -p $DEB_INSTALL_ROOT/$prefix_dir
mkdir -p $DEB_INSTALL_ROOT/$prefix_lib
mkdir -p $DEB_INSTALL_ROOT/$prefix_bin
mkdir -p $DEB_INSTALL_ROOT/$prefix_inc
install -p -m644 ./c-client/c-client.a $DEB_INSTALL_ROOT/$prefix_lib
ln -s c-client.a $DEB_INSTALL_ROOT$prefix_lib/libc-client.a
install -p -m755 ./c-client/$shlibname $DEB_INSTALL_ROOT$prefix_lib/
: Installing development components
ln -s $shlibname $DEB_INSTALL_ROOT$prefix_lib/lib$soname.so
mkdir -p $DEB_INSTALL_ROOT$prefix_inc/c-client/
install -m644 ./c-client/*.h $DEB_INSTALL_ROOT$prefix_inc/c-client/
# Added linkage.c to fix (#34658) <mharris>
install -m644 ./c-client/linkage.c $DEB_INSTALL_ROOT$prefix_inc/c-client/
install -m644 ./src/osdep/tops-20/shortsym.h $DEB_INSTALL_ROOT$prefix_inc/c-client/
mkdir -p $DEB_INSTALL_ROOT$prefix_dir/share/docs/draft
mkdir -p $DEB_INSTALL_ROOT$prefix_dir/share/docs/rfc
install -m644 docs/*.txt $DEB_INSTALL_ROOT$prefix_dir/share/docs/
install -m644 docs/SSLBUILD $DEB_INSTALL_ROOT$prefix_dir/share/docs/
install -m644 docs/RELNOTES $DEB_INSTALL_ROOT$prefix_dir/share/docs/
install -m644 docs/draft/* $DEB_INSTALL_ROOT$prefix_dir/share/docs/draft/
install -m644 docs/rfc/* $DEB_INSTALL_ROOT$prefix_dir/share/docs/rfc/
install -m644 LICENSE.txt $DEB_INSTALL_ROOT$prefix_dir/share/docs/
install -m644 NOTICE $DEB_INSTALL_ROOT$prefix_dir/share/docs/
install -m644 SUPPORT $DEB_INSTALL_ROOT$prefix_dir/share/docs/
touch c-client.cf
install -p -m644 -D c-client.cf $DEB_INSTALL_ROOT/etc/c-client.cf
echo $buildroot/etc/c-client.cf
