require 'rubygems' require 'rake' require 'rake/clean' require 'rake/gempackagetask' require 'tools/rakehelp' require 'spec/rake/spectask' setup_extension('clamav', 'clamav') desc "Compile native extension" task :compile => [:clamav] task :default => [:compile, :spec] Spec::Rake::SpecTask.new do |task| task.libs << 'spec' task.spec_files = Dir.glob( 'spec/**/*_spec.rb' ) task.verbose = true end begin require 'jeweler' Jeweler::Tasks.new do |gemspec| gemspec.name = "clamav" gemspec.author = "Alexander Oryol" gemspec.email = "eagle.alex@gmail.com" gemspec.summary = "ClamAV Ruby bindings" gemspec.homepage = "http://github.com/eagleas/clamav" gemspec.rubyforge_project = 'clamav' gemspec.description = "ClamAV Ruby bindings" gemspec.require_path = 'lib' if RUBY_PLATFORM.match("win32") gemspec.platform = Gem::Platform::WIN32 else gemspec.platform = Gem::Platform::RUBY gemspec.extensions = Dir.glob( 'ext/**/extconf.rb' ) end end rescue LoadError puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://gemcutter.org" end task :package => [:clean, :compile, :spec] setup_clean ["ext/clamav/*.{so,o}", "ext/clamav/Makefile", "lib/clamav.so", "pkg", "*.gem"] task :install => [:default, :package] do sh %{ sudo gem install pkg/clamav-#{GEM_VERSION}.gem } end task :uninstall do sh %{ sudo gem uninstall clamav } end