 
     contents = File.read!(spec)
     |> String.replace(@_NAME, config.name)
-    |> String.replace(@_VERSION, config.version)
+    |> String.replace(@_VERSION, config.version |> normalize_version)
     |> String.replace(@_TOPDIR, config.build_dir)
     |> String.replace(@_BUILD_ARCH, config.build_arch)
     |> String.replace(@_SUMMARY, config.summary)

  end

  def rpm_file_name(name, version, arch, match \\ false),
    do: "#{name}-#{version}-0.#{if match, do: "*", else: ""}#{arch}.rpm"

  def get_config_item(config, item, default) do
    app    = String.to_atom config.name

        rpmbuild:        @_RPM_BUILD_TOOL,
        rpmbuild_opts:   @_RPM_BUILD_ARGS,
        priv_path:       Path.join([__DIR__, "..", "..", "priv"]) |> Path.expand,
        sources_path:    Path.join([build_dir, "SOURCES", source_name]),
        target_rpm_path: Path.join([File.cwd!, "rel", name, "releases", version, rpm_file_name(name, version, build_arch)]),
        app_tar_path:    Path.join([File.cwd!, "rel", name, app_name]),
        summary:         @_DEFAULT_SUMMARY,
