Blob Blame History Raw
%global posttag git217740d

Name:  pjproject
Summary:  Libraries for building embedded/non-embedded VoIP applications
Version: 2.3
Release: 3%{?dist}
Group: System Environment/Libraries
License: GPLv2+
URL: http://www.pjsip.org

Source0: http://www.pjsip.org/release/%{version}/%{name}-%{version}.tar.bz2

# Nothing like carrying a 500k patch just to fix the FSF address :-)
Patch0: pjproject_fix_old_FSF_address.patch
# Tell the build system not to use most of the third_party directory
Patch1: pjproject_no_third_party.patch
# If video is disabled, don't bother with libyuv
Patch2: pjproject_fix_libyuv.patch
# Keep the .pc file clean
# see https://bugzilla.redhat.com/show_bug.cgi?id=728302#c66
Patch3: pjproject_fixup_pc_file.patch


BuildRequires: alsa-lib-devel
BuildRequires: gsm-devel
BuildRequires: libsrtp-devel
BuildRequires: libuuid-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: portaudio-devel
BuildRequires: speex-devel


%description
This package provides the Open Source, comprehensive, high performance,
small footprint multimedia communication libraries written in C
language for building embedded/non-embedded VoIP applications. 
It contains:
- PJSIP - Open Source SIP Stack
- PJMEDIA - Open Source Media Stack
- PJNATH - Open Source NAT Traversal Helper Library
- PJLIB-UTIL - Auxiliary Library
- PJLIB - Ultra Portable Base Framework Library
- PJSUA2 - Object Oriented abstractions layer for PJSUA


%package devel
Summary: Development files to use pjproject
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}


%description devel
Header information for:
- PJSIP - Open Source SIP Stack
- PJMEDIA - Open Source Media Stack
- PJNATH - Open Source NAT Traversal Helper Library
- PJLIB-UTIL - Auxiliary Library
- PJLIB - Ultra Portable Base Framework Library


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

# make sure we don't bundle these third-party libraries
# (They're excluded through ./configure, but this is an 
# additional safety net)
rm -rf third_party/BaseClasses
rm -rf third_party/bdsound
rm -rf third_party/bin
rm -rf third_party/g7221
rm -rf third_party/gsm
rm -rf third_party/milenage
rm -rf third_party/mp3
rm -rf third_party/portaudio
rm -rf third_party/resample
rm -rf third_party/speex
rm -rf third_party/srtp
rm -rf third_party/ilbc
rm -rf third_party/build/baseclasses
rm -rf third_party/build/g7221
rm -rf third_party/build/gsm
rm -rf third_party/build/milenage
rm -rf third_party/build/portaudio/src
rm -rf third_party/build/resample
rm -rf third_party/build/samplerate
rm -rf third_party/build/speex
rm -rf third_party/build/srtp
rm -rf third_party/build/ilbc

%build

# We're building without audio or video support, as Asterisk isn't using
# that functionality, and it made it easier to ensure that we don't 
# bundle any unnecessary libraries.  Please contact me if your project
# needs this support, and I'll re-enable it
export CFLAGS="-DPJ_HAS_IPV6=1 %{optflags}"
%configure --enable-shared        \
           --with-external-gsm    \
           --with-external-pa     \
           --with-external-speex  \
           --with-external-srtp   \
           --disable-opencore-amr \
           --disable-resample     \
           --disable-sound        \
           --disable-video        \
           --disable-v4l2         \
           --disable-ilbc-codec   \
           --without-libyuv       \
           --disable-g7221-codec  

export CFLAGS="-DPJ_HAS_IPV6=1 %{optflags}"
make %{?_smp_mflags} dep
make %{?_smp_mflags}


%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install

# Remove the static libraries, as they aren't wanted
rm %{buildroot}%{_libdir}/*.a

# rpmlint complains that this is an empty file, so let's fix that
echo -e '\n' >> %{buildroot}%{_includedir}/pj/config_site.h

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -p /sbin/ldconfig devel

%postun -p /sbin/ldconfig devel


%files
%doc README.txt README-RTEMS INSTALL.txt
%license COPYING
%attr(755, root, root) %{_libdir}/lib*.so.*

%files devel
%attr(755, root, root) %{_libdir}/lib*.so
%{_includedir}/pj++/
%{_includedir}/pj/
%{_includedir}/pjlib-util/
%{_includedir}/pjmedia-audiodev/
%{_includedir}/pjmedia-codec/
%{_includedir}/pjmedia-videodev/
%{_includedir}/pjmedia/
%{_includedir}/pjnath/
%{_includedir}/pjsip-simple/
%{_includedir}/pjsip-ua/
%{_includedir}/pjsip/
%{_includedir}/pjsua-lib/
%{_includedir}/pjsua2/
%{_includedir}/*.h
%{_includedir}/*.hpp
%{_libdir}/pkgconfig/libpjproject.pc


%changelog
* Wed Oct 15 2014 Jared Smith <jsmith@fedoraproject.org> - 2.3-3
- Add IPv6 support

* Wed Sep 10 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.3-2
- Disable video support, and specifically tell it not to use libyuv,
  as the version of libyuv in Fedora is too old
- Disable ilbc codec support, as it is not needed

* Wed Sep 10 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.3-1
- Update to upstream 2.3 release

* Fri Jun 20 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.2.1-1
- Update to upstream 2.2.1 release

* Sun Mar 09 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.2-4
- Instead of deleting the empty file pj/config_site.h, make it non-empty

* Fri Feb 28 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.2-3
- Fix the location of the .so files
- Add a massive patch to fix the incorrect FSF address

* Fri Feb 28 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.2-2
- Rebase a patch to simple eliminate the third_party directory
- Add a patch to fix up the .pc file

* Fri Feb 28 2014 Jared Smith <jsmiht@fedoraproject.org> - 2.2-1
- Update to upstream 2.2 release

* Fri Jan 17 2014 Dale Macartney <dbmacartney@fedoraproject.org> - 2.1-0.6.git217740d
- Shorten sumary, and moved libs to -devel package

* Mon Nov 25 2013 Anthony Messina <amessina@messinet.com> - 2.1-0.5.git217740d
- Enable G.722.1 and ILBC

* Mon Nov 25 2013 Anthony Messina <amessina@messinet.com> - 2.1-0.4.git217740d
- Build without opencore-amr

* Mon Nov 18 2013 Anthony Messina <amessina@messinet.com> - 2.1-0.3.git217740d
- Updates for SIP transaction handling

* Sat Nov 16 2013 Anthony Messina <amessina@messinet.com> - 2.1-0.2.gitde17f0e
- Rebuild for updates to OpenSSL

* Mon Oct 07 2013 Anthony Messina <amessina@messinet.com> - 2.1-0.1.gitde17f0e
- Package for Fedora & Asterisk: https://wiki.asterisk.org/wiki/display/AST/Installing+pjproject

* Mon Apr 22 2013 Anthony Messina <amessina@messinet.com> - 2.1-1
- Update to 2.1 release

* Sat Feb 16 2013 Mario Santagiuliana <fedora@marionline.it> - 2.0.1-1
- New version 2.0.1

* Mon Apr 16 2012 Mario Santagiuliana <fedora@marionline.it> - 1.12-2
- fix warning mixed-use-of-spaces-and-tabs from rpmlint
- use macro name and version

* Wed Apr 11 2012 Tom Callaway <spot@fedoraproject.org> - 1.12-1
- use system copy of libsrtp

* Thu Jan 12 2012 Mario Santagiuliana <fedora@marionline.it> 1.12-0
- Update to version 1.12

* Sun Jan 08 2012 Mario Santagiuliana <fedora@marionline.it> 1.10-7
- Follow the comment of Rex Dieter:
  https://bugzilla.redhat.com/show_bug.cgi?id=728302#c17

* Sat Jan 07 2012 Mario Santagiuliana <fedora@marionline.it> 1.10-6
- Follow the comment of Rex Dieter:
  https://bugzilla.redhat.com/show_bug.cgi?id=728302#c14
  https://bugzilla.redhat.com/show_bug.cgi?id=728302#c15

* Thu Dec 29 2011 Mario Santagiuliana <fedora@marionline.it> 1.10-5
- Follow the comment of Rex Dieter:
  https://bugzilla.redhat.com/show_bug.cgi?id=728302#c11

* Mon Aug 15 2011 Mario Santagiulaina <fedora@marionline.it> 1.10-4
- Forgot to write changelog for 1.10-3.
- Version 1.10.3 add patch to resolve libdir issue.

* Mon Aug 15 2011 Mario Santagiulaina <fedora@marionline.it> 1.10-2
- Follow the comment of Thomas Spura:
  https://bugzilla.redhat.com/show_bug.cgi?id=728302#c1

* Thu Aug 04 2011 Mario Santagiulaina <fedora@marionline.it> 1.10-1
- Initial RPM release