     if File.exists? config.app_tar_path do
       File.cp!(config.app_tar_path, config.sources_path)
       spec_path = Path.join([config.build_dir, "SPECS", "#{name}.spec"])
+      build_rpm_path = Path.join([config.build_dir, "RPMS", config.build_arch, 
+        rpm_file_name(name, version)])
       unless File.exists?(config.rpmbuild) do
         warn """
         Cannot find rpmbuild tool #{config.rpmbuild}. Skipping rpm build!

    end
  end

end

        """
      else
        System.cmd "#{config.rpmbuild} #{config.rpmbuild_opts} #{spec_path}"
        File.copy! build_rpm_path, config.target_rpm_path
        info "Rpm file #{config.target_rpm_path} created!"
      end 
    else
      error "Could not find the release file #{config.app_tar_path}"
