Class Uttk::Strategies::Package
In: lib/uttk/strategies/Package.rb
Parent: Collection

Methods

Included Modules

Concrete Ordered

Public Instance methods

[Source]

# File lib/uttk/strategies/Package.rb, line 15
      def prologue
        extract_dir = '<<extract_dir>>'
        self.attributes = {
          :dir => extract_dir,
        }

        super

        create(Checkout) do |checkout|
          checkout.name = 'Checkout'
          checkout.url = @url
          checkout.fatal = true
          checkout.weight = 0
        end

        unless skip_step? 'configure'
          create(Bootstrap) do |bootstrap|
            bootstrap.name = 'Bootstrapping'
            bootstrap.weight = 0
          end
        end

        unless skip_step? 'bootstrap'
          create(Configure) do |configure|
            configure.name = 'Configuring'
            configure.prefix = @prefix
            configure.flags = @configure_flags
            configure.weight = 0
          end
        end

        unless skip_step? 'build'
          create(Make) do |build|
            build.name = 'Building'
            build.continue_mode = true
            # build.jobs = 2
            build.fatal = true
          end
        end

        make = {}

        %w[ check distcheck install ].each do |step|
          next if skip_step? step
          create(Make) do |build|
            build.name = "Building #{step}"
            build.target = step
            build.fatal = true
            make[step.to_sym] = build
          end
        end

        if @install_prefix and make.has_key? :install
          make[:install].options << "prefix=#@install_prefix"
        end

        if make.has_key? :distcheck
          make[:distcheck].options <<
            "DISTCHECK_CONFIGURE_FLAGS='<<configure_flags>>'"
        end

        # FIXME does this step make sense
        unless skip_step? 'tarball'
          create(Block) do |test|
            test.name = 'Exporting the tarball'
            test.test = proc do
              balls = Pathname.glob("#{extract_dir}/*.tar.*")
              unless balls.empty?
                @log.new_node :contents, :ordered => true do
                  balls.each do |ball|
                    ball.copy(dir)
                    @log << ball
                  end
                end
              end
              true
            end
          end
        end

        unless @test.nil? or skip_step? 'test'
          create(@test)
        end

        unless skip_step? 'clean'
          create(Clean) do |clean|
            clean.name = 'Cleaning'
            clean.fatal = true
            clean.weight = 0
          end
        end

      end

[Source]

# File lib/uttk/strategies/Package.rb, line 109
      def skip_step? ( step )
        step = /#{step}/i unless step.is_a? Regexp
        @skip_steps.any? { |x| step =~ x }
      end

[Validate]