<commit_before>require 'formula'

class CupsPdf < Formula
  url 'http://www.cups-pdf.de/src/cups-pdf_2.5.1.tar.gz'
  md5 '4b4cf1a249d02a38045db74b5f259aac'
  homepage 'http://www.cups-pdf.de/'

  # Patch derived from MacPorts.
  def patches; DATA; end

  def install
    system "gcc -O9 -o cups-pdf src/cups-pdf.c"

    (etc+'cups').install "extra/cups-pdf.conf"
    (lib+'cups/backend').install "cups-pdf"
    (share+'cups/model').install "extra/CUPS-PDF.ppd"
  end

  def caveats; <<-EOF
    In order to use cups-pdf with the Mac OS X printing system change the file
    permissions, symlink the necessary files to their System location and
    have cupsd re-read its configuration using:

    chmod 0700 #{(lib+'cups/backend')}/cups-pdf
    sudo chown root #{(lib+'cups/backend')}/cups-pdf
    sudo ln -sf #{(etc+'cups')}/cups-pdf.conf /etc/cups/cups-pdf.conf
    sudo ln -sf #{(lib+'cups/backend')}/cups-pdf /usr/libexec/cups/backend/cups-pdf
    sudo ln -sf #{(share+'cups/model')}/CUPS-PDF.ppd /usr/share/cups/model/CUPS-PDF.ppd
    sudo killall -HUP cupsd

    NOTE: When uninstalling cups-pdf these symlinks need to be removed manually.
EOF
  end
end

__END__<commit_msg>cups-pdf: rewrite caveats<commit_after>require 'formula'

class CupsPdf < Formula
  url 'http://www.cups-pdf.de/src/cups-pdf_2.5.1.tar.gz'
  md5 '4b4cf1a249d02a38045db74b5f259aac'
  homepage 'http://www.cups-pdf.de/'

  # Patch derived from MacPorts.
  def patches; DATA; end

  def install
    system "gcc -O9 -o cups-pdf src/cups-pdf.c"

    (etc+'cups').install "extra/cups-pdf.conf"
    (lib+'cups/backend').install "cups-pdf"
    (share+'cups/model').install "extra/CUPS-PDF.ppd"
  end

  def caveats; <<-EOF.undent
      In order to use cups-pdf with the Mac OS X printing system change the file
      permissions, symlink the necessary files to their System location and
      have cupsd re-read its configuration using:

      chmod 0700 #{lib}/cups/backend/cups-pdf
      sudo chown root #{lib}/cups/backend/cups-pdf
      sudo ln -sf #{etc}/cups/cups-pdf.conf /etc/cups/cups-pdf.conf
      sudo ln -sf #{lib}/cups/backend/cups-pdf /usr/libexec/cups/backend/cups-pdf
      sudo ln -sf #{share}/cups/model/CUPS-PDF.ppd /usr/share/cups/model/CUPS-PDF.ppd

      sudo mkdir -p /var/spool/cups-pdf/${USER}
      ln -s /var/spool/cups-pdf/${USER} ${HOME}/Documents/cups-pdf
      sudo killall -HUP cupsd

      NOTE: When uninstalling cups-pdf these symlinks need to be removed manually.
    EOF
  end
end

__END__
{'fraction_non_alphanumeric': 0.1357629154985983, 'fraction_numerical': 0.022426912294753704, 'mean_word_length': 3.0684039087947883, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6675063', 'n_tokens_mistral': 1005, 'n_tokens_neox': 958, 'n_words': 227}