Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Converting RPM to ebuild (at least for unmerging purposes)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Zarhan
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1020

PostPosted: Tue Jun 01, 2004 5:02 pm    Post subject: Converting RPM to ebuild (at least for unmerging purposes) Reply with quote

I stumbled upon (closed source, commercial) software that is only distributed as .RPM's. Now, this is a testing/research software that will probably not get too much widespread use so there is little point in trying to construct a real ebuild and submit it to the portage tree (especially since it is not distributed over network).

However, I would like to see how it would be best to integrate it to the Gentoo package management so that I can remove it later if necessary.

I can of course install the rpm (emerge rpm) and then just keep on doing rpm -vi (--nodeps), but I hate the idea of two separate package management systems existing concurrently.

I can use rpm2targz to convert these rpms to tar.gz:s, and when I untar the new tarball I get an entire tree - ie. the tarball contains /usr/lib, /usr/bin, /usr/share/doc/package/ etc, and some files in all of these.

Basically, I could "install" this software simply by untarring the tarballs into the root directory. However, I want to keep track of those files for uninstalling/upgrading later.

How can I create an entry in portage database for the software if I have all the files that need to be installed in appropriate tree? Basically it seems that I'm one step away from "merging"-phase when emerging a normal ebuild.

Has somebody already built a script I can use? Remember, I would like a *simple* solution, preferably something that only needs a package name I want to use for the software (and a version number, so I might use this for upgrades, too).

If there is a genering "rpm-based" template-ebuild that I could just drop into /usr/local/portage, I could probably use that. This ebuild would only have to convert the rpm to tarball, exctract the tarball and then merge (copy) files to the actual system.

Thanks for all the tips.
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Tue Jun 01, 2004 5:10 pm    Post subject: Reply with quote

Make an ebuild which simply takes the rpm, runs rpm2targz on it, extracts the tgz file into its image dir, then installs it. Overly simplified template for you:

Code:

[fill in KEYWORDS, LICENSE, HOMEPAGE, IUSE, DEPEND, RDEPEND, SRC_URI, SLOT, DESCRIPTION here. I've probably forgotten something]

src_unpack() {
    [ extract the contents of the rpm file into ${S}. ]
}

src_compile() {
}

src_install() {
    cp -a ${S}/* ${D}
    [ Any misc setup here ]
}


See the Ebuild HOWTO for more info on writing ebuilds.
Back to top
View user's profile Send private message
vonhelmet
l33t
l33t


Joined: 06 Apr 2004
Posts: 770
Location: Somewhere in a school

PostPosted: Tue Jun 01, 2004 5:32 pm    Post subject: Reply with quote

As for the removing bit... You could use rpm2tgz or whatever it's called to convert to a tar, then use tar -tf to list all the files in the tarball, then delete them one by one. Beware though, that I imagine the tarball could potentially contain files that are needed by multiple packages, so deleting files based solely on what is in the rpm could damage other installed programs.
_________________
My blog
nvtuner software - enhance your AGP Geforce 6800 or 6200!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum