def define
    super

    task :package => [:gem]

    gem_file = File.basename gem_spec.cache_file
    gem_path = File.join package_dir, gem_file
    gem_dir  = File.join package_dir, gem_spec.full_name

    desc "Build the gem file #{gem_file}"
    task :gem => [gem_path]

    trace = Rake.application.options.trace
    Gem.configuration.verbose = trace

    file gem_path => [package_dir, gem_dir] + @gem_spec.files do
      chdir(gem_dir) do
        when_writing "Creating #{gem_spec.file_name}" do
          Gem::Builder.new(gem_spec).build
          verbose trace do
            mv gem_file, '..'
          end
        end
      end
    end
  end
#
Create the Rake tasks and actions specified by this Gem::PackageTask.
(+define+ is automatically called if a block is given to +new+).