From Gentoo Wiki
Jump to:navigation Jump to:search

RPMs - faking them

Handy for persuading an installer that something is actually installed. The following recipe creates an RPM that does nothing but fake an RPM installation. Usually you can get away with something like this to install an RPM:

root #rpm -Uvh --nodeps <example.rpm>

but if an application has an installer that calls RPM directly to see whether something is installed, this might get you over that hurdle. Make sure the corresponding ebuild is installed from Portage!

  • Create a .spec file in /usr/src/rpm/SPECS/. Then "build" the rpm
root #rpmbuild -ba <specfile>
  • Watch the output from the above to see where the .rpm is created and then install it
root #rpm -Uvh <rpm>

Sample .spec file

Create a .spec file using the following example for gettext as a template. Set the name and version strings accordingly.

FILE /usr/src/rpm/SPECS/gettext- example of a .spec file
Name: gettext
Release: r1
Summary: Use to generate virtual package to fake gettext.
Group: Development/Tools
License: GPL2
BuildArch: noarch

Create virtual package specifying gettext as a virtual package.