Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Applying patches to Asterisk in distro SNG7

Do You Really Need to Rebuild?

...

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!

Code Block
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

Code Block
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 

Code Block
<NOW ADD YOUR PATCHES>

Then run make

Code Block
make

Once finshed the output will look similar to this

Code Block
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

Code Block
[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.

...