• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

being tortured by rpm spec file...pls help

Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
Saloon Keeper
Posts: 22265
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic