Can you get a Source RPM to build as a DEB?

5,963

Solution 1

Yes, you can. Sort of. Unpack the rpm with rpm2cpio and cpio, unpack the sources, create a debian/ dir inside and use the contents of the .spec file to create debian/control, debian/changelog, debian/rules, debian/copyright. Some packaging knowledge is definitely required for that last step though.

Then again, if all you want is the sourcefilter, maco's advise will get you there much quicker :)

Solution 2

Fundamentally no - because of the way RPM and DEB packages go about managing packages building a DEB straight from src.rpm isn't likely.

You can still build RPMs with Ubuntu using the rpm pacakge (sudo apt-get install rpm) Once that's intalled you can run rpmbuild on the rpm src as you would on a RH system. Then continue with your conversion to DEB via Alien or however else you would.

Solution 3

Extract the contents of the RPM with cpio then you can grab the CUPS filter out of it and paste it wherever in the filesystem it goes.

Solution 4

No you can't. But if you have the source RPM, that means you have the source code, so you can package it as a DEB anyway, which is good news!

The simplest way to make a quick DEB package is to use checkinstall.

Share:
5,963

Related videos on Youtube

Sense Hofstede
Author by

Sense Hofstede

Updated on September 17, 2022

Comments

  • Sense Hofstede
    Sense Hofstede over 1 year

    The manufacturer of our printer (Canon) does provide Linux printer drivers for most its printers. However, they are all 32bit and only the newer printer drivers are available in both DEB and RPM. The older are only provided as RPM files.

    I use 'alien' to convert the RPM files to the DEB format so I can install the drivers. However, lately it seemed Canon has screwed the new drivers for the Canon PIXMA iP3300 up a bit in the build process of the RPMs.

    Although all printer-specific RPM packages are available, the cnijfilter-common package, containing the vital CUPS filter, is distributed as a Source RPM (*.src.rpm). Very useful to build your own drivers if you want to ('rpmbuild --rebuild cnijfilter-common-2.70-2.src.rpm'), but not so much when you run a Debian-based operating system.

    My question is: is it easy to convert a Source RPM to something you can easily build as a DEB, or will I have to manually convert the Source RPM to something usable?

    • JanC
      JanC over 13 years
      You should contact Canon and ask they cooperate with OpenPrinting.org to provide open source drivers...
  • Sense Hofstede
    Sense Hofstede over 13 years
    Thank you for this answer, it works indeed the best.However, I'm not sure how this will work out on an am64 system since the package and source include some pre-compiled 32bit-only libraries, which they depend on.
  • Sense Hofstede
    Sense Hofstede over 13 years
    I've tried that, but you need a separate interface/protocol for Canon printers, or at least the official drivers. It didn't work for me without installing the filter.
  • Sense Hofstede
    Sense Hofstede over 13 years
    But this doesn't convert source RPMs to Debs or even source Debs. I am indeed using Alien for compiled RPM packages, but it has no use for source RPMs.