title: Correct way to package a Java application into an RPM
body: <p>I've created an Java application and I would like to create an installation RPM for it. The application consists of a set of jar files, a system library file, a script to launch the application, and a directory to store user configuration information. The installation structure I'm trying to achieve looks like this:</p>
  
  <pre><code>/usr/local/[appname]
    /jar
      *.jar
    /lib
      *.so
    /etc
       [future home of user.properties]
    launch.sh
  </code></pre>
  
  <p>Most of the information I've studied for <code>.spec</code> files and <code>RPM</code> in general, revolves around using <code>make</code> to configure and install an application. I haven't found any good information on packaging Java applications. Currently, my build system arranges all the files into the above structure, copies it to the <code>BUILD</code> directory and the spec file just dumps it. That works but I've found in testing that there are several directives that I need to include for the <code>%files</code> section and I generally feel like I'm having to be more specific than I should for an automated build process. </p>
  
  <p>Is there a correct (or best) way to package a Java applications for RPM?.</p>