Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th May 2012, 01:00 PM
drcool Offline
Registered User
 
Join Date: May 2012
Location: Bangalore
Posts: 1
windows_7ie
Question How to "repackage" a binary .RPM file for example cpio2rpm without installing the RPM

1. I'm able to extract files from a RPM file, but how do I "rebuild" it, for example cpio2rpm?
2. I have extracted RPM file using following command.
rpm2cpio theFileName.rpm | cpio –idmv
3. I have to modify the few web application files like *.php, *.html or .js. These files don’t require any source recompilation. So I would like to replaces or change these files with modification without rebuilding rpm. Since, I need to do this for multiple platforms like Redhat Linux and SUSE, and multiple architecture like 32 and 64 bit OS.
4. I am expecting to do these changes on only on system and without rebuild rpm and there would not be have target system architecture dependency (like i386, 64).
5. I am not looking like command rpmbuild –rebuild the.src.rpm since, I don’t have source. I need to be rebuild binary .RPM file(not source .rpm)
6. I want to do this without source and platform or architecture independent and without using spec file if possible.
Any buddy, could you please suggest any solution or any free tools.
Thank you to all whoever spends time to read and reply to my thread.
Reply With Quote
  #2  
Old 14th May 2012, 06:41 PM
srs5694 Offline
Registered User
 
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 521
linuxfirefox
Re: How to "repackage" a binary .RPM file for example cpio2rpm without installing the

It's probably not optimal, but one way might be to use "alien", which is a program to convert between package formats. Importantly, it supports both tarballs and RPMs. Thus, you could:
  1. Do an RPM-to-tarball conversion with alien
  2. Unpack the tarball
  3. Make any changes you want
  4. Pack a new tarball from the changed files
  5. Do a tarball-to-RPM conversion with alien

One drawback to this is that, since the tarball format doesn't provide some of RPM's metadata (such as flagging configuration files as such), you'll lose that information.
Reply With Quote
  #3  
Old 14th May 2012, 07:35 PM
quickbrownfox Offline
Registered User
 
Join Date: Apr 2009
Posts: 2
linuxchrome
Re: How to "repackage" a binary .RPM file for example cpio2rpm without installing the

Quote:
Originally Posted by srs5694 View Post
It's probably not optimal, but one way might be to use "alien", which is a program to convert between package formats. Importantly, it supports both tarballs and RPMs. Thus, you could:
  1. Do an RPM-to-tarball conversion with alien
  2. Unpack the tarball
  3. Make any changes you want
  4. Pack a new tarball from the changed files
  5. Do a tarball-to-RPM conversion with alien

One drawback to this is that, since the tarball format doesn't provide some of RPM's metadata (such as flagging configuration files as such), you'll lose that information.
This is such a nice idea, but unfortunately that final step doesn't seem to work, because it attempts to rebuild the entire package when you try to convert from tarball to RPM. So unless you have all your dependencies in place, it can't be done. Is there some way to reverse the cpio process.
Reply With Quote
  #4  
Old 14th May 2012, 11:46 PM
beaker_ Offline
Registered User
 
Join Date: Nov 2008
Location: Canada
Posts: 2,419
windows_7ie
Re: How to "repackage" a binary .RPM file for example cpio2rpm without installing the

Quote:
This is such a nice idea, but unfortunately that final step doesn't seem to work, because it attempts to rebuild the entire package when you try to convert from tarball to RPM. So unless you have all your dependencies in place, it can't be done. Is there some way to reverse the cpio process.
Hmmm.., you want to rebuild an RPM but you don't want to install the dependancies? How about mock then.
http://fedoraproject.org/wiki/Projects/Mock
Reply With Quote
  #5  
Old 16th May 2012, 01:12 PM
mschwendt Offline
Registered User
 
Join Date: Jun 2010
Posts: 312
linuxfirefox
Re: How to "repackage" a binary .RPM file for example cpio2rpm without installing the

A reverse rpm2cpio with the possibility to insert file modifications is not a good idea, IMO.

I second parts of the suggestion made by srs5694. Except that I find it more convenient to repack installed files using a very basic "dummy" RPM .spec file in order to be create a ".nosrc.rpm" package. That gives more control over increasing the "Release" value properly, perhaps adding "Obsoletes" tags and renaming the package so it doesn't get replaced again by a normal update. In the spec file %prep section, installed files from the system are copied into the builddir or are extracted from an archive file or a pristine .rpm file using rpm2cpio. Then they get patched and installed into the buildroot. The %files list for that buildroot can be very simple one-liner (to include a full tree), if possible, but may need to explicitly specify special file %attr-ibutes if necessary.
Reply With Quote
Reply

Tags
binary, cpio2rpm, file, installing, repackage, rpm

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Using Fedora 1 21st November 2011 04:09 AM
Just did an update and now I can't login "registering binary handler for windows app" kaarl Using Fedora 6 22nd April 2011 04:38 AM
Is it possible to "repackage" a RPM file? sdotsen Using Fedora 4 21st April 2009 10:40 AM
problems while installing gnome 2.18, "no module named libxml2" and "libmodule_id" parv Using Fedora 1 30th March 2007 10:22 AM
Error:visibility arg must be one of "default", "hidden", "protected" or "internal" wangfeng Using Fedora 0 23rd May 2005 05:59 AM


Current GMT-time: 23:36 (Saturday, 22-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Mangilao Village Travel Photos on Instagram - Indri Travel Photos - Umm el Fahm