if [ ! -d "/usr/lib64/QtVsPlayer" ];
then
  ln -sr /usr/lib64/QtVsPlayer /usr/lib/
fi

if [ -f "/usr/lib64/QtVsPlayer/libopenal.so.1" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libopenal.so.1
fi
ln -sr $(whereis "libopenal.so.1" | sed "s|.* \(.*libopenal.so.1\).*|\1|") /usr/lib64/QtVsPlayer

if [ -f "/usr/lib64/QtVsPlayer/libiconv2.so" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libiconv2.so
fi
#ln -sr /usr/lib64/QtVsPlayer/HCNetSDKCom/libiconv.so.2 /usr/lib64/QtVsPlayer/HCNetSDKCom/libiconv2.so

if [ -f $(whereis "libssl.so.1.1" | sed "s|.* \(.*libssl.so.1.1\).*|\1|") ];
then
if [ -f "/usr/lib64/QtVsPlayer/libssl.so.1.1" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libssl.so.1.1
fi
ln -sr $(whereis "libssl.so.1.1" | sed "s|.* \(.*libssl.so.1.1\).*|\1|") /usr/lib64/QtVsPlayer

if [ -f "/usr/lib64/QtVsPlayer/libssl.so" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libssl.so
fi
ln -sr $(whereis "libssl.so" | sed "s|.* \(.*libssl.so\).*|\1|") /usr/lib64/QtVsPlayer

if [ -f "/usr/lib64/QtVsPlayer/libcrypto.so.1.1" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libcrypto.so.1.1
fi
ln -sr $(whereis "libcrypto.so.1.1" | sed "s|.* \(.*libcrypto.so.1.1\).*|\1|") /usr/lib64/QtVsPlayer

if [ -f "/usr/lib64/QtVsPlayer/libcrypto.so" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libcrypto.so
fi
ln -sr $(whereis "libcrypto.so" | sed "s|.* \(.*libcrypto.so\).*|\1|") /usr/lib64/QtVsPlayer
fi

if [ -f "/usr/lib64/QtVsPlayer/libz.so.1" ];
then
    rm -fr /usr/lib64/QtVsPlayer/libz.so.1
fi
ln -sr $(whereis "libz.so" | sed "s|.* \(.*libz.so\).*|\1|") /usr/lib64/QtVsPlayer

cat << 'EOF' > /etc/ld.so.conf.d/QtVsPlayer.conf
/usr/lib64/QtVsPlayer/
/usr/lib64/QtVsPlayer/HCNetSDKCom/
EOF

/sbin/ldconfig
/sbin/ldconfig /usr/lib64/QtVsPlayer/
