Applying patches to Asterisk in distro SNG7

Do You Really Need to Rebuild?

This is for advanced users only. You can cause system instability by going through this process if you don't know what you are doing.

First consider the burden that rebuilding a SRPM will be for you. You will have to maintain it and rebuild it every time that security updates are available. Before deciding to rebuild a SRPM, you should probably look for the desired package in one of the available Repositories to see if they already contain the package you seek.

Most people using repositories expect support (mailing list, fora, bug tracker, IRC channel), and an archive which issues security and feature updates on the packages it provides. Most of the sources listed in the 'Repositories' wiki page have such resources and features, but some do not. For instance, the CentOS 'testing' archive is one that does NOT seek to expressly provide an update path. Only packages signed with the relevant CentOS GPG key are products of the CentOS project.

Rebuild the SRPM

This is for advanced users only. You can cause system instability by going through this process if you don't know what you are doing.

A nice benefit of the SNG7 distro is that all of the source code for all RPMs is available through source RPMs. Better known as SRPMS. Patching Asterisk with your favorite third-party patch has never been easier!

yum install mock sangoma-rpm-helper sangoma-devel cd /usr/src mkdir asterisk-srpm cd asterisk-srpm yumdownloader --source asterisk15-15.5.0 rpm -qlp asterisk15-15.5.0-3.sng7.src.rpm rpm -U asterisk15-15.5.0-3.sng7.src.rpm cp ~/rpmbuild/SPECS/asterisk15.spec asterisk15.spec cp -R ~/rpmbuild/SOURCES/* . rm -Rf ~/rpmbuild #reset rpmbuild for future builds

Upload the following Makefile to the directory

wget https://wiki.freepbx.org/download/attachments/116719647/Makefile?version=1&modificationDate=1547504427375&api=v2 -O Makefile

Add Patches, either in the SPEC file or in the Asterisk tarball 

<NOW ADD YOUR PATCHES>

Then run make

Once finshed the output will look similar to this

Your RPMs will then be under the results folder

You can then use rpm -i to install them.

More Information

HowTos/RebuildSRPM

http://www.owlriver.com/tips/patching_srpms/

Unable to render {include} The included page could not be found.