[packages/libzrtp] - new - shared patch to build as shared library, using system bnlib

qboosh qboosh at pld-linux.org
Thu Jan 31 18:48:25 CET 2013


commit 63daf20a8950e19be5d087ba247aec43357cb613
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jan 31 18:49:14 2013 +0100

    - new
    - shared patch to build as shared library, using system bnlib

 libzrtp-shared.patch |  97 ++++++++++++++++++++++++++++++++++++++
 libzrtp.spec         | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 227 insertions(+)
---
diff --git a/libzrtp.spec b/libzrtp.spec
new file mode 100644
index 0000000..f2255fc
--- /dev/null
+++ b/libzrtp.spec
@@ -0,0 +1,130 @@
+#
+# Conditional build:
+%bcond_without	apidocs		# do not build and package API docs
+%bcond_without	sqlite3		# SQLite based cache
+%bcond_without	tests		# do not perform "make check"
+#
+Summary:	Phil Zimmermann's SDK for ZRTP
+Summary(pl.UTF-8):	SDK ZRTP Phila Zimmermanna
+Name:		libzrtp
+Version:	1.2.0
+%define	snap	20120707
+Release:	0.%{snap}.1
+License:	AGPL v3 with FreeSWITCH exception or commercial
+Group:		Libraries
+Source0:	https://github.com/traviscross/libzrtp/archive/master.tar.gz
+# Source0-md5:	58bddacc5a35f3271c7c7095e8b35d49
+Patch0:		%{name}-shared.patch
+URL:		http://zfone.com/prod_sdk.html
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	bnlib-devel
+%{?with_apidocs:BuildRequires:	doxygen}
+BuildRequires:	libtool
+%{?with_sqlite3:BuildRequires:	sqlite3-devel}
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+libZRTP SDK library implements the ZRTP secure VoIP protocol.
+
+%description -l pl.UTF-8
+Biblioteka libZRTP SDK implementuje bezpieczny protokół VoIP ZRTP.
+
+%package devel
+Summary:	Header files for ZRTP library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki ZRTP
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	bnlib-devel
+%{?with_sqlite3:Requires:	sqlite3-devel}
+
+%description devel
+Header files for ZRTP library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki ZRTP.
+
+%package static
+Summary:	Static ZRTP library
+Summary(pl.UTF-8):	Statyczna biblioteka ZRTP
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static ZRTP library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka ZRTP.
+
+%package apidocs
+Summary:	ZRTP API documentation
+Summary(pl.UTF-8):	Dokumentacja API biblioteki ZRTP
+Group:		Documentation
+
+%description apidocs
+API documentation for ZRTP library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki ZRTP.
+
+%prep
+%setup -q -n %{name}-master
+%patch0 -p1
+
+head -n78 src/zrtp_legal.c >LEGAL
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	%{?with_sqlite3:--with-sqlite}
+%{__make}
+
+%{?with_apidocs:%{__make} doc}
+
+%if %{with tests}
+%{__make} check
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%if %{with apidocs}
+install -d $RPM_BUILD_ROOT%{_mandir}/man3
+cp -p doc/out/man/man3/zrtp*.3 $RPM_BUILD_ROOT%{_mandir}/man3
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS COPYING ChangeLog LEGAL README
+%attr(755,root,root) %{_libdir}/libzrtp.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libzrtp.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libzrtp.so
+%{_libdir}/libzrtp.la
+%{_includedir}/libzrtp
+%{?with_apidocs:%{_mandir}/man3/zrtp*.3*}
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libzrtp.a
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/out/html/*
+%endif
diff --git a/libzrtp-shared.patch b/libzrtp-shared.patch
new file mode 100644
index 0000000..48793c7
--- /dev/null
+++ b/libzrtp-shared.patch
@@ -0,0 +1,97 @@
+--- libzrtp-master/Makefile.am.orig	2012-07-07 20:59:23.000000000 +0200
++++ libzrtp-master/Makefile.am	2013-01-31 18:10:08.706028631 +0100
+@@ -32,8 +32,6 @@ libzrtp_include_HEADERS = \
+ 					$(top_srcdir)/include/zrtp_types.h \
+ 					$(top_srcdir)/include/zrtp_version.h \
+ 					\
+-					$(top_srcdir)/third_party/bnlib/bn.h \
+-					\
+ 					$(top_srcdir)/third_party/bgaes/aes.h \
+ 					$(top_srcdir)/third_party/bgaes/aesopt.h \
+ 					$(top_srcdir)/third_party/bgaes/aestab.h \
+@@ -53,18 +51,17 @@ libzrtp_include_HEADERS += $(top_srcdir)
+ 						   $(top_srcdir)/include/zrtp_b64_encode.h
+ endif
+ 
+-lib_LIBRARIES = libzrtp.a
++lib_LTLIBRARIES = libzrtp.la
+ 
+-libzrtp_a_CPPFLAGS = \
++libzrtp_la_CPPFLAGS = \
+ 			-I$(top_srcdir)/include \
+ 			-I$(top_srcdir)/. \
+-			-I$(top_srcdir)/third_party/bgaes \
+-			-I$(top_srcdir)/third_party/bnlib
++			-I$(top_srcdir)/third_party/bgaes
+ 
+ 
+-libzrtp_a_LIBADD = $(top_srcdir)/third_party/bnlib/libbn.a
++libzrtp_la_LIBADD = -lbn
+ 
+-libzrtp_a_SOURCES = $(top_srcdir)/src/zrtp.c \
++libzrtp_la_SOURCES = $(top_srcdir)/src/zrtp.c \
+ 					$(top_srcdir)/src/zrtp_cache.c \
+ 					$(top_srcdir)/src/zrtp_cache_file.c \
+ 					$(top_srcdir)/src/zrtp_crc.c \
+@@ -100,12 +97,12 @@ libzrtp_a_SOURCES = $(top_srcdir)/src/zr
+ 					\
+ 					$(top_srcdir)/src/zrtp_engine_driven.c
+ if ZRTP_BUILD_ENTERPRISE
+-libzrtp_a_SOURCES +=$(top_srcdir)/src/zrtp_crypto_ec.c \
++libzrtp_la_SOURCES +=$(top_srcdir)/src/zrtp_crypto_ec.c \
+ 					$(top_srcdir)/src/zrtp_crypto_ecdh.c
+ endif
+ 
+ if ZRTP_WITH_SQLITE
+-libzrtp_a_SOURCES +=$(top_srcdir)/src/zrtp_cache_db.c \
++libzrtp_la_SOURCES +=$(top_srcdir)/src/zrtp_cache_db.c \
+ 					$(top_srcdir)/src/zrtp_cache_sqlite_backend.c \
+ 					$(top_srcdir)/src/zrtp_b64_decode.c \
+ 					$(top_srcdir)/src/zrtp_b64_encode.c
+@@ -117,14 +114,11 @@ cache_test_CPPFLAGS = 	-I$(top_srcdir)/i
+ 			-I$(top_srcdir)/. \
+ 			-I$(top_srcdir)/test \
+ 			-I$(top_srcdir)/test/cmockery \
+-			-I$(top_srcdir)/third_party/bgaes \
+-			-I$(top_srcdir)/third_party/bnlib
++			-I$(top_srcdir)/third_party/bgaes
+ 
+ cache_test_SOURCES = $(top_srcdir)/test/cmockery/cmockery.c \
+ 					 $(top_srcdir)/test/cache_test.c
+-cache_test_LDADD   = libzrtp.a  $(top_srcdir)/third_party/bnlib/libbn.a -lpthread
+-
+-SUBDIRS =  third_party/bnlib
++cache_test_LDADD   = libzrtp.la -lbn -lpthread
+ 
+ if HAVE_DOXYGEN
+ doc: .stamp-doc
+@@ -135,5 +129,4 @@ endif
+ 
+ uninstall:
+ 	rm -rf $(prefix)/include/libzrtp
+-	rm -f $(prefix)/lib/libzrtp.a
+ 
+--- libzrtp-master/configure.in.orig	2012-07-07 20:59:23.000000000 +0200
++++ libzrtp-master/configure.in	2013-01-31 18:24:47.736010304 +0100
+@@ -35,19 +35,12 @@ esac
+ AM_INIT_AUTOMAKE
+ AX_PREFIX_CONFIG_H(include/zrtp_config_unix.h,ZRTP,config/config.h)
+ 
+-CFLAGS="$CFLAGS -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1"
+-
+-# Configuring external libraries
+-echo "========================= configuring bnlib =============================="
+-cd third_party/bnlib
+-./configure CFLAGS="$CFLAGS"
+-cd ../..
+-echo "================================ done  ==================================="
++CFLAGS="$CFLAGS -std=c99 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -DZRTP_AUTOMAKE=1"
+ 
+ # Checks for programs.
+ AC_PROG_CC
+ AC_PROG_CXX
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+ 
+ # Apply configure options
+ AC_ARG_ENABLE(enterprise, [--enable-enterprise enable building of enterprise components).], enable_enterprise=$enableval,enable_enterprise="no")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libzrtp.git/commitdiff/63daf20a8950e19be5d087ba247aec43357cb613



More information about the pld-cvs-commit mailing list