Sheller example


/ Published in: Ruby
Save to your folder(s)

Just an example of what I'm working on.


Copy this code and paste it in your HTML
  1. class GnuPackage < BasePackage
  2. def initialize()
  3. super()
  4.  
  5. @base = "#{@name}-${version}"
  6. @tarball = "#{@base}.tar.bz2"
  7. @url = "ftp://ftp.gnu.org/pub/gnu/#{@name}/#{@tarball}"
  8. @dir = @base
  9. @build_dir = "#{@name}-build"
  10. end
  11.  
  12. end
  13.  
  14. class BinutilsPackage < GnuPackage
  15. def initialize()
  16. @version = "2.17"
  17. @name = "binutils"
  18. super()
  19.  
  20. @config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\" --enable-shared --disable-multilib"
  21. end
  22.  
  23. def build
  24. block("build") do
  25. run "cd #{$build_dir}"
  26. run "mkdir -p #{@build_dir}"
  27. run "cd #{@build_dir}"
  28. configure "script" => "../#{@dir}/configure", "opts" => @config_opts
  29. run "make configure-host"
  30. run "make"
  31. end
  32. end
  33.  
  34. def install
  35. block("install") do
  36. run "cd #{$build_dir}"
  37. run "cd #{@build_dir}"
  38. run "make install"
  39. end
  40. end
  41. end
  42.  
  43. binutils = BinutilsPackage.new
  44. binutils.download "/tmp"
  45. binutils.extract
  46. binutils.build
  47. binutils.install

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.