I am trying to package a java application into an RPM. I have gone through several tutorials and I am also able to make an RPM but there are some issues with it that I am unable to figure out.
Basically, the java app consists of a couple of jars, a property file, and a shell script to trigger the app. jars are generated by ant.
Now, even after reading so much about rpm spec files, I am totally confused about the following things -
1. Where should I put my jars and other files? rpm/SOURCES or rpm/BUILD? Since my jars are already ready (created by ant) I don't want to do anything in "build" section. There is nothing to build. Right? 2. What should I do in "Install" section? I would like to have the user install the application (i.e. the jars) in /home/username/javaapps/myapp. Should I actually install (i.e. just create this directory structure /home/annb/javaapps/myapp) or should I create this dir structure under Install? 3. what should go in the files section? As I understand, all the files that I want in the rpm should be listed here. But I am totally lost about from where should I pick the files? From BUILD or from INSTALL? 4. This is what I have in my spec file. (Shown below). When it creates an rpm, the rpm contains the hardcoded directoty structure i.e. /home/annb/...
Please help. I am totally frustrated with this RPM crap.
If you have any idea what is going on, please let me know... [ October 17, 2008: Message edited by: Ann Basso ]
Post by:Tim Holloway
You've got a binary-only RPM build and RPM (ahem) "encourages" you to make all your packages completely reconstructable from the original sources plus patches. Sometimes RPM can be annoying that way.
What will probably work best for you is if you create a ZIP or tarball containing all your original files and make that your "source". The build stage will then essentially just unzip the source archive file and construct a filesystem model mapping the intended final disk layout. Then the "files" directives will ensure that they are properly included and configured into the binary RPM.
Of course, if you want to make the build step actually pull CVS and do an ant/Maven build, that's OK too.
If you prefer a more holistic approach, there's also an Ant task that can build RPMs straight from your Java build process. Maven has a plugin to do likewise, but I've never actually used it and I'm not sure it's as mature.
You showed up just in time for the waffles! And this tiny ad: