pkgname=codeblocks

post_install() {
  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  update-mime-database usr/share/mime
  ln -s /usr/lib/libwxflatnotebook.so /usr/lib/libwxflatnotebook.so.0
  ln -s /usr/lib/libwxchartctrl.so  /usr/lib/libwxchartctrl.so.0
  ln -s /usr/lib/libwxcustombutton.so /usr/lib/libwxcustombutton.so.0
  }

pre_upgrade() {
  pre_remove $1
}

post_upgrade() {
  post_install $1
  rm /usr/lib/libwxflatnotebook.so.0 \
   /usr/lib/libwxchartctrl.so.0 /usr/lib/libwxcustombutton.so.0    
}

pre_remove() {
  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  update-mime-database usr/share/mime
}


( cd usr/lib ; rm -rf libcodeblocks.so )
( cd usr/lib ; ln -sf libcodeblocks.so.0.0.1 libcodeblocks.so )
( cd usr/lib ; rm -rf libwxsmithlib.so.0 )
( cd usr/lib ; ln -sf libwxsmithlib.so.0.0.1 libwxsmithlib.so.0 )
( cd usr/lib ; rm -rf libcodeblocks.so.0 )
( cd usr/lib ; ln -sf libcodeblocks.so.0.0.1 libcodeblocks.so.0 )
( cd usr/lib ; rm -rf libwxsmithlib.so )
( cd usr/lib ; ln -sf libwxsmithlib.so.0.0.1 libwxsmithlib.so )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxflatnotebook.so.0 )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxflatnotebook.so.0.0.1 libwxflatnotebook.so.0 )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxcustombutton.so )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxcustombutton.so.0.0.1 libwxcustombutton.so )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxchartctrl.so )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxchartctrl.so.0.0.1 libwxchartctrl.so )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxcustombutton.so.0 )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxcustombutton.so.0.0.1 libwxcustombutton.so.0 )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxchartctrl.so.0 )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxchartctrl.so.0.0.1 libwxchartctrl.so.0 )
( cd usr/lib/wxSmithContribItems ; rm -rf libwxflatnotebook.so )
( cd usr/lib/wxSmithContribItems ; ln -sf libwxflatnotebook.so.0.0.1 libwxflatnotebook.so )
