insert a file into a binary rpm - how?

This is a discussion on insert a file into a binary rpm - how? within the Linux General forums, part of the Linux Forums category; Hi, Group, I am asking this question because I would like to insert several pre-prepared files into a binary ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-30-2006
Kill Bill
 
Posts: n/a
Default insert a file into a binary rpm - how?

Hi, Group,

I am asking this question because I would like to insert several
pre-prepared files into a binary rpm, and I know this is possible for
the debian packages (since .deb can be manipulated with standard unix
facilities such as ar, tar, gzip). Also I know how to extract a
specified file within a rpm using rpm2pico and pico. Just the other way
around I don't know.

Of course I know how to do it if I have the source rpm or the raw
source, but unfortunately I don't.

I can also manually put files there but it would be nice that they were
covered by the rpm package manager, thereby it would be easier to
install/uninstall or port to other machines.

Ideally could someone tell/hint/suggest me how I append the added files
into the rpm?

If this isn't even possible, can someone at least tell me how I can edit
the rpm database (in Berkeley DB format?) so that (1) the new manually
added file would appear belonging to the rpm and (2) a "rpm -e" will
erase the files as well?

Many thanks,

KB
--
Let's play my favorite game at http://www.xbill.org/
Reply With Quote
  #2 (permalink)  
Old 06-30-2006
Kill Bill
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill wrote:
> Hi, Group,
>
> I am asking this question because I would like to insert several
> pre-prepared files into a binary rpm, and I know this is possible for
> the debian packages (since .deb can be manipulated with standard unix
> facilities such as ar, tar, gzip). Also I know how to extract a
> specified file within a rpm using rpm2pico and pico. Just the other way
> around I don't know.


And I am thinking a possible work around for this issue:
1) use alien to convert the original rpm into a deb;
2) use ar, tar, gzip to decompose the deb;
3) add prepared files in;
4) use md5sum, tar, gzip ar, etc to re-assemble a new deb;
5) use alien again, to convert the deb to a new version of rpm.

The potential danger of this work around is the compatibility issue. I
haven't try it but it is likely the final rpm doesn't work on the
original platform.

Does anyone have any suggestion?

Thanks,

KB
--
Let's play my favorite game at http://www.xbill.org/
Reply With Quote
  #3 (permalink)  
Old 06-30-2006
Kill Bill
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill wrote:
> Hi, Group,
>
> I am asking this question because I would like to insert several
> pre-prepared files into a binary rpm, and I know this is possible for
> the debian packages (since .deb can be manipulated with standard unix
> facilities such as ar, tar, gzip). Also I know how to extract a
> specified file within a rpm using rpm2pico and pico. Just the other way
> around I don't know.


And I am thinking a possible work around for this issue:
1) use alien to convert the original rpm into a deb;
2) use ar, tar, gzip to decompose the deb;
3) add prepared files in;
4) use md5sum, tar, gzip ar, etc to re-assemble a new deb;
5) use alien again, to convert the deb to a new version of rpm.

The potential danger of this work around is the compatibility issue. I
haven't tried it but it is likely the final rpm doesn't work on the
original platform.

Does anyone have any suggestion?

Thanks,

KB
--
Let's play my favorite game at http://www.xbill.org/
Reply With Quote
  #4 (permalink)  
Old 06-30-2006
Sam
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill writes:

> Ideally could someone tell/hint/suggest me how I append the added files
> into the rpm?
>
> If this isn't even possible, can someone at least tell me how I can edit
> the rpm database (in Berkeley DB format?) so that (1) the new manually
> added file would appear belonging to the rpm and (2) a "rpm -e" will
> erase the files as well?


The easiest thing for you to do is to simply create a separate rpm package,
that installs the files you want, rather than screwing around with the
binary rpm database, and end up hosing your entire system.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBEpQPlx9p3GYHlUOIRAtLVAJ48akCBYKpUU1eYW9RbeT YBPpMLOQCfdyca
/gWokSuYFHfyo4jig3FLxm8=
=mvzy
-----END PGP SIGNATURE-----

Reply With Quote
  #5 (permalink)  
Old 06-30-2006
Sam
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill writes:

> Kill Bill wrote:
>> Hi, Group,
>>
>> I am asking this question because I would like to insert several
>> pre-prepared files into a binary rpm, and I know this is possible for
>> the debian packages (since .deb can be manipulated with standard unix
>> facilities such as ar, tar, gzip). Also I know how to extract a
>> specified file within a rpm using rpm2pico and pico. Just the other way
>> around I don't know.

>
> And I am thinking a possible work around for this issue:
> 1) use alien to convert the original rpm into a deb;
> 2) use ar, tar, gzip to decompose the deb;
> 3) add prepared files in;
> 4) use md5sum, tar, gzip ar, etc to re-assemble a new deb;
> 5) use alien again, to convert the deb to a new version of rpm.
>
> The potential danger of this work around is the compatibility issue. I
> haven't try it but it is likely the final rpm doesn't work on the
> original platform.
>
> Does anyone have any suggestion?


It won't work.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBEpQP0x9p3GYHlUOIRAgVAAJ9Q5Hjy8mTnF3JDfpv8GK tQsLATJQCcDuK1
xwZFvSps1/6dF43RTNsGuuQ=
=WL7s
-----END PGP SIGNATURE-----

Reply With Quote
  #6 (permalink)  
Old 06-30-2006
Kill Bill
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Sam wrote:
>> And I am thinking a possible work around for this issue:
>> 1) use alien to convert the original rpm into a deb;
>> 2) use ar, tar, gzip to decompose the deb;
>> 3) add prepared files in;
>> 4) use md5sum, tar, gzip ar, etc to re-assemble a new deb;
>> 5) use alien again, to convert the deb to a new version of rpm.
>>
>> The potential danger of this work around is the compatibility issue. I
>> haven't try it but it is likely the final rpm doesn't work on the
>> original platform.
>>
>> Does anyone have any suggestion?

>
> It won't work.


Thanks for your reply, Sam. I understand there will be many software
version issues involved, such as rpm version, Berkeley db version, alien
version, or even gcc, glibc, etc. And any of these difference may caused
problem - but why are you so sure it will NOT work? Would you like to
elaborate?

KB
--
Let's play my favorite game at http://www.xbill.org/
Reply With Quote
  #7 (permalink)  
Old 06-30-2006
Kill Bill
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Sam wrote:
>> If this isn't even possible, can someone at least tell me how I can
>> edit the rpm database (in Berkeley DB format?) so that (1) the new
>> manually added file would appear belonging to the rpm and (2) a "rpm
>> -e" will erase the files as well?

>
> The easiest thing for you to do is to simply create a separate rpm
> package, that installs the files you want, rather than screwing around
> with the binary rpm database, and end up hosing your entire system.
>

Of course I'll play safe, I can always do backup and restore, can't I.
The rpm database itself can also be rebuilt. To the worst, I can restore
the whole system from backup, can't I. Your wording sounds a bit
fear-spreading. :)

Had I have the source (be it the source rpm or the raw source), I knew
how to create binary rpm and do upgrade. But the situation is that I
don't get hold of the source - and still I want my added files managed
by the rpm package system. This actually is what I did when I patched
skype for my debian box (rpm downloaded from skype website, converted to
deb with alien, and need to be patched to work, so I patched it and
created a new deb). Am I expecting too much from rpm format?

KB
--
Let's play my favorite game at http://www.xbill.org/
Reply With Quote
  #8 (permalink)  
Old 06-30-2006
Sam
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill writes:

> Sam wrote:
>>> If this isn't even possible, can someone at least tell me how I can
>>> edit the rpm database (in Berkeley DB format?) so that (1) the new
>>> manually added file would appear belonging to the rpm and (2) a "rpm
>>> -e" will erase the files as well?

>>
>> The easiest thing for you to do is to simply create a separate rpm
>> package, that installs the files you want, rather than screwing around
>> with the binary rpm database, and end up hosing your entire system.
>>

> Of course I'll play safe, I can always do backup and restore, can't I.
> The rpm database itself can also be rebuilt. To the worst, I can restore
> the whole system from backup, can't I.


Certainly. But it seems to me that just installing an additional package is
much simpler.

Why do you insist on making your own life so difficult?

> Had I have the source (be it the source rpm or the raw source), I knew
> how to create binary rpm and do upgrade. But the situation is that I
> don't get hold of the source - and still I want my added files managed
> by the rpm package system.


Too bad, so sad. RPM is designed to package free software. In most cases
you can still use RPM to install non-free software, as long as you have the
software's original distribution archive. For example, there are various
Flash rpms floating around. They are created by taking Macromedia's
distribution binary blob, fake-extracting the component files, and wrapping
them up into an rpm.

> created a new deb). Am I expecting too much from rpm format?


Yes. rpm is designed to package free software, whose source code is
available.















-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBEpaigx9p3GYHlUOIRAg7+AJ9D0hFl53bTC3yTBP1u/9denEjw4QCfZpVq
Dqn0n8a11iDl+Elr37/KIig=
=53tI
-----END PGP SIGNATURE-----

Reply With Quote
  #9 (permalink)  
Old 06-30-2006
Sam
 
Posts: n/a
Default Re: insert a file into a binary rpm - how?

Kill Bill writes:

> Sam wrote:
>>> And I am thinking a possible work around for this issue:
>>> 1) use alien to convert the original rpm into a deb;
>>> 2) use ar, tar, gzip to decompose the deb;
>>> 3) add prepared files in;
>>> 4) use md5sum, tar, gzip ar, etc to re-assemble a new deb;
>>> 5) use alien again, to convert the deb to a new version of rpm.
>>>
>>> The potential danger of this work around is the compatibility issue. I
>>> haven't try it but it is likely the final rpm doesn't work on the
>>> original platform.
>>>
>>> Does anyone have any suggestion?

>>
>> It won't work.

>
> Thanks for your reply, Sam. I understand there will be many software
> version issues involved, such as rpm version, Berkeley db version, alien
> version, or even gcc, glibc, etc. And any of these difference may caused
> problem - but why are you so sure it will NOT work? Would you like to
> elaborate?


Because an rpm is not just a fancy tarball that contains a bunch of files.
An rpm also contains metadata of the package's inter-dependencies with other
software, so that rpm can verify that the software's packages are installed,
and inform you if some requisite package is missing, that you must install
first, before installing this software packages. Additionally, if some
other software package gets later installed, which requires this software
package, and you attempt to remove it, rpm won't let you remove a package
that's needed by some other package.

The conversion process will end up discarding bits of the metadata that have
no equivalent in deb format. If there's still anything left, they may also
get dropped when you convert deb to rpm, for the same reasons.

You will end up with something that looks like an rpm, but is just a
glorified tarball. Very little of what rpm does actually has to do with
installing and uninstalling the individual files.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD4DBQBEpamqx9p3GYHlUOIRAmydAJdZwRnK5LcEf58CQU0QhI dB8KJnAJ4/K6Z0
4kqYwxqwSozh+O5mV+i+vw==
=WMbj
-----END PGP SIGNATURE-----

Reply With Quote
Reply
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:58 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0