change pkg_name and pkg_dir to sub_pkg_name and sub_pkg_dir