LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-22-2014, 09:23 PM   #1
rubanek
LQ Newbie
 
Registered: Apr 2008
Location: MD
Distribution: CentOS, Fedora
Posts: 23
Blog Entries: 1

Rep: Reputation: 1
Build RPM from binary tarball


I'm trying to package Apache Tomcat binary tarball into an RPM package for CentOS 6.4. The idea is to easily install tomcat via yum from my private yum repo. I want the rpm to untar the tarball to a particular directory (/usr/local/tomcat); recursively chown said directory and finally install an init script. Yes, I realize EPEL offers a tomcat.noarch rpm, but it's not the latest version of tomcat.

This should be easy, but I guess what I'm trying to achieve is so outside the box of best practices I can't find any tutorials.

Once I have the rpm I'll be able to deploy tomcat via Puppet. Good times. Good times.

Thanks!

-rubanek
 
Old 05-23-2014, 12:03 AM   #2
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 544

Rep: Reputation: 59
Quote:
Originally Posted by rubanek View Post
I'm trying to package Apache Tomcat binary tarball into an RPM package for CentOS 6.4. The idea is to easily install tomcat via yum from my private yum repo.
You would normally build an rpm from a source tarball, not a binary tarball.
If you have a local copy of the source in an svn or hg repository, you would normally build a source package which would then be used to build the rpm, using rpmbuild and a spec file to detail how to build and package the files.
If you don't have a local svn or hg repository, then you can get the tomcat-src.rpm, and use rpmbuild to rebuild an rpm.
The src.rpm usually contains a source archive (tar.gz, or similar) plus the spec file, and possibly patches to fix any problems.
Have a read about 'rpmbuild', to get more detail.

Cheers,
Terry
 
Old 05-23-2014, 12:57 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,513

Rep: Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063Reputation: 8063
yes, rpmbuild is used to create rpm packages. You do not really need to rebuild from source, it is only a possibility, you can skip that step. The permissions are also set by the tool you do not need to implement that yourself.
http://www.rpm.org/wiki/Docs#PackagerDocumentation
 
1 members found this post helpful.
Old 05-23-2014, 07:03 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Building rpm from files : Actually quite simlple.

Create a spec file with the right file list, and run $ rpmbuild -bb file.spec
-
Attached Files
File Type: txt test.spec.txt (235 Bytes, 306 views)
 
Old 05-23-2014, 10:05 AM   #5
msekara
LQ Newbie
 
Registered: May 2014
Posts: 3

Rep: Reputation: Disabled
As above.

Make sure you disable jar re-packing in your spec file.
 
1 members found this post helpful.
  


Reply

Tags
rpm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Unable to build binary RPM DougCM Linux - Software 3 01-16-2011 08:07 AM
RPM - How to package binary tarball awong_xen Linux - Software 2 11-22-2010 05:21 PM
Failure to build binary rpm from src for autoconf ks2andrew Linux - Software 1 07-16-2010 10:26 AM
Wrote spec file, installed RPM, binary gives relocation error and refers to build dir hollywoodb Red Hat 2 05-19-2007 10:27 AM
Unable to build RPM file from tarball tkt Linux - Newbie 1 04-26-2005 02:29 AM

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

All times are GMT -5. The time now is 02:23 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