3d77a95
%global shortname srtp
3d77a95
%global cvsver 20101004cvs
3d77a95
3d77a95
Name:		lib%{shortname}
3d77a95
Version:	1.4.4
ce49231
Release:	4.%{cvsver}%{?dist}
3d77a95
Summary:	An implementation of the Secure Real-time Transport Protocol (SRTP)
3d77a95
Group:		System Environment/Libraries
3d77a95
License:	BSD
3d77a95
URL:		http://srtp.sourceforge.net
3d77a95
# Upstream 1.4.4 tarball is a bit dated, need to use cvs
3d77a95
# cvs -d:pserver:anonymous@srtp.cvs.sourceforge.net:/cvsroot/srtp co -P srtp
3d77a95
# tar cvfj srtp-1.4.4-20101004cvs.tar.bz2 srtp/
3d77a95
Source0:	%{shortname}-%{version}-%{cvsver}.tar.bz2
3d77a95
# Pkgconfig goodness
3d77a95
Source1:	libsrtp.pc
ce49231
# Universal config.h
ce49231
Source2:	config.h
ce49231
3d77a95
# Seriously. Who doesn't do shared libs these days?
3d77a95
# And how does Chromium always manage to find these projects and use them?
3d77a95
Patch0:		libsrtp-1.4.4-shared.patch
3d77a95
3d77a95
%description
3d77a95
This package provides an implementation of the Secure Real-time
3d77a95
Transport Protocol (SRTP), the Universal Security Transform (UST), and
3d77a95
a supporting cryptographic kernel. 
3d77a95
3d77a95
%package devel
3d77a95
Summary:	Development files for %{name}
3d77a95
Group:		Development/Libraries
3d77a95
Requires:	%{name} = %{version}-%{release}
3d77a95
Requires:	pkgconfig
3d77a95
3d77a95
%description devel
3d77a95
The %{name}-devel package contains libraries and header files for
3d77a95
developing applications that use %{name}.
3d77a95
3d77a95
%prep
3d77a95
%setup -q -n %{shortname}
3d77a95
%patch0 -p1 -b .shared
3d77a95
3d77a95
# Fix end-of-line encoding
3d77a95
sed -i 's/\r//g' doc/draft-irtf-cfrg-icm-00.txt
3d77a95
ce49231
%if 0%{?rhel} > 0
ce49231
%ifarch ppc64
ce49231
sed -i 's/-z noexecstack//' Makefile.in
ce49231
%endif
ce49231
%endif
ce49231
3d77a95
%build
3d77a95
export CFLAGS="%{optflags} -fPIC"
3d77a95
%configure --disable-static
3d77a95
make %{?_smp_mflags}
3d77a95
3d77a95
%install
3d77a95
make install DESTDIR=%{buildroot}
3d77a95
find %{buildroot} -name '*.la' -exec rm -f {} ';'
3d77a95
pushd %{buildroot}%{_libdir}
3d77a95
ln -sf libsrtp.so.0.0.0 libsrtp.so
3d77a95
ln -sf libsrtp.so.0.0.0 libsrtp.so.0
3d77a95
popd
3d77a95
3d77a95
# Install the pkg-config file
3d77a95
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
3d77a95
install -m0644 %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/
3d77a95
# Fill in the variables
3d77a95
sed -i "s|@PREFIX@|%{_prefix}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
3d77a95
sed -i "s|@LIBDIR@|%{_libdir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
3d77a95
sed -i "s|@INCLUDEDIR@|%{_includedir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc
3d77a95
ce49231
# Handle multilib issues with config.h
ce49231
mv %{buildroot}%{_includedir}/%{shortname}/config.h %{buildroot}%{_includedir}/%{shortname}/config-%{__isa_bits}.h
ce49231
cp -a %{SOURCE2} %{buildroot}%{_includedir}/%{shortname}/config.h
ce49231
3d77a95
%post -p /sbin/ldconfig
3d77a95
%postun -p /sbin/ldconfig
3d77a95
3d77a95
%files
3d77a95
%defattr(-,root,root,-)
3d77a95
%doc CHANGES LICENSE README TODO VERSION doc/*.txt doc/*.pdf
3d77a95
%{_libdir}/*.so.*
3d77a95
3d77a95
%files devel
3d77a95
%defattr(-,root,root,-)
3d77a95
%{_includedir}/%{shortname}/
3d77a95
%{_libdir}/pkgconfig/libsrtp.pc
3d77a95
%{_libdir}/*.so
3d77a95
3d77a95
%changelog
ce49231
* Tue Feb 21 2012 Tom Callaway <spot@fedoraproject.org> - 1.4.4-4.20101004cvs
ce49231
- handle config.h multilib (bz787537)
ce49231
ce49231
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4-3.20101004cvs
ce49231
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ce49231
6acf9e3
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4-2.20101004cvs
6acf9e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6acf9e3
ce49231
* Tue Jan 25 2011 Jeffrey C. Ollie <jeff@ocjtech.us>
ce49231
- Don't use '-z noexecstack' option for linker on PPC64 (EL6)
ce49231
3d77a95
* Mon Oct  4 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 1.4.4-1.20101004cvs
3d77a95
- initial package