<commit_before>require 'formula'

class Nagios < Formula
  homepage 'http://www.nagios.org/'
  url 'https://downloads.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.6/nagios-4.0.6.tar.gz'
  sha1 'aacd0ebc1a0a91692702667bd98f8a016b59780f'

  depends_on 'gd'
  depends_on 'nagios-plugins'
  depends_on 'libpng'

  def nagios_sbin;  prefix+'cgi-bin';       end
  def nagios_etc;   etc+'nagios';           end
  def nagios_var;   var+'lib/nagios';       end
  def htdocs;       share+'nagios/htdocs';  end
  def user;         `id -un`.chomp;         end
  def group;        `id -gn`.chomp;         end

  def install
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--sbindir=#{nagios_sbin}",
                          "--sysconfdir=#{nagios_etc}",
                          "--localstatedir=#{nagios_var}",
                          "--datadir=#{htdocs}",
                          "--libexecdir=#{HOMEBREW_PREFIX}/sbin", # Plugin dir
                          "--with-cgiurl=/nagios/cgi-bin",
                          "--with-htmurl=/nagios",
                          "--with-nagios-user=#{user}",
                          "--with-nagios-group=#{group}",
                          "--with-command-user=#{user}",
                          "--with-command-group=_www",
                          "--with-httpd-conf=#{share}"
    system "make all"
    system "make install"

    # Install config
    system "make install-config"
    system "make install-webconf"
    mkdir HOMEBREW_PREFIX+'var/lib/nagios/rw' unless File.exist? HOMEBREW_PREFIX+'var/lib/nagios/rw'
  end
<commit_msg>nagios: handle group name with spaces.<commit_after>require 'formula'

class Nagios < Formula
  homepage 'http://www.nagios.org/'
  url 'https://downloads.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.6/nagios-4.0.6.tar.gz'
  sha1 'aacd0ebc1a0a91692702667bd98f8a016b59780f'

  depends_on 'gd'
  depends_on 'nagios-plugins'
  depends_on 'libpng'

  def nagios_sbin;  prefix+'cgi-bin';       end
  def nagios_etc;   etc+'nagios';           end
  def nagios_var;   var+'lib/nagios';       end
  def htdocs;       share+'nagios/htdocs';  end
  def user;         `id -un`.chomp;         end
  def group;        `id -gn`.chomp;         end

  def install
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--sbindir=#{nagios_sbin}",
                          "--sysconfdir=#{nagios_etc}",
                          "--localstatedir=#{nagios_var}",
                          "--datadir=#{htdocs}",
                          "--libexecdir=#{HOMEBREW_PREFIX}/sbin", # Plugin dir
                          "--with-cgiurl=/nagios/cgi-bin",
                          "--with-htmurl=/nagios",
                          "--with-nagios-user=#{user}",
                          "--with-nagios-group='#{group}'",
                          "--with-command-user=#{user}",
                          "--with-command-group=_www",
                          "--with-httpd-conf=#{share}"
    system "make all"
    system "make install"

    # Install config
    system "make install-config"
    system "make install-webconf"
    mkdir HOMEBREW_PREFIX+'var/lib/nagios/rw' unless File.exist? HOMEBREW_PREFIX+'var/lib/nagios/rw'
  end

{'fraction_non_alphanumeric': 0.1446340757882557, 'fraction_numerical': 0.019091698004049754, 'mean_word_length': 1.5671863400148478, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3170154', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1126, 'n_words': 173}