Wednesday, June 26, 2019

Adding a new patch to rpm based package


Adding a new patch to rpm based package

--

Setting up rpmbuild environment : 

mkdir ~/rpmbuild

cd ~/rpmbuild

mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS,}

cp v1.1.0.tar.gz     *.patch     /root/rpmbuild/SOURCES/

--

# Clone the package
git clone <your package name>


# first build it with current sources and patches:
rpmbuild -bb  <package name>.spec  --noclean

Note: prior to the above step, clean the *older* sources if present :
    rm -rf /root/rpmbuild/SOURCES/*

# cd to the source code
cd /home//rpmbuild/BUILD/<package name>

# initialize git
git init .

# add all
git add .

# make initial commit
git commit -s "initial"

# making your new changes
// now make changes.

git add    <new files/ patched files>

# commit the changes
git commit -s "give relevant comment here"

# create a patch
git format-patch -1

# Now copy the patch to  source location and make relevant changes in  <package name>.spec.

# Now you can build the rpm package with this new patch as well .

-----------


No comments:

Post a Comment