mkdir -pv $INSTALL_ROOT/usr/share/ca-certificates &&
mkdir -pv $INSTALL_ROOT/usr/share/doc/ca-certificates &&
mkdir -pv $INSTALL_ROOT//etc/ca-certificates/update.d &&

cp -vr --preserve=mode usr/share/ca-certificates/* $INSTALL_ROOT/usr/share/ca-certificates &&
cp -vr --preserve=mode usr/share/man/man8/* $INSTALL_ROOT/usr/share/man/man8 &&
cp -vr --preserve=mode usr/share/doc/ca-certificates/* $INSTALL_ROOT/usr/share/doc/ca-certificates &&
cp -vr --preserve=mode usr/sbin/* $INSTALL_ROOT/usr/sbin &&

cd $INSTALL_ROOT/usr/share/ca-certificates &&
tmp=$(mktemp) &&
find . -name '*.crt' | sort | cut -b3-  > "$tmp" &&
mv "$tmp" "$INSTALL_ROOT"/etc/ca-certificates.conf &&

mkdir -p $INSTALL_ROOT/etc/ssl/certs  &&
chmod 0755 $INSTALL_ROOT/etc/ssl/certs

