Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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

make

Once finshed the output will look similar to this

INFO: Done(/usr/src/asterisk-srpm/results/asterisk15-15.5.0-3.sng7.src.rpm) Config(sng-7-x86_64) 15 minutes 6 seconds
INFO: Results and/or logs in: /usr/src/asterisk-srpm/results/
Finish: run

Your RPMs will then be under the results folder

[root@Andrews15 asterisk-srpm]# ls results
asterisk15-15.5.0-3.sng7.src.rpm                      asterisk15-alsa-15.5.0-3.sng7.x86_64.rpm       asterisk15-doc-15.5.0-3.sng7.x86_64.rpm       asterisk15-sqlite3-15.5.0-3.sng7.x86_64.rpm                installed_pkgs.log
asterisk15-15.5.0-3.sng7.x86_64.rpm                   asterisk15-configs-15.5.0-3.sng7.x86_64.rpm    asterisk15-odbc-15.5.0-3.sng7.x86_64.rpm      asterisk15-tds-15.5.0-3.sng7.x86_64.rpm                    root.log
asterisk15-addons-15.5.0-3.sng7.x86_64.rpm            asterisk15-core-15.5.0-3.sng7.x86_64.rpm       asterisk15-ogg-15.5.0-3.sng7.x86_64.rpm       asterisk15-voicemail-15.5.0-3.sng7.x86_64.rpm              state.log
asterisk15-addons-bluetooth-15.5.0-3.sng7.x86_64.rpm  asterisk15-curl-15.5.0-3.sng7.x86_64.rpm       asterisk15-pgsql-15.5.0-3.sng7.x86_64.rpm     asterisk15-voicemail-imapstorage-15.5.0-3.sng7.x86_64.rpm
asterisk15-addons-core-15.5.0-3.sng7.x86_64.rpm       asterisk15-dahdi-15.5.0-3.sng7.x86_64.rpm      asterisk15-resample-15.5.0-3.sng7.x86_64.rpm  asterisk15-voicemail-odbcstorage-15.5.0-3.sng7.x86_64.rpm
asterisk15-addons-mysql-15.5.0-3.sng7.x86_64.rpm      asterisk15-debuginfo-15.5.0-3.sng7.x86_64.rpm  asterisk15-snmp-15.5.0-3.sng7.x86_64.rpm      build.log
asterisk15-addons-ooh323-15.5.0-3.sng7.x86_64.rpm     asterisk15-devel-15.5.0-3.sng7.x86_64.rpm      asterisk15-speex-15.5.0-3.sng7.x86_64.rpm     hw_info.log

You can then use rpm -i to install them.

More Information

https://wiki.centos.org/HowTos/RebuildSRPM

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

  • No labels