Do manual do GNU alcatrão:
When
tar
extracts archive members from an archive, it strips any leading slashes ('/') from the member name. This causes absolute member names in the archive to be treated as relative file names. This allows you to have such members extracted wherever you want, instead of being restricted to extracting the member in the exact directory named in the archive. For example, if the archive member has the name '/etc/passwd
', tar will extract it as if the name were really 'etc/passwd
'.
Assim, minha criação de alcatrão é assim:
tar -czvf myproject.tar.gz -C tmp/tarball ./
./
./etc/
./etc/service/
./etc/service/sensorservices/
./usr/
./usr/local/
./opt/
./opt/myproject/
Quando isso é instalado com:
sudo tar --directory / -xzf ./myproject.tar.gz
sudo tar -C / -xzf ./myproject.tar.gz
Então tudo funciona como esperado, para melhor ou para pior.