I am new to Centos and yum
in general.
- How do I retreive the SRPM using
yumdownloader --source
? When I run the command it says the SRPMs are not found. How do I add the repository? I am talking about official CentOS packages here. - Once downloaded, what is the command to unpack the SRPM so I can edit the files?
- Last, once I am done modifying, what is the command to rebuild the modified source RPM?
- From a SRPM, how does one create a RPM?
This is an issue with CentOS: http://bugs.centos.org/view.php?id=1646
Assuming you're CentOS 5, create this file in /etc/yum.repos.d/CentOS-SRPMS.repo
rpm -ivh your.src.rpm
This assumes you have necessary directories, if you don't run
mkdir -p /usr/src/redhat/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
to create them.The file you'll usually want to edit is the spec file in /usr/src/redhat/SPECS/packagename.spec.
rpmbuild -bb /usr/src/redhat/SPECS/your.spec
to just build the RPMrpmbuild -ba /usr/src/redhat/SPECS/your.spec
to just build the RPM and an SRPMrpmbuild --rebuild your.src.rpm
If you need to build RPMs you should look in to using mock.
yumdownloader --source kernel
rpm -i kernel-arch.src.rpm
UPDATE: This is also relevant:
http://wiki.centos.org/HowTos/I_need_the_Kernel_Source