This should work:
$ mkdir foo
$ tar -C foo --strip-components=1 -xzf foo-latest.tar.gz
First we create output directory.
After that we use -C
to extract archive to that directory and --strip-components
to get rid of root directory from archive.