LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-22-2010, 12:56 PM   #1
awong_xen
LQ Newbie
 
Registered: Oct 2010
Posts: 5

Rep: Reputation: 0
RPM - How to package binary tarball


Hello,

I'm trying to package Apache Tomcat binary tarball into a RPM package on CentOS 5.5. The idea is to package the tarball, extract it into /usr/local/, create a tomcat user, change permission on the /usr/local/tomcat install dir, copy the init startup script to /etc/init.d/

Since it's a binary/pre-compiled package, I don't need to compile the source codes.

Does anyone know how I can build such binary package in RPM?


Thank you
 
Old 11-22-2010, 03:29 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
First of all the tomcat package already is available for Centos (tomcat5-5.5.23-0jpp.11.el5_5) and I'm pretty sure it already creates a user account and a SysV init script. If you need to relocate it to /usr/local then you should 'yum --downloadonly' the package and 'rpm --relocate /usr=/usr/local' the package. If you intend to build a binary package doing things your way regardless then the result should never leave your LAN and never be distributed publicly as the package contents can not be verified. Building a binary RPM you would do just like you would build any other package: a tarball in the %{SOURCES} directory, a .spec file in the %{SPECS} directory and then just 'rpmbuild -bb' your .spec file: see http://wiki.centos.org/PackageManagement/Rpm, http://fedoraproject.org/wiki/Docs/D...gPackagesGuide, http://www.rpm.org/wiki/Docs#PackagerDocumentation, rpm5.org/docs/rpm-guide.pdf and rpm5.org/docs/max-rpm.pdf.
 
Old 11-22-2010, 05:21 PM   #3
awong_xen
LQ Newbie
 
Registered: Oct 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your reply unSpawn,

Yes my intention is to build RPM package just for our own internal use only. I understand that the recommended way to build RPMs is to package the "pristine" source codes to compile so that any customizations in the rpm package won't compromise the original source codes during installation. Patching and upgrading the package will also be easier. I took a peek at the .spec file of the Apache Tomcat RPM package that JPackage builds from Apache Tomcat original source codes and it seems complex.

For what I want to do, I had to exclude the %prep and the %build section in the .spec file, so that it does not attempt the compile any files. I added some procedural tasks in the .spec file and was able to build my RPM.


Thanks again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to patch some executables that are part of the binary rpm package ? sultf Linux - Newbie 1 03-03-2009 01:24 PM
how to extract binary or what ever files from rpm package amit_pansuria Programming 5 08-01-2008 06:26 PM
Why tarball is better than rpm maxy7710 Linux - Newbie 8 04-29-2008 09:12 AM
About /usr partition and package tarball satimis Linux From Scratch 1 07-17-2005 01:06 PM
how to make rpm package from source tarball? demmylls Linux - General 2 03-10-2004 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration