Packaging for Fedora
My task on day 4 of POSSE SA was to package an application for Fedora, and it all went well. I tried the process all over again today as I intend packaging applications for Fedora-arm. Below are the steps I took. You can get the rpmbuild for the sample application here. Although I ran the process on my i386 PC, I learnt that packaging Fedora apps. for ARM devices on a machine with a different processor architecture comes with a lot of problems. Hence, it is advisable to package Fedora-arm apps on an ARM-based machine, such as Pandaboard, Sheevaplug and Beagleboard.
The Packaging Procedure and How to generate a Patch
sudo yum install fedora-packager
rpmdev-setuptree
ls ~/rpmbuild/
rpmbuild –clean buildsample
cd ~/rpmbuild/SPECS/
#clean up
rpmbuild –clean buildsample.spec
#prepare
rpmbuild –bp buildsample.spec
#make
rpmbuild –bc buildsample.spec
#install
rpmbuild –bi buildsample.spec
#build
rpmbuild –bb buildsample.spec
#source
rpmbuild –bs buildsample.spec
#all (package_all)
rpmbuild –ba buildsample.spec
rpmlint buildsample.spec
rpmlint ../SRPMS/buildsample-2.0-1.src.rpm
rpmls ../RPMS/x86_64/buildsample-2.0-1.x86_64.rpm
rpm2cpio ../RPMS/x86_64/buildsample-2.0-1.x86_64.rpm | cpio -idv
sudo yum install ../RPMS/x86_64/buildsample-2.0-1.x86_64.rpm –nogpgcheck
rpm -qa | grep buildsample
buildsample
sudo yum remove buildsample
#adding patches
rpmbuild -bp buildsample.spec
cd ../BUILD/buildsample-2.0/
cp buildsample.c buildsample.c.fix
gedit buildsample.c.fix #make the changes
gendiff buildsample-2.0/ .fix
gendiff buildsample-2.0/ .fix > ~/rpmbuild/SOURCES/buildsample-fix.patch
cd ../SPECS/
#edit the specs’ file - change the release no
#restart the build process