Sha256: adfc7eb5c6b622228fdd02764d1995a30989bc9476285cd23248f215bcd23894

Contents?: true

Size: 1.49 KB

Versions: 72

Compression:

Stored size: 1.49 KB

Contents

require 'rake'

namespace :dad do
  namespace :leptonica do
    task :install do
      name = 'leptonica-1.72'
      file = "#{name}.tar.gz"

      unless File.exist?("tmp/#{file}")
        run "wget http://www.leptonica.com/source/#{file} -O tmp/#{file}"
      end

      run "rm -Rf tmp/#{name}",
          "cd tmp && tar zxf #{file}",
          "cd tmp/#{name} && ./configure",
          "cd tmp/#{name} && make",
          "cd tmp/#{name} && sudo make install"
    end
  end

  namespace :tesseract do
    task :install do
      name = 'tesseract'
      version = '3.04.00'
      file = "#{name}-#{version}.tar.gz"

      unless File.exist?("tmp/#{file}")
        run "wget https://github.com/tesseract-ocr/tesseract/archive/#{version}.tar.gz -O tmp/#{file}"
      end

      run "rm -Rf tmp/#{name}",
          "cd tmp && tar zxf #{file}",
          "cd tmp/#{name}-#{version} && ./configure",
          "cd tmp/#{name}-#{version} && make",
          "cd tmp/#{name}-#{version} && sudo make install"
    end
    
    task :lang do
      name = 'tessdata'
      version = '3.04.00'
      file = "#{name}-#{version}.tar.gz"

      unless File.exist?("tmp/#{file}")
        run "wget https://github.com/tesseract-ocr/tessdata/archive/#{version}.tar.gz -O tmp/#{file}"
      end

      run "rm -Rf tmp/#{name}-#{version}",
          "cd tmp && tar zxf #{file}"

      ['eng', 'jpn'].each do |lang|
        system("sudo cp -f tmp/#{name}-#{version}/#{lang}.traineddata /usr/local/share/tessdata/")
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
daddy-0.9.13 lib/tasks/tesseract.rake
daddy-0.9.12 lib/tasks/tesseract.rake
daddy-0.9.11 lib/tasks/tesseract.rake
daddy-0.9.10 lib/tasks/tesseract.rake
daddy-0.9.9 lib/tasks/tesseract.rake
daddy-0.9.8 lib/tasks/tesseract.rake
daddy-0.9.7 lib/tasks/tesseract.rake
daddy-0.9.6 lib/tasks/tesseract.rake
daddy-0.9.5 lib/tasks/tesseract.rake
daddy-0.9.4 lib/tasks/tesseract.rake
daddy-0.9.3 lib/tasks/tesseract.rake
daddy-0.9.2 lib/tasks/tesseract.rake
daddy-0.9.1 lib/tasks/tesseract.rake
daddy-0.9.0 lib/tasks/tesseract.rake
daddy-0.8.1 lib/tasks/tesseract.rake
daddy-0.8.0 lib/tasks/tesseract.rake
daddy-0.7.9 lib/tasks/tesseract.rake
daddy-0.7.8 lib/tasks/tesseract.rake
daddy-0.7.7 lib/tasks/tesseract.rake
daddy-0.7.6 lib/tasks/tesseract.rake