rewrite builddep in python, support architecture limitations