Handle both %define and %global
Handle %{base_name} in package name