#!/usr/bin/env ruby require 'mkmf' arch = Config::expand(CONFIG["arch"]) distro = if File.exist?("/etc/issue") # this is "", "CentOS" or "Ubuntu" `cat /etc/issue`.split.first.downcase end unless ["centos", nil, "ubuntu"].include? distro STDERR.puts "unhandled /etc/issue result: #{distro}" end # either or _ if distro is non-null puts [arch, distro].compact.join("_")