Compilation issues on Arduino Due
According to the Arduino - ReleaseNotes,


  ARDUINO 1.5 BETA - 2012.10.22
  
  
  First release for the unified IDE for both AVR 8-bit and ARM 32-bit   (SAM3 CPUs) architectures.
  This release include the SAM Arduino Core used in the Arduino Due   Board.
  


So your 1.0.5 version does not allow for Due compilation. Download the most up-to-date version and you will be fine (you will be able to install SAM support).

Then you will be able to at least compile. If you have other problems with your code, please open another question here (in order to keep the one-question-per-post behavior of this website).

Don't install arduino from the debian repository, since that version is not updated regularly. Use the website version