RPM Rebuild on Linux Red Hat Enterprise

A quick howto on RPM rebuilding from source:

yum groupinstall "Development Tools"
yum install rpmdevtools
# unpack old tar.gz
tar zxvf my-package-0.0.0.tar.gz
mv my-package-0.0.0.tar.gz orig.my-package-0.0.0.tar.gz

[change interested files]

# create a new tar.gz file, preserving privileges

tar -pzcvf my-package-0.0.0.tar.gz my-package-0.0.0/

Create RPM from tar.gz

rpmbuild -tb my-package-0.0.0.tar.gz

The “-p” stays for “preserve privileges”

You got something like:

Wrote: /usr/src/redhat/RPMS/i386/my-package-0.0.0.i386.rpm
cd ~
cp /usr/src/redhat/RPMS/i386/my-package-0.0.0.i386.rpm ./
rpm -i my-package-0.0.0.i386.rpm

See also:


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s