diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e53c59d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/srtp-1.4.4-20101004cvs.tar.bz2 diff --git a/.libsrtp.metadata b/.libsrtp.metadata new file mode 100644 index 0000000..f7e177c --- /dev/null +++ b/.libsrtp.metadata @@ -0,0 +1 @@ +feb943c1fbedf3ef3a1f63bf9d99e2db572b4858 SOURCES/srtp-1.4.4-20101004cvs.tar.bz2 diff --git a/SOURCES/config.h b/SOURCES/config.h new file mode 100644 index 0000000..d0860ba --- /dev/null +++ b/SOURCES/config.h @@ -0,0 +1,18 @@ +/* This file is here to prevent a file conflict on multiarch systems. A + * conflict will frequently occur because arch-specific build-time + * configuration options are stored (and used, so they can't just be stripped + * out) in config.h. The original config.h has been renamed. + * DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */ + +#ifdef srtp_multilib_redirection_h +#error "Do not define srtp_multilib_redirection_h!" +#endif +#define srtp_multilib_redirection_h + +#if defined(__x86_64__) || defined(__PPC64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__s390x__) || defined(__aarch64__) +#include "srtp/config-64.h" +#else +#include "srtp/config-32.h" +#endif + +#undef srtp_multilib_redirection_h diff --git a/SOURCES/libsrtp-1.4.4-shared.patch b/SOURCES/libsrtp-1.4.4-shared.patch new file mode 100644 index 0000000..b1703ad --- /dev/null +++ b/SOURCES/libsrtp-1.4.4-shared.patch @@ -0,0 +1,75 @@ +diff -up srtp/Makefile.in.shared srtp/Makefile.in +--- srtp/Makefile.in.shared 2010-05-21 13:45:35.000000000 -0400 ++++ srtp/Makefile.in 2010-10-04 15:53:29.132116130 -0400 +@@ -8,7 +8,7 @@ + # runtest runs test applications + # test builds test applications + # libcrypt.a static library implementing crypto engine +-# libsrtp.a static library implementing srtp ++# libsrtp.so shared library implementing srtp + # clean removes objects, libs, and executables + # distribution cleans and builds a .tgz + # tags builds etags file from all .c and .h files +@@ -97,13 +97,13 @@ kernel = crypto/kernel/crypto_kernel.o + + cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) + +-# libsrtp.a (implements srtp processing) ++# libsrtp (implements srtp processing) + + srtpobj = srtp/srtp.o srtp/ekt.o + +-libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi) +- ar cr libsrtp.a $^ +- $(RANLIB) libsrtp.a ++libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi) ++ $(COMPILE) -shared -pthread -lm -Wl,--no-undefined -Wl,-soname,$@.0 -z noexecstack -o $@.0.0.0 $^ ++ ln -s $@.0.0.0 $@ + + # libcryptomath.a contains general-purpose routines that are used to + # generate tables and verify cryptoalgorithm implementations - this +@@ -127,19 +127,19 @@ testapp = $(crypto_testapp) test/srtp_dr + test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \ + test/dtls_srtp_driver$(EXE) + +-$(testapp): libsrtp.a ++$(testapp): libsrtp.so + + test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c +- $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) ++ $(COMPILE) $(LDFLAGS) -o $@ test/rtpw.c test/rtp.c test/getopt_s.c $(LIBS) $(SRTPLIB) + + test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c +- $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) ++ $(COMPILE) $(LDFLAGS) -o $@ test/srtp_driver.c test/getopt_s.c $(LIBS) $(SRTPLIB) + + test/rdbx_driver$(EXE): test/rdbx_driver.c test/getopt_s.c +- $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) ++ $(COMPILE) $(LDFLAGS) -o $@ test/rdbx_driver.c test/getopt_s.c $(LIBS) $(SRTPLIB) + + test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c +- $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) ++ $(COMPILE) $(LDFLAGS) -o $@ test/dtls_srtp_driver.c test/getopt_s.c $(LIBS) $(SRTPLIB) + + test: $(testapp) + @echo "Build done. Please run '$(MAKE) runtest' to run self tests." +@@ -197,16 +197,16 @@ install: + cp $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp + cp $(srcdir)/crypto/include/*.h $(DESTDIR)$(includedir)/srtp + if [ "$(srcdir)" != "." ]; then cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp; fi +- if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi ++ if [ -f libsrtp.so.0.0.0 ]; then cp libsrtp.so.0.0.0 $(DESTDIR)$(libdir)/; fi + + uninstall: + rm -f $(DESTDIR)$(includedir)/srtp/*.h +- rm -f $(DESTDIR)$(libdir)/libsrtp.a ++ rm -f $(DESTDIR)$(libdir)/libsrtp.so* + -rmdir $(DESTDIR)$(includedir)/srtp + + clean: + rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ +- libcryptomath.a libsrtp.a core *.core test/core ++ libcryptomath.a libsrtp.so* core *.core test/core + for a in * */* */*/*; do \ + if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ + done; diff --git a/SOURCES/libsrtp.pc b/SOURCES/libsrtp.pc new file mode 100644 index 0000000..e17a0df --- /dev/null +++ b/SOURCES/libsrtp.pc @@ -0,0 +1,14 @@ +prefix=@PREFIX@ +exec_prefix=@PREFIX@ +libdir=@LIBDIR@ +includedir=@INCLUDEDIR@ + +Name: libsrtp +Description: Secure Real-time Transport Protocol library +Version: 1.4.4 +URL: http://srtp.sourceforge.net +Requires: +Conflicts: +Libs: -L${libdir} -lsrtp +Libs.private: +Cflags: -I${includedir}/srtp/ diff --git a/SPECS/libsrtp.spec b/SPECS/libsrtp.spec new file mode 100644 index 0000000..8e0fb11 --- /dev/null +++ b/SPECS/libsrtp.spec @@ -0,0 +1,124 @@ +%global shortname srtp +%global cvsver 20101004cvs + +Name: lib%{shortname} +Version: 1.4.4 +Release: 10.%{cvsver}%{?dist} +Summary: An implementation of the Secure Real-time Transport Protocol (SRTP) +Group: System Environment/Libraries +License: BSD +URL: http://srtp.sourceforge.net +# Upstream 1.4.4 tarball is a bit dated, need to use cvs +# cvs -d:pserver:anonymous@srtp.cvs.sourceforge.net:/cvsroot/srtp co -P srtp +# tar cvfj srtp-1.4.4-20101004cvs.tar.bz2 srtp/ +Source0: %{shortname}-%{version}-%{cvsver}.tar.bz2 +# Pkgconfig goodness +Source1: libsrtp.pc +# Universal config.h +Source2: config.h + +# Seriously. Who doesn't do shared libs these days? +# And how does Chromium always manage to find these projects and use them? +Patch0: libsrtp-1.4.4-shared.patch + +%description +This package provides an implementation of the Secure Real-time +Transport Protocol (SRTP), the Universal Security Transform (UST), and +a supporting cryptographic kernel. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q -n %{shortname} +%patch0 -p1 -b .shared + +# Fix end-of-line encoding +sed -i 's/\r//g' doc/draft-irtf-cfrg-icm-00.txt + +%if 0%{?rhel} > 0 +%ifarch ppc64 +sed -i 's/-z noexecstack//' Makefile.in +%endif +%endif + +%build +export CFLAGS="%{optflags} -fPIC" +%configure --disable-static +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} +find %{buildroot} -name '*.la' -exec rm -f {} ';' +pushd %{buildroot}%{_libdir} +ln -sf libsrtp.so.0.0.0 libsrtp.so +ln -sf libsrtp.so.0.0.0 libsrtp.so.0 +popd + +# Install the pkg-config file +mkdir -p %{buildroot}%{_libdir}/pkgconfig/ +install -m0644 %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/ +# Fill in the variables +sed -i "s|@PREFIX@|%{_prefix}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc +sed -i "s|@LIBDIR@|%{_libdir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc +sed -i "s|@INCLUDEDIR@|%{_includedir}|g" %{buildroot}%{_libdir}/pkgconfig/libsrtp.pc + +# Handle multilib issues with config.h +mv %{buildroot}%{_includedir}/%{shortname}/config.h %{buildroot}%{_includedir}/%{shortname}/config-%{__isa_bits}.h +cp -a %{SOURCE2} %{buildroot}%{_includedir}/%{shortname}/config.h + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc CHANGES LICENSE README TODO VERSION doc/*.txt doc/*.pdf +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_includedir}/%{shortname}/ +%{_libdir}/pkgconfig/libsrtp.pc +%{_libdir}/*.so + +%changelog +* Tue Sep 16 2014 Jan Grulich - 1.4.4-10.20101004cvs +- Add detection for aarch64 + Resolves: bz#1141907 + +* Fri Jan 24 2014 Daniel Mach - 1.4.4-9.20101004cvs +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.4.4-8.20101004cvs +- Mass rebuild 2013-12-27 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.4.4-7.20101004cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Sep 25 2012 Karsten Hopp 1.4.4-6.20101004cvs +- use __PPC64__, not __ppc64__ which is undefined on PPC64 arch + +* Thu Jul 19 2012 Fedora Release Engineering - 1.4.4-5.20101004cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Feb 21 2012 Tom Callaway - 1.4.4-4.20101004cvs +- handle config.h multilib (bz787537) + +* Fri Jan 13 2012 Fedora Release Engineering - 1.4.4-3.20101004cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.4.4-2.20101004cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 25 2011 Jeffrey C. Ollie +- Don't use '-z noexecstack' option for linker on PPC64 (EL6) + +* Mon Oct 4 2010 Tom "spot" Callaway - 1.4.4-1.20101004cvs +- initial package