import from svn and add .gitignore
Fix some bugs when building in debian/linux