You can write "scriptlets" under Section '%pre' (processings before installation on the target host) and '%post' (after installation on the target host).
In these scripts you have to find out where your deployment folder is located.
Is your JBOSS packed in an rpm?