Monday, October 4, 2010

SBR600: RPM Packages I

In my previous SBR600 entry, I compiled nled from the source tarball. Today, I'm going to try building it in more advanced way using source rpm and try repackaging it in my own machine using RPM Development Tools. For those who are not familiar with rpm (like myself), here is the link to wikipedia (http://en.wikipedia.org/wiki/RPM_Package_Manager).

Before I begin, there are some tools that I need to have in order to create a packaging environment.
To install these, use the following commands in terminal.

su-
input root password
yum install rpm-build


When finished, install rpmdevtools by using same yum command.

yum install rpmdevtools


And do the same for rpmlint.

yum install rpmlint


And lastly, run the following command to automatically build the directories in your home directory.

rpmdev-setuptree


If the above command ran successfully, it should have created following directories in your home directory.



Next step is to download a source rpm package. I'm going to try using NLED again. And I'm going to try yumdownloader command to download source rpm file automatically.

yumdownloader --source nled


So now I have nled-2.52-6.fc12.src.rpm file downloaded in my home directory. To install this file, use the following command.

rpm -i ~/nled-2.52-6.fc12.src.rpm


~/rpmbuild/SOURCES directory hold the installed source tarballs. ~/rpmbuild/SPECS directory hold the installed spec files. A spec file for a package is used to hold specific procedures and information about how a package should be built with the source code. I will take a look at understanding/editing/creating spec files in my later blog post. For now, to rebuild from the spec file,

cd ~/rpmbuild/SPECS/
rpmbuild -ba nled.spec


No comments:

Post a Comment