PDA

View Full Version : Converting rpm file to source code?



lesliek
28th April 2006, 07:51 AM
On the Lexmark site is a compressed file containing a printer driver. The file is said by Lexmark to be for RedHat Linux 9.0.

People running Debian-based distributions have reported success at extracting two rpm files from the original file, converting those files to deb files and then installing them, giving them the printer driver.

I'm trying to help someone who's using Damn Small Linux on an old laptop. I've been able to download the original file to his machine and extract from it the two rpm files, but I've not been able to use successfully the program on his machine which is said to convert rpm files to deb files.

Trying to think of a way around the problem, the following questions occurred to me.

Can I download the compressed file to my Fedora computer, extract the two rpms from it and then "unpackage" them back into source code, with a view to compiling them afterwards on his machine? If so, how would I go about unpackaging them? Is there a Fedora program available for the purpose?

giulix
28th April 2006, 08:02 AM
You mean unpackaging the .rpm ? Fire up Nautilus, right click on it and select "Open with Archive Manager" instead of "Open with Install Software".

lesliek
28th April 2006, 08:34 AM
Pardon me while I display my truly abysmal ignorance.

Using "Open with archive manager" got me copies of the individual files that were in each rpm. (As it happens, I'd already created a list of those by running "rpm -qpl" on each rpm, so I knew in advance what would be produced, though not that I could produce them by using "Open with archive manager".)

I can't just copy those files now to the appropriate directories on the machine running DSL and expect them to work, can I?

markkuk
28th April 2006, 08:37 AM
Can I download the compressed file to my Fedora computer, extract the two rpms from it and then "unpackage" them back into source code, with a view to compiling them afterwards on his machine?
No.
Normal RPM files contain pre-compiled binary programs, not source code. You need the Source RPM (.src.rpm) package for the sources.

lesliek
28th April 2006, 08:56 AM
But unfortunately, all I have is the two rpm files. Lexmark hasn't made available any src.rpm files. I know that, of the 28 files I've now extracted from the two rpm files, one of them is a compressed version of the relevant .ppd file, which is just a plain text file, but, as to the others, I wouldn't have any idea.

Is it the case that, without the src.rpm files, there's no way at all for me to go back and unscramble the eggs?

ccrvic
28th April 2006, 09:48 AM
Is it the case that, without the src.rpm files, there's no way at all for me to go back and unscramble the eggs?

There might be - but you will need some luck :-)

DSL is Debian-based. You could try using alien to convert the .rpm to .deb, and then install that.

Whether it will work or not is anyone's guess, though...

Vic.

lesliek
28th April 2006, 09:56 AM
DSL has its own special version of alien, I discovered. When I tried to use that to convert the two rpms to debs, it didn't work. I then tried it again, redirecting standard output and standard error to files (I'm not sure I've got the terminology right). When I looked at the files, they contained much repetitive information about the usage of various commands, none of which enlightened me at all about why it didn't work.

It's that failure which got me thinking about some other way to achieve the same outcome.

Jman
28th April 2006, 11:12 PM
You can install the package and use the files it contains, then write a Debian package which repackages these.

jpackage.org does something like this to enable people to fix Sun's Java rpms.

Supposedly this won't work if the Fedora packaged has been compiled and linked against all Fedora stuff, but the success of others in encouraging.

lesliek
29th April 2006, 08:01 AM
Thanks for your reply, Jman.

When you began it with "you", I know you were using it in the sense of "a person" but, unfortunately, I'm not one of those persons. I know such a thing would simply be far beyond me.

Thanks again,

Leslie

ilja
29th April 2006, 08:13 AM
http://www.redhat.com/archives/rpm-list/2001-November/msg00020.html

lesliek
2nd May 2006, 07:24 AM
Thank you very much for that reference, Ilja.