works for Joomla component

- more generic
- syncs files before packaging
- not properly tested yet!