LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to build an RPM from tar.gz on CentOS 4.5? (https://www.linuxquestions.org/questions/linux-software-2/how-to-build-an-rpm-from-tar-gz-on-centos-4-5-a-625691/)

thatguyinss 03-04-2008 03:25 PM

How to build an RPM from tar.gz on CentOS 4.5?
 
Sorry for the ignorance, but Google is not helping on this one.

The system is a i386 CentOS 4.5 w/ tar 1.14 on it now.

I'm trying to install the new version of tar (1.19) and the only builds that they offer is tar.gz, no rpms.

So I cannot find any tutorials about how to build the rpm and am wondering if anyone here knows how to do it or could post some instructions or links to a guide?

Thanks

Brian1 03-04-2008 03:59 PM

You can download the the src.rpm of the tar version and install that. It will install in /usr/src/redhat and in there it will place the tar file it was using in its build. and in SPEC is the spec file it used to build. Open the spec file in there and edit the file name to the new archived name of the new tar file you wish to build. In basic you modify the spec file for tar in SPEC directory to point to the new archived tar file. Place the new tar archive file in SOURCE directory. Then build the rpm and see if it works. May need to tweak other spec options.

Install the the latest tar*.src.rpm from a Fedora mirror.
rpm -ivh tar*.src.rpm
Copy the new tar archive to /usr/src/redhat/SOURCE
Then modify the spec file in /usr/src/redhat/SPEC to reflect the name of the new tar file.
Then to build the rpm use this command.
rpmbuild -ba name_of_spec_file.spec
If it completes with no errors then the new rpm will be in /usr/src/redhat/RPMS

Or goto here and get the one from the development directory. Not sure if it will install or not because it may require newer rpm depenencies. You may download the src.rpm of that version and build it on your system using current system specs. To do so use this command to build.
rpmbuild --recompile --rebuild full_name_of_tar_src.rpm
http://download.fedora.redhat.com/pu...6/os/Packages/

Brian

hattori.hanzo 01-12-2009 08:25 PM

I just tried this with Openssh 5.0p1 and have a question.

http://download.fedora.redhat.com/pu...-1.fc9.src.rpm

It is okay to run the rpmbuild command as root? I read in some other documentation that say it is best to run as a normal user.

Could someone please elaborate what eneeds to be changed in the spec file. I did not change anything and the rpmbuild command ran successfully.

regards

billymayday 01-12-2009 08:30 PM

You have to run it as root don't you, since normal users don't have write access to /usr/src/redhat


All times are GMT -5. The time now is 07:03 AM.