Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to create Helloworld program's RPM package for centos!

 
Ranch Hand
Posts: 630
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
From many days i am trying to do RPM package of helloworld program.But not succeeded.
I follow tutorials,websites,question-answers in different forum.
My steps as follows:-
1. In centos5.0 (though it is old version, i have no choice of os) i have 'rpm-build-4.4.2.3-36.el5_11' package which helpful for creating rpm packages.
2, Oracle java

3. I have JavaFX Ant API version 1.3
4. create new java project named 'helloworld'
5. In Project properties i found in Deployment properties checkbox for 'Enable Native packaging Actions in Project menu'.
6. click 'RPM package' in 'package as' which appears when right click on project.
Got error:-

I am worrying about how can i do this?
I not found any tool which run in Ubuntu/windows & then also it make RPM package for Centos!
I can make installer(package) for same os...like in windows i can create .exe or .msi. i can create RPM in ubuntu which works in same machine but it not work in centos due to that ubuntu is 64 bit & centos i have is 32 bit.
In tutorial there always shown examples which works very fine..there is no example for simple hello world program...
Need help from this forum. Please.
 
Bartender
Posts: 20921
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't feel bad about using CentOS 5. I am just now converting my production server farm over to CentOS 6. In part because I like Xen and CentOS 6 doesn't love Xen the way that CentOS 5 did, so first I had to convert all my Xen VMs to run under KVM-QEMU.

I'm in no hurry to rush to CentOS 7, though. The bloody thing's infested with systemd. My desktop machine's got systemd and every time I have a boot issue I end up screaming at what they did to logging. And I have a LOT more boot issues on the production machines than I do on the desktop and a lot less time to deal with them.

In general you cannot construct packages for one OS (or OS flavor) under another OS. That's true whether it's a Windows package, a deb package, a Solaris package or an RPM. The primary build tool is generally a native application and in some cases it actually queries the OS it's running under for architectural/filesystem information.

In its purest form, in fact, an RPM is supposed to take a generic binary project (typically a tarball), explode it into a source directory, apply customizing patches to the source that adapt it to the flavor and version of the OS in question, run the build, deploy it, then scoop up the results and bundle them (along with supporting scripts and metadata) into a binary RPM. So actually, the rpmbuild program can produce both source (SRPM) and executable (RPM) packages.

Things get a little trickier when you're working with Java. You generally don't include the JVM itself in the package, you depend on there being a copy of Java already installed. You don't need to patch anything since Java is write-once/run-anywhere and thus (supposedly) needs no customization. Usually the build is already done and you have a WAR or JAR and simply want to RPM-ize it.

In fact, the easiest way to build Java app/webapp RPMs is to use a build-system plugin. There's one for Ant and one for Maven and since I'm almost exclusively Maven-based these days, I use the Maven one to good effect.

But getting back to your cross-system issues. Forget Windows. Ubuntu MIGHT be able to do something with its "alien" package support facilities, but I don't know. Ubuntu has been trying for years to be more enterprise-oriented than straight Debian has, which means that they're constantly having to pilfer stuff from the Red Hat resources. A safer bet would probably be to spin up a CentOS VM under Ubuntu (or Windows) and do the build there. You can build the VM manually, or use Vagrant to spin up one of the pre-packaged CentOS images.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!