mobile logo

Building an Empty RPM

posted on September 14, 2010 / IN 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!

By admin


Please use the form to leave a comment

    • Jeff Huckaby
      Posted on September 16, 20102:23 pm Reply

      Just curious why you need an empty RPM file?

      • Nick Wilkens
        Posted on September 16, 20103:08 pm Reply

        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.

    • Paul Fortin
      Posted on December 29, 201012:36 am Reply

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


      Paul F.

    • Rastlnka
      Posted on May 27, 20116:45 am Reply

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

    • F L
      Posted on February 2, 20126:38 pm Reply

      That worked! Thanks!

    • Tom H (@tolland)
      Posted on February 19, 201210:41 am Reply

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

    • derp
      Posted on April 6, 20136:58 pm Reply

      lol, it can be done even blanker 😛

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

Page 1 of 1

Leave a comment.