<commit_before>name "python-rrdtool"
default_version "1.3.8"
dependency "python"

build do
  license "https://raw.githubusercontent.com/oetiker/rrdtool-1.x/master/COPYRIGHT"
  
  if ENV['PKG_TYPE'] == 'deb'
    command "wget http://dd-agent.s3.amazonaws.com/python-rrdtool/deb/#{ENV['ARCH']}/rrdtool.so", :cwd => "#{install_dir}/embedded/lib/python2.7/"
  elsif ENV['PKG_TYPE'] == 'rpm'
   command "sudo yum -y install intltool gettext cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel gcc groff perl-ExtUtils-MakeMaker"
   command "sudo wget http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gz", :cwd => "/tmp/"
   command "sudo tar xvzf ExtUtils-MakeMaker-6.31.tar.gz", :cwd => "/tmp/"
   command "sudo perl Makefile.PL", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo make", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo make install", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-#{version}.tar.gz", :cwd => "/opt/"
   command "sudo tar -xzvf rrdtool-#{version}.tar.gz", :cwd => "/opt/"
   command "sudo ./configure", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo make", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo make install", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo #{install_dir}/embedded/bin/python setup.py install", :cwd => "/opt/rrdtool-#{version}/bindings/python/"<commit_msg>Fix platform detection<commit_after>name "python-rrdtool"
default_version "1.3.8"
dependency "python"

build do
  license "https://raw.githubusercontent.com/oetiker/rrdtool-1.x/master/COPYRIGHT"
  
  if Ohai['platform'] == 'debian'
    command "wget http://dd-agent.s3.amazonaws.com/python-rrdtool/deb/#{ENV['ARCH']}/rrdtool.so", :cwd => "#{install_dir}/embedded/lib/python2.7/"
  elsif Ohai['platform'] == 'rhel'
   command "sudo yum -y install intltool gettext cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel gcc groff perl-ExtUtils-MakeMaker"
   command "sudo wget http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gz", :cwd => "/tmp/"
   command "sudo tar xvzf ExtUtils-MakeMaker-6.31.tar.gz", :cwd => "/tmp/"
   command "sudo perl Makefile.PL", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo make", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo make install", :cwd => "/tmp/ExtUtils-MakeMaker-6.31"
   command "sudo wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-#{version}.tar.gz", :cwd => "/opt/"
   command "sudo tar -xzvf rrdtool-#{version}.tar.gz", :cwd => "/opt/"
   command "sudo ./configure", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo make", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo make install", :cwd => "/opt/rrdtool-#{version}", :env => {"PKG_CONFIG_PATH" => "/usr/lib/pkgconfig/"}
   command "sudo #{install_dir}/embedded/bin/python setup.py install", :cwd => "/opt/rrdtool-#{version}/bindings/python/"
{'fraction_non_alphanumeric': 0.19883399815894445, 'fraction_numerical': 0.015342129487572876, 'mean_word_length': 4.216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1862429', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1235, 'n_words': 229}