lib/omnibus/packagers/rpm.rb
def create_rpm_file
      command =  %{rpmbuild}
      command << %{ --target #{safe_architecture}}
      command << %{ -bb}
      command << %{ --buildroot #{staging_dir}/BUILD}
      command << %{ --define '_topdir #{staging_dir}'}

      if signing_passphrase
        log.info(log_key) { "Signing enabled for .rpm file" }

        if File.exist?("#{ENV['HOME']}/.rpmmacros")
          log.info(log_key) { "Detected .rpmmacros file at `#{ENV['HOME']}'" }
          home = ENV["HOME"]
        else
          log.info(log_key) { "Using default .rpmmacros file from Omnibus" }

          # Generate a temporary home directory
          home = Dir.mktmpdir

          render_template(resource_path("rpmmacros.erb"),
            destination: "#{home}/.rpmmacros",
            variables: {
              gpg_name: project.maintainer,
              gpg_path: "#{ENV['HOME']}/.gnupg", # TODO: Make this configurable
            }
          )
        end

        command << " --sign"
        command << " #{spec_file}"

        with_rpm_signing do |signing_script|
          log.info(log_key) { "Creating .rpm file" }
          shellout!("#{signing_script} \"#{command}\"", environment: { "HOME" => home })
        end
      else
        log.info(log_key) { "Creating .rpm file" }
        command << " #{spec_file}"
        shellout!("#{command}")
      end

      FileSyncer.glob("#{staging_dir}/RPMS/**/*.rpm").each do |rpm|
        copy_file(rpm, Config.package_dir)
      end
    end
def create_rpm_file
      command =  %{rpmbuild}
      command << %{ --target #{safe_architecture}}
      command << %{ -bb}
      command << %{ --buildroot #{staging_dir}/BUILD}
      command << %{ --define '_topdir #{staging_dir}'}

      if signing_passphrase
        log.info(log_key) { "Signing enabled for .rpm file" }

        if File.exist?("#{ENV['HOME']}/.rpmmacros")
          log.info(log_key) { "Detected .rpmmacros file at `#{ENV['HOME']}'" }
          home = ENV["HOME"]
        else
          log.info(log_key) { "Using default .rpmmacros file from Omnibus" }

          # Generate a temporary home directory
          home = Dir.mktmpdir

          render_template(resource_path("rpmmacros.erb"),
            destination: "#{home}/.rpmmacros",
            variables: {
              gpg_name: project.maintainer,
              gpg_path: "#{ENV['HOME']}/.gnupg", # TODO: Make this configurable
            }
          )
        end

        command << " --sign"
        command << " #{spec_file}"

        with_rpm_signing do |signing_script|
          log.info(log_key) { "Creating .rpm file" }
          shellout!("#{signing_script} \"#{command}\"", environment: { "HOME" => home })
        end
      else
        log.info(log_key) { "Creating .rpm file" }
        command << " #{spec_file}"
        shellout!("#{command}")
      end

      FileSyncer.glob("#{staging_dir}/RPMS/**/*.rpm").each do |rpm|
        copy_file(rpm, Config.package_dir)
      end
    end
Generate the RPM file using +rpmbuild+. Unlike debian,the +fakeroot+
 command is not required for the package to be owned by +root:root+. The
 rpmuser specified in the spec file dictates this.

 @return [void]