Rakefile is ready for Linux. Yahoo!

This commit is contained in:
Alexander Yakovlev 2011-09-06 13:39:10 +07:00
parent 77411674d7
commit a69c617f0d
2 changed files with 45 additions and 36 deletions

10
README
View file

@ -17,12 +17,14 @@ Dependencies
Also you'll need GNU C Compiler, bash and GNU make for building. Also you'll need GNU C Compiler, bash and GNU make for building.
Building Installing
======== ==========
Typically you just can use the following command: Typically you just can use the following command (as root):
rake --silent rake install --silent
It works even on Windows.
You can use "rake -T" to see list of available build options. You can use "rake -T" to see list of available build options.

View file

@ -1,7 +1,7 @@
task :default => 'build:linux' task :default => 'build:linux'
require 'rake/clean' require 'rake/clean'
verbose(false) #verbose(false)
VERSION = "1.0" VERSION = "1.0"
@ -161,44 +161,51 @@ namespace :build do
end end
end end
namespace :install do directory "#{$prefix}/share/doc/steed/"
desc "Install Steed (linux)" directory "#{$prefix}/bin"
task :linux do directory "#{$prefix}/share/steed"
directory "#{$prefix}/share/man/man6"
task :man => "#{$prefix}/share/man/man6" do
Dir.chdir("doc") do
FileList["*.6"].each do |file|
cp file, "#{$prefix}/share/man/man6"
end
end
end
task :data => "#{$prefix}/share/steed" do
FileList["lang/*.ini", "stead/*.lua", "themes/*/*.(ini|jpg|png|ogg|wav|ttf)"].each do |file|
cp file,"#{$prefix}/share/steed"
end
end
task :steed => "#{$prefix}/bin" do #if I do that as file task it thinks it's already done
cp "src/steed/steed", "#{$prefix}/bin"
File.chmod(0755, "#{$prefix}/bin/steed")
end
task :doc => "#{$prefix}/share/doc/steed/" do
Dir.chdir("doc") do
FileList["modules/*.txt","*.html", "*.txt", "*.pdf"].each do |file|
cp file, "#{$prefix}/share/doc/steed/"
end
end
end
desc "Install Steed"
task :install do
$cflags.unshift("-g -Wall")
if (RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i) then
print "Enter prefix path [/usr]:" print "Enter prefix path [/usr]:"
$prefix = STDIN.gets.chomp $prefix = STDIN.gets.chomp
if (!$prefix) then $prefix = "/usr" end if ($prefix.empty?) then $prefix = "/usr" end
$cflags.unshift("-g -Wall")
$cflags.unshift("-Dunix") $cflags.unshift("-Dunix")
$cflags.push(%Q!-DLANG_PATH='"#{$prefix}/share/steed/lang"' -DSTEAD_PATH='"#{$prefix}/share/steed/stead"' -DGAMES_PATH='"#{$prefix}/share/steed/games"' -DTHEMES_PATH='"#{$prefix}/share/steed/themes"' -DVERSION='"#{VERSION}"' -DICON_PATH='"#{$prefix}/share/pixmaps"'!) $cflags.push(%Q!-DLANG_PATH='"#{$prefix}/share/steed/lang"' -DSTEAD_PATH='"#{$prefix}/share/steed/stead"' -DGAMES_PATH='"#{$prefix}/share/steed/games"' -DTHEMES_PATH='"#{$prefix}/share/steed/themes"' -DVERSION='"#{VERSION}"' -DICON_PATH='"#{$prefix}/share/pixmaps"'!)
#next are parallel #next are parallel
Rake::Task["#{$prefix}/share/man/man6"].invoke Rake::Task["doc"].invoke
Rake::Task["#{$prefix}/share/steed"].invoke Rake::Task["data"].invoke
Rake::Task["#{$prefix}/bin"].invoke Rake::Task["steed"].invoke
Rake::Task["#{$prefix}/share/doc/steed/"].invoke Rake::Task["man"].invoke
puts "Installation complete." puts "Installation complete."
end end
Directory "#{$prefix}/share/man/man6" do
Dir.chdir("doc") do
FileList["*.6"].each do |file|
cp file, "#{$prefix}/share/man/man6"
end
end
end
Directory "#{$prefix}/share/steed" do
FileList["lang/*.ini", "stead/*.lua", "themes/*/*.(ini|jpg|png|ogg|wav|ttf)"].each do |file|
cp file,"#{$prefix}/share/steed"
end
end
Directory "#{$prefix}/bin" do
cp "src/steed/steed", "#{$prefix}/bin"
end
Directory "#{$prefix}/share/doc/steed/" do
Dir.chdir("doc") do
FileList["modules/*.txt","*.html", "*.txt", "*.pdf"].each do |file|
cp file, "#{$prefix}/share/doc/steed/"
end
end
end
end end
namespace :test do namespace :test do