Rake question - what is the best way to package multiple thi

I would like to make my Rakefile be able to create multiple packages and
for
these packages I need them to be created relative to a subdirectory so
that
the zip, tgz, and gem contain everything at the right level. See my
example
below.

I have considered two ways to do this but am looking for the best way.

  1. change directory before packaging (but then one has to reset the
    directory and build the file lists in the right dir, etc.)
  2. use multiple rake files and have the main one call them

So here is an example

foo/
foo/bar
foo/bar/cat.txt
foo/baz
foo/baz/dog.txt

I want to build something out of foo and I want to build something out
of
bar and baz such that the files in the zip, tgz, and gem are relative to
bar
or baz. So that in the gem cat.txt would be stored at the main level
(root)
of the bar.gem. Same thing for dog.txt it would be stored in baz gem at
the
root of that gem.

Or if anyone has a better idea.

Thanks,

Jeff