How do I edit an RPM package?

How do I edit an RPM package?

The best way to modify an RPM you do not have the source for is to follow these steps:

  1. Unpack the rpm into a directory with the rpm2cpio command.
  2. Make the necessary changes inside that subdirectory.
  3. Make a “dummy” spec file and build it.

How compile SRC RPM?

  1. Install rpm-build Package. To build an rpm file based on the spec file that we just created, we need to use rpmbuild command.
  2. RPM Build Directories.
  3. Download Source Tar File.
  4. Create the SPEC File.
  5. Create the RPM File using rpmbuild.
  6. Verify the Source and Binary RPM Files.
  7. Install the RPM File to Verify.

Is there a way to rebuild the SRPM file?

Follow these instructions to set up your environment to build RPMs. The quickest way to rebuild the SRPM is to use the rpmbuild –rebuild command. This command will unpack the SRPM file into the specfile and the source files, and then it will build the RPM from the instructions on the specfile.

How to install and build SRPM in CentOS?

Install the SRPM and then Build from the Specfile. The rpmbuild -ba command will run through all the steps of the RPM building process, and at the end it will create an RPM package file (which will be saved under ~/rpmbuild/RPMS/i386, or the directory appropriate for your architecture), and also a new SRPM file…

How to unpack and repack an RPM file?

Make a “dummy” spec file and build it. That dummy spec file might look like this: Replace every “blah” in here with the real value (use rpm -qpi rpm file to get the values). Replace the BuildRoot to the directory you have the modified rpm unwrapped. Then run rpmbuild -bb dummy.spec.

Is it possible to rebuild Red Hat SRPMs?

For example, it is almost certain that you will have success in rebuilding Red Hat or CentOS packages for the same major version. You may want to look for SRPMs from other distros based on Red Hat, such as Scientific Linux, since they will tend to be compatible with the CentOS base packages.