#9 Fix build issues on epel 7
Opened 4 years ago by spike. Modified 4 years ago
Unknown source master  into  rawhide

file modified
+10 -2
@@ -25,7 +25,7 @@

  %endif

  

  %global           apidoc     0

- %global           mysql      1

I don't think we want to universally remove mysql support. Instead, let's find a way to conditionalize for EPEL 7.

+ %global           mysql      0

  %global           odbc       1

  %global           postgresql 1

  %global           radius     1
@@ -763,11 +763,15 @@

  popd

  

  

- %if 0%{?fedora} > 0 || 0%{?rhel} >= 7

+ %if 0%{?fedora} > 0

  %configure --with-imap=system --with-gsm=/usr --with-ilbc=/usr --with-libedit=yes --with-srtp --with-pjproject=/usr --without-pjproject-bundled LDFLAGS="%{ldflags}"

  %else

+ %if 0%{?rhel} >= 7

+ %configure --with-imap=system --with-gsm=/usr --with-ilbc=/usr --with-libedit=yes --with-srtp --with-pjproject=/usr --with-pjproject-bundled --with-jansson-bundled LDFLAGS="%{ldflags}"

Moving to a bundled version of pjproject is going to be much more work than what you've done here. Steps would include:
1) Making sure it's OK to bundle in EPEL
2) Removing the "--with-pjproject=/usr" flag here -- I think we might need to point it at the pjproject source, but I'd have to check the details
3) Adding the "bundled" pjproject sources to the sources in this spec file. The Asterisk makefiles download the pjproject sources, but of course the build environments in Fedora don't have internet access, so we'll need to put the sources in the spec file and then point the configure script at the sources.

+ %else

  %configure  --with-gsm=/usr --with-ilbc=/usr --with-libedit=yes --with-gmime=no --with-srtp --with-pjproject=/usr --without-pjproject-bundled LDFLAGS="%{ldflags}"

  %endif

+ %endif

  

  make %{?_smp_mflags} menuselect-tree NOISY_BUILD=1

  %{__perl} -n -i -e 'print unless /openr2/i' menuselect-tree
@@ -1592,6 +1596,10 @@

  #%%{_libdir}/asterisk/modules/res_pjsip_transport_management.so

  %{_libdir}/asterisk/modules/res_pjsip_transport_websocket.so

  %{_libdir}/asterisk/modules/res_pjsip_xpidf_body_generator.so

+ %if 0%{?rhel} >= 7

+ %{_libdir}/libasteriskpj.so

+ %{_libdir}/libasteriskpj.so.2

+ %endif

  

  %files portaudio

  %attr(0640,asterisk,asterisk) %config(noreplace) %{_sysconfdir}/asterisk/console.conf

This is merely a suggestion and might not be the right way to go ahead but it builds in epel 7 if

  • freeradius-client
  • libss7
  • libresample
  • libpri
  • libpq
  • asterisk-sounds-core
  • dahdi-tools

are available. Those build just fine from the latest spec files in their corresponding master branch.

I'm not sure if %{_libdir} is the right place for libasteriskpj.so and libasteriskpj.so.2, but that's where asterisk puts them.

I've also disabled mysql since the mariadb-connector-c is missing in epel and not building atm (fails with error reported here: https://jira.mariadb.org/browse/CONC-361, build log: https://copr-be.cloud.fedoraproject.org/results/spike/asterisk/epel-7-x86_64/00823239-mariadb-connector-c/builder-live.log)

I don't think we want to universally remove mysql support. Instead, let's find a way to conditionalize for EPEL 7.

Moving to a bundled version of pjproject is going to be much more work than what you've done here. Steps would include:
1) Making sure it's OK to bundle in EPEL
2) Removing the "--with-pjproject=/usr" flag here -- I think we might need to point it at the pjproject source, but I'd have to check the details
3) Adding the "bundled" pjproject sources to the sources in this spec file. The Asterisk makefiles download the pjproject sources, but of course the build environments in Fedora don't have internet access, so we'll need to put the sources in the spec file and then point the configure script at the sources.

Just for the record so I don't forget: Asterisk 16 needs

  • jansson 2.11 (version 2.10 which is included in epel7 doesn't have json_sprintf())
  • and a more recent version of pjproject. configure seems ok with the version in epel7 but the build fails with
    res_pjsip_session.c:4070:10: error: 'pjsip_inv_session' has no member named 'following_fork'

The prproject version pulled when the --with-pjproject-bundled flag is present is 2.7.2 from https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/2.7.2/pjproject-2.7.2.tar.bz2