LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-01-2008, 11:15 AM   #1
amit_pansuria
Member
 
Registered: Sep 2006
Posts: 73

Rep: Reputation: 15
how to repack particular rpm packages


Helo ,

i m new in linux .

I have my own rpms which contains binaries,config files, scripts etc

now I have modfied some binaries,particular scripts.

Now I want to write a shell script which repack my particular rpm without installing it.

how do i do any idea


Regards,
Amit
 
Old 08-01-2008, 12:19 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
Building an RPM does not equal installing it unless you're building RPMs the "wrong" way: as root account user. In general that is not necessary. If you mean rebuilding an RPM from source then you just need to diff things and add patchlines to your .spec file. If you mean working with an already installed RPM as source you could try "rpmrebuild" (Sourceforge).
 
Old 08-04-2008, 01:24 AM   #3
amit_pansuria
Member
 
Registered: Sep 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
Building an RPM does not equal installing it unless you're building RPMs the "wrong" way: as root account user. In general that is not necessary. If you mean rebuilding an RPM from source then you just need to diff things and add patchlines to your .spec file. If you mean working with an already installed RPM as source you could try "rpmrebuild" (Sourceforge).
Helo thx for replying me.

I have my own rpm packages installed on my system. now,

problem is that some of binaries,scripts and configuartion files need to modfied. I need to replace all these modfied files with the original files only not need to modify all the files.
for that how i unpack my rpm package , replace modified binaries with the original files and repack the rpm package without changing the version info.

Regrads,
Amit
 
Old 08-04-2008, 01:36 AM   #4
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Rep: Reputation: 15
Quote:
Originally Posted by amit_pansuria View Post
Helo thx for replying me.

I have my own rpm packages installed on my system. now,

problem is that some of binaries,scripts and configuartion files need to modfied. I need to replace all these modfied files with the original files only not need to modify all the files.
for that how i unpack my rpm package , replace modified binaries with the original files and repack the rpm package without changing the version info.

Regrads,
Amit
hi amit
do you wants to develop a new .rpm using your previous rpm files aswellas modified files.

first you need to create a .spec file.
i think you know how to create .spec file..

regards
swift
 
Old 08-04-2008, 04:14 AM   #5
amit_pansuria
Member
 
Registered: Sep 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by swift2008 View Post
hi amit
do you wants to develop a new .rpm using your previous rpm files aswellas modified files.

first you need to create a .spec file.
i think you know how to create .spec file..

regards
swift
helo thx for replying me.
now i dont want to develop new rpm.
I want to use my already installed rpm.
first I want to extract number of files from that rpm,
then i need to modyfy some of the files and repack that rpm

for exaple suppose my rpm contains 20 binaries files,5 shell scripts, 10 configuration files.

this rpm is already installed on my system.

now I want to extract files from rpm, need to replace 3 binaries files,
2 shell scripts files with modified binaries files and shell scripts.
and remaining binaries and other files i want to keep as it is.

how this is possible.
Regards,
Amit
 
Old 08-04-2008, 05:18 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by amit_pansuria View Post
I have my own rpm packages installed on my system. now, problem is that some of binaries,scripts and configuartion files need to modfied. I need to replace all these modfied files with the original files only not need to modify all the files. for that how i unpack my rpm package , replace modified binaries with the original files
Copy your package to a temporary directory. Run 'rpm2cpio package.rpm|cpio -idm' to extract its contents. Replace versions on disk by hand.


Quote:
Originally Posted by amit_pansuria View Post
and repack the rpm package without changing the version info.
Maybe you read over it but I already pointed you at "rpmrebuild". By the way, what are your reasons for wanting to repack a package that way instead of building the package? Note that the resultant package of using rpmrebuild should *never* be publicly redistributed the way "original" packages are, simply because it isn't.
 
Old 08-04-2008, 06:05 AM   #7
amit_pansuria
Member
 
Registered: Sep 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
Copy your package to a temporary directory. Run 'rpm2cpio package.rpm|cpio -idm' to extract its contents. Replace versions on disk by hand.



Maybe you read over it but I already pointed you at "rpmrebuild". By the way, what are your reasons for wanting to repack a package that way instead of building the package? Note that the resultant package of using rpmrebuild should *never* be publicly redistributed the way "original" packages are, simply because it isn't.
Helo thx again for replying me in such a quick way.

I want to unpack and repack my rpm because i dont want to waste my time for testing on already binariies.
I want to save my test cycle on already tested binaries.
I again want to test only those binaries which are modified.

So i unpack rpm and replace only needed binaries and finalyy with already installed binaries and replace binaries i want to use that installed rpm.

Regards,
Amit
 
Old 08-04-2008, 08:28 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK, cool, but just don't publicly distribute your "repack" OK? When you're done testing, and if you need to distribute things, then doing a proper build will save you a lot of trouble later.
 
  


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
Is it possible to unpack rpm change file then repack? ghow961 Linux - Newbie 2 03-23-2004 02:22 PM
RPM 'failed dependencies': Why can I not install any rpm packages? leontini Linux - Newbie 7 09-16-2003 12:44 AM
error: cannot get exclusive lock on /var/lib/rpm/Packages error: cannot open Packages inward_eye Linux - Software 3 08-24-2003 03:07 PM
RPM Packages BoldKiller Linux - Newbie 1 12-11-2002 02:47 PM
creating packages (.tgz/.deb/.rpm) How from the source packages? l_9_l Linux - General 1 03-06-2002 06:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:46 PM.

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