%global shortname srtp

Summary:	Secure RTP (SRTP) and UST Reference Implementations
Name:		libsrtp
Version:	2.3.0
Release:	1%{?_dist_release}
Group:		System Environment/Libraries
Vendor:		Project Vine
Distribution:	Vine Linux

License:	BSD
URL:		https://github.com/cisco/libsrtp
Source0:	https://github.com/cisco/libsrtp/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Fix shared lib so ldconfig doesn't complain
Patch0:		libsrtp-2.3.0-shared-fix.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%description
The libSRTP library is an open-source implementation of the Secure Real-time
Transport Protocol (SRTP) originally authored by Cisco Systems, Inc.


%package devel
Summary:        Development environment for libsrtp
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description devel
Header files and libraries for building a extension library for the
libsrtp


%prep
%setup -q
%patch0 -p1 -b .sharedfix


%build
export CFLAGS="%{optflags} -fPIC"
%configure --disable-static
%{__make} %{?_smp_mflags} shared_library


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
find %{buildroot} -name '*.la' -exec rm -f {} ';'


%clean
%{__rm} -rf %{buildroot}


%post
/sbin/ldconfig

%postun
/sbin/ldconfig


%files
%license LICENSE
%doc CHANGES README TODO VERSION doc/*.txt doc/*.pdf
%{_libdir}/*.so.*

%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/libsrtp2.pc
%{_libdir}/*.so


%changelog
* Fri Apr 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.3.0-1
- new upstream release.
- updated Patch0.
- dropped Patch1-3.

* Mon Jul 11 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.4-1
- new upstream release.

* Tue Feb 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.4-1
- initial build for Vine Linux based on fedora development

