Fixes for installing, now for packaging.
This commit is contained in:
parent
a69c617f0d
commit
7f7d86d93b
78
Rakefile
78
Rakefile
|
@ -1,7 +1,7 @@
|
|||
task :default => 'build:linux'
|
||||
|
||||
require 'rake/clean'
|
||||
#verbose(false)
|
||||
verbose(false)
|
||||
|
||||
VERSION = "1.0"
|
||||
|
||||
|
@ -20,11 +20,7 @@ namespace :build do
|
|||
desc "Build from sources for Linux (generic) (default)"
|
||||
task :linux do
|
||||
puts "Building Steed for Linux."
|
||||
configure()
|
||||
|
||||
#puts $cflags.join (" ")
|
||||
#puts $libs.join(" ")
|
||||
|
||||
configure()
|
||||
$cflags.unshift(" -D_LOCAL_APPDATA") #i swear i would get rid of this s**t
|
||||
$cflags.unshift("-g -Wall")
|
||||
$cflags.unshift("-Dunix")
|
||||
|
@ -163,6 +159,7 @@ end
|
|||
|
||||
directory "#{$prefix}/share/doc/steed/"
|
||||
directory "#{$prefix}/bin"
|
||||
directory "#{$prefix}"
|
||||
directory "#{$prefix}/share/steed"
|
||||
directory "#{$prefix}/share/man/man6"
|
||||
|
||||
|
@ -199,6 +196,16 @@ task :install do
|
|||
if ($prefix.empty?) then $prefix = "/usr" end
|
||||
$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"'!)
|
||||
configure()
|
||||
Dir.chdir("src/steed") do
|
||||
sources = FileList["graphics.c","input.c","game.c","main.c","instead.c","sound.c","SDL_*.c","config.c","themes.c","menu.c","util.c","cache.c","unzip.c","ioapi.c","unpack.c","lfs.c","idf.c"]
|
||||
sources.push ("unix.c")
|
||||
sources.each do|src|
|
||||
sh %Q(#{$cc} -c #{src} #{$cflags.join(" ")})
|
||||
end
|
||||
sh "#{$cc} #{$cflags.join(" ")} #{sources.ext("o").join(" ")} #{$libs.join(" ")} -o steed"
|
||||
sh "ln -fs src/steed/steed ./steed"
|
||||
end
|
||||
#next are parallel
|
||||
Rake::Task["doc"].invoke
|
||||
Rake::Task["data"].invoke
|
||||
|
@ -206,6 +213,29 @@ task :install do
|
|||
Rake::Task["man"].invoke
|
||||
puts "Installation complete."
|
||||
end
|
||||
if (Win32.windows?) then
|
||||
$cflags.unshift("-Dwindows -mwindows -D_SDL_MOD_BUG")
|
||||
$prefix = "."
|
||||
$cflags.push(%Q!-DLANG_PATH='"./lang"' -DSTEAD_PATH='"#{$prefix}/stead"' -DGAMES_PATH='"#{$prefix}/games"' -DTHEMES_PATH='"#{$prefix}/themes"' -DVERSION='"#{VERSION}"' -DICON_PATH='"#{$prefix}/icon"'!)
|
||||
configure()
|
||||
Dir.chdir("src/steed") do
|
||||
sources = FileList["graphics.c","input.c","game.c","main.c","instead.c","sound.c","SDL_*.c","config.c","themes.c","menu.c","util.c","cache.c","unzip.c","ioapi.c","unpack.c","lfs.c","idf.c"]
|
||||
sources.push ("windows.c iowin32.c")
|
||||
sources.each do|src|
|
||||
sh %Q(#{$cc} -c #{src} #{$cflags.join(" ")})
|
||||
end
|
||||
sh "#{$cc} #{$cflags.join(" ")} #{sources.ext("o").join(" ")} #{$libs.join(" ")} -o steed"
|
||||
end
|
||||
Rake::Task["steed"].invoke
|
||||
$prefix = "./bin"
|
||||
FileList["lang/*.ini", "stead/*.lua", "themes/*/*.(ini|jpg|png|ogg|wav|ttf)"].each do |file|
|
||||
cp file,"#{$prefix}"
|
||||
end
|
||||
FileList["modules/*.txt","*.html", "*.txt", "*.pdf"].each do |file|
|
||||
cp file, "#{$prefix}/doc"
|
||||
end
|
||||
puts "Installation complete."
|
||||
end
|
||||
end
|
||||
|
||||
namespace :test do
|
||||
|
@ -260,12 +290,44 @@ namespace :packaging do
|
|||
$cc = "i486-mingw32-gcc"
|
||||
$ar = "i486-mingw32-ar rc"
|
||||
$ranlib = "i486-mingw32-ranlib"
|
||||
|
||||
$cflags.push("-Dwindows -mwindows -D_SDL_MOD_BUG")
|
||||
$prefix = "./package/windows"
|
||||
$cflags.push(%Q!-DLANG_PATH='"./lang"' -DSTEAD_PATH='"#{$prefix}/stead"' -DGAMES_PATH='"#{$prefix}/games"' -DTHEMES_PATH='"#{$prefix}/themes"' -DVERSION='"#{:version}"' -DICON_PATH='"#{$prefix}/icon"'!)
|
||||
configure()
|
||||
Dir.chdir("src/steed") do
|
||||
sources = FileList["graphics.c","input.c","game.c","main.c","instead.c","sound.c","SDL_*.c","config.c","themes.c","menu.c","util.c","cache.c","unzip.c","ioapi.c","unpack.c","lfs.c","idf.c"]
|
||||
sources.push ("windows.c iowin32.c")
|
||||
sources.each do|src|
|
||||
sh %Q(#{$cc} -c #{src} #{$cflags.join(" ")})
|
||||
end
|
||||
sh "#{$cc} #{$cflags.join(" ")} #{sources.ext("o").join(" ")} #{$libs.join(" ")} -o steed"
|
||||
end
|
||||
Rake::Task[$prefix].invoke
|
||||
FileList["lang/*.ini", "stead/*.lua", "themes/*/*.(ini|jpg|png|ogg|wav|ttf)"].each do |file|
|
||||
cp file,"#{$prefix}"
|
||||
end
|
||||
FileList["modules/*.txt","*.html", "*.txt", "*.pdf"].each do |file|
|
||||
cp file, "#{$prefix}/doc"
|
||||
end
|
||||
puts "Packaging complete."
|
||||
end
|
||||
desc "Packaging for Linux (generic)"
|
||||
task :linux, [:version] do |t, args|
|
||||
args.with_defaults(:version => VERSION)
|
||||
$cflags.push("-Dunix")
|
||||
$prefix = "./package/unix"
|
||||
Rake::Task[$prefix].invoke
|
||||
FileList["lang/*.ini", "stead/*.lua", "themes/*/*.(ini|jpg|png|ogg|wav|ttf)"].each do |file|
|
||||
cp file,"#{$prefix}"
|
||||
end
|
||||
FileList["modules/*.txt","*.html", "*.txt", "*.pdf"].each do |file|
|
||||
cp file, "#{$prefix}/doc"
|
||||
end
|
||||
FileList["src/*/*.(c|h)"].each do |file|
|
||||
cp file, "#{$prefix}/src"
|
||||
end
|
||||
cp "Rakefile", $prefix
|
||||
File.open("#{$prefix}/Rakefile", 'r+') { |f| newstr = f.read.gsub (Q(VERSION = "#{VERSION}"), Q(VERSION = "#{:version}")); f.rewind; f.puts(newstr) }
|
||||
puts "Packaging complete."
|
||||
end
|
||||
desc "Packaging for Debian and Ubuntu"
|
||||
task :debian, [:version] do |t, args|
|
||||
|
|
Loading…
Reference in a new issue