14 Sep 2010

Building an Empty RPM 

By - Quick Tip 7 Comments

When searching for information on creating an empty, or null rpm file, I was unable to locate the spec file details needed. In another post, I will describe my need for this empty rpm, but for now here is the minimal spec file needed to build an empty rpm:

Place the following in a file called, php.spec

Summary: Empty PHP
Name: php
Version: 0
Release: 0
License: Public
Group: Applications/System

Now, build your new php rpm using the following command:

# rpmbuild -bb php.spec
Processing files: php-0-0
Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot}
Wrote: /usr/src/redhat/RPMS/i386/php-0-0.i386.rpm

And that’s it, you now have an empty rpm!

7 Responses to “Building an Empty RPM”

  1. Jeff Huckaby says:

    Just curious why you need an empty RPM file?

  2. Nick Wilkens says:

    This was in response to an issue with Plesk requiring the ‘php’ rpm package for the “Run as Apache module” setting.

    One system we encountered was upgraded to php52 using the IUS repository. Since the IUS repo uses ‘php52′ as the base rpm package name (for php 5.2), not having a package named ‘php’ appeared to have caused the web hosting settings of PHP support: “Run as Apache module”, to be disabled/unavailable.

    Adding in an empty ‘php’ rpm re-enabled the “Run as Apache module” option quickly while we determined a better long term solution.

  3. Paul Fortin says:

    I will be needing this in the future so I saved this lnk!!


    Paul F.

  4. Rastlnka says:

    Thanks, it helped me to create empty package with dependencies :)

  5. F L says:

    That worked! Thanks!

  6. Tom H (@tolland) says:

    haha, thanks. worked a treat to fool yum into installing cacti with the altertnative php53 packages.

  7. derp says:

    lol, it can be done even blanker :P

    Name: blank
    Version: 0
    Release: 0
    Summary: blank
    License: blank

Leave a Reply