build.rb: improvements