/ Published in: Ruby
Just an example of what I'm working on.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class GnuPackage < BasePackage def initialize() super() @base = "#{@name}-${version}" @tarball = "#{@base}.tar.bz2" @url = "ftp://ftp.gnu.org/pub/gnu/#{@name}/#{@tarball}" @dir = @base @build_dir = "#{@name}-build" end end class BinutilsPackage < GnuPackage def initialize() @version = "2.17" @name = "binutils" super() @config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\" --enable-shared --disable-multilib" end def build block("build") do run "cd #{$build_dir}" run "mkdir -p #{@build_dir}" run "cd #{@build_dir}" configure "script" => "../#{@dir}/configure", "opts" => @config_opts run "make configure-host" run "make" end end def install block("install") do run "cd #{$build_dir}" run "cd #{@build_dir}" run "make install" end end end binutils = BinutilsPackage.new binutils.download "/tmp" binutils.extract binutils.build binutils.install