From a1836c1dcbb6243795907a5761f1199f3f954ae1 Mon Sep 17 00:00:00 2001
From: Vittorio Giovara <vittorio.giovara@savoirfairelinux.com>
Date: Tue, 6 May 2014 19:45:14 -0400
Subject: [PATCH] contrib: add ccrtp rules

Change-Id: I56b3f1e8926f9f1c1e7382e13eb357a36394ef38
Refs: #46617
---
 contrib/src/ccrtp/SHA512SUMS           |  1 +
 contrib/src/ccrtp/rules.mak            | 26 ++++++++++++++++++++++++++
 contrib/src/ccrtp/standardheader.patch | 11 +++++++++++
 3 files changed, 38 insertions(+)
 create mode 100644 contrib/src/ccrtp/SHA512SUMS
 create mode 100644 contrib/src/ccrtp/rules.mak
 create mode 100644 contrib/src/ccrtp/standardheader.patch

diff --git a/contrib/src/ccrtp/SHA512SUMS b/contrib/src/ccrtp/SHA512SUMS
new file mode 100644
index 0000000000..7b31334fa1
--- /dev/null
+++ b/contrib/src/ccrtp/SHA512SUMS
@@ -0,0 +1 @@
+2e63a049ead5bd8a2f3c65d3badb6d6b2a20e185698f62ea9f7e559e8d0aac6151e7a314317d63ea33282c891d75af32571da3471254600abea462097c47dfe3  ccrtp-2.0.9.tar.gz
diff --git a/contrib/src/ccrtp/rules.mak b/contrib/src/ccrtp/rules.mak
new file mode 100644
index 0000000000..9c2b642e2e
--- /dev/null
+++ b/contrib/src/ccrtp/rules.mak
@@ -0,0 +1,26 @@
+# CCRTP
+CCRTP_VERSION := 2.0.9
+CCRTP_URL := $(GNUTELEPHONY)/ccrtp-$(CCRTP_VERSION).tar.gz
+
+PKGS += ccrtp
+ifeq ($(call need_pkg,'libccrtp >= 2.0.3'),)
+PKGS_FOUND += ccrtp
+endif
+
+DEPS_ccrtp = ucommon gcrypt gnutls
+
+$(TARBALLS)/ccrtp-$(CCRTP_VERSION).tar.gz:
+	$(call download,$(CCRTP_URL))
+
+.sum-ccrtp: ccrtp-$(CCRTP_VERSION).tar.gz
+
+ccrtp: ccrtp-$(CCRTP_VERSION).tar.gz .sum-ccrtp
+	$(UNPACK)
+	$(APPLY) $(SRC)/ccrtp/standardheader.patch
+	$(UPDATE_AUTOCONFIG)
+	$(MOVE)
+
+.ccrtp: ccrtp
+	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
+	cd $< && $(MAKE) install
+	touch $@
diff --git a/contrib/src/ccrtp/standardheader.patch b/contrib/src/ccrtp/standardheader.patch
new file mode 100644
index 0000000000..7e6ed4e8e0
--- /dev/null
+++ b/contrib/src/ccrtp/standardheader.patch
@@ -0,0 +1,11 @@
+--- a/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp.orig	2014-06-25 20:40:20.000000000 -0400
++++ b/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp	2014-06-25 20:40:32.000000000 -0400
+@@ -17,7 +17,7 @@
+ 
+ #include <stdio.h>
+ 
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <pthread.h>
+ #include <errno.h>
+ #include <gcrypt.h>
-- 
GitLab