Rework building of packages in application

Sorry for this ultra ugly commit, however I'm not able to find better way out of this ...

Signed-off-by: Tomas Hozza <thozza@redhat.com>