[packages/twinkle] Revert "- retired package, same comment as fedora"

arekm arekm at pld-linux.org
Sun Mar 22 14:02:18 CET 2020


commit cf18f1407e86bec8b500bd6592e6de514f2a63d9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Mar 22 13:39:51 2020 +0100

    Revert "- retired package, same comment as fedora"
    
    This reverts commit b377da19d21665f75d92be6bf7c07de21d09d396.
    
    As there is qt5 port.

 dead.package          |   2 -
 twinkle-build.patch   |  10 +
 twinkle-ilbc.patch    | 169 ++++++++++++++
 twinkle-nobind.patch  |  11 +
 twinkle-ucommon.patch | 609 ++++++++++++++++++++++++++++++++++++++++++++++++++
 twinkle.desktop       |   9 +
 twinkle.spec          |  91 ++++++++
 7 files changed, 899 insertions(+), 2 deletions(-)
---
diff --git a/twinkle.spec b/twinkle.spec
new file mode 100644
index 0000000..29c114b
--- /dev/null
+++ b/twinkle.spec
@@ -0,0 +1,91 @@
+#
+# Conditional build:
+%bcond_with	kde		# disable KDE support
+#
+Summary:	twinkle - SIP Soft Phone
+Summary(pl.UTF-8):	twinkle - telefon programowy SIP
+Name:		twinkle
+Version:	1.4.2
+Release:	21
+License:	GPL v2
+Group:		Applications/Communications
+Source0:	http://www.xs4all.nl/~mfnboer/twinkle/download/%{name}-%{version}.tar.gz
+# Source0-md5:	d70c8972f296ffd998c7fb698774705b
+Source1:	%{name}.desktop
+Patch0:		%{name}-nobind.patch
+Patch1:		%{name}-build.patch
+Patch2:		%{name}-ucommon.patch
+Patch3:		%{name}-ilbc.patch
+URL:		http://www.twinklephone.com/
+BuildRequires:	alsa-lib-devel
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	boost-devel >= 1.35.0
+BuildRequires:	ccrtp-devel >= 2.0.0
+BuildRequires:	commoncpp2-devel >= 1.7.1
+%{?with_kde:BuildRequires:	kdelibs-devel}
+BuildRequires:	libgsm-devel >= 1.0.11
+BuildRequires:	webrtc-libilbc-devel
+BuildRequires:	libmagic-devel
+BuildRequires:	libsndfile-devel
+BuildRequires:	libtool
+BuildRequires:	libxml2-devel
+BuildRequires:	libzrtpcpp-devel >= 1.4.3
+BuildRequires:	pkgconfig
+BuildRequires:	qmake
+BuildRequires:	qt-devel >= 6:3.3.0
+BuildRequires:	qt-linguist
+BuildRequires:	readline-devel
+BuildRequires:	speex-devel
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Twinkle is a SIP based soft phone for making telephone calls over IP
+networks.
+
+%description -l pl.UTF-8
+Twinkle to oparty na SIP programowy telefon do wykonywania połączeń
+telefonicznych po sieciach IP.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p0
+%patch2 -p1
+%patch3 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+export QTDIR=%{_prefix}
+%configure \
+%if "%{_lib}" == "lib64"
+	--enable-libsuffix=64 \
+%endif
+	--%{?debug:en}%{!?debug:dis}able-debug%{?debug:=full} \
+	%{!?with_kde:--without-kde} \
+	--with-qt-libraries=%{_libdir}
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}}
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+install src/gui/images/twinkle48.png $RPM_BUILD_ROOT%{_pixmapsdir}/twinkle.png
+install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog README THANKS
+%attr(755,root,root) %{_bindir}/*
+%{_datadir}/twinkle
+%{_pixmapsdir}/twinkle.png
+%{_desktopdir}/twinkle.desktop
diff --git a/dead.package b/dead.package
deleted file mode 100644
index c9116fb..0000000
--- a/dead.package
+++ /dev/null
@@ -1,2 +0,0 @@
-Package is retired. Upstream is very dead, code is bitrotting.
-See: http://lists.fedoraproject.org/pipermail/devel/2013-March/179593.html
diff --git a/twinkle-build.patch b/twinkle-build.patch
new file mode 100644
index 0000000..4a7f6d1
--- /dev/null
+++ b/twinkle-build.patch
@@ -0,0 +1,10 @@
+--- src/utils/file_utils.cpp~	2008-07-10 22:03:58.000000000 +0200
++++ src/utils/file_utils.cpp	2008-08-23 13:11:54.194624312 +0200
+@@ -24,6 +24,7 @@
+ #include <vector>
+ #include <cerrno>
+ #include <unistd.h>
++#include <stdlib.h>
+ 
+ using namespace std;
+ using namespace utils;
diff --git a/twinkle-ilbc.patch b/twinkle-ilbc.patch
new file mode 100644
index 0000000..3b84bb4
--- /dev/null
+++ b/twinkle-ilbc.patch
@@ -0,0 +1,169 @@
+diff -ur twinkle-1.4.2/configure.in twinkle-1.4.2.ilbc/configure.in
+--- twinkle-1.4.2/configure.in	2012-11-25 17:33:24.559058451 +0100
++++ twinkle-1.4.2.ilbc/configure.in	2012-11-25 17:24:34.305743823 +0100
+@@ -247,15 +247,20 @@
+ # iLBC
+ if test "x$ac_cv_ilbc" = "xyes"
+ then
+-	AC_CHECK_LIB(ilbc, iLBC_decode, [
+-		AC_CHECK_HEADER(ilbc/iLBC_define.h, [],
+-			[AC_MSG_ERROR([ilbc header files missing])])
++	saved_LIBS="$LIBS"
++	LIBS="-lilbc $LIBS"
++	AC_LINK_IFELSE([
++		     #include <stdio.h>
++		     #include <ilbc.h>
++		     int main() { iLBC_decode(NULL, NULL, NULL, 0); return 0; } ], [
+ 		AC_DEFINE(HAVE_ILBC, 1, [Define to 1 if you have the <ilbc> library.])
+-		LIBS="-lilbc $LIBS"
+ 		echo "LIBS += -lilbc" >> $QT_INCL_PRO
+ 		have_ilbc="yes"
+-		], [have_ilbc="no"])
++		], [
++		LIBS="$saved_LIBS"
++		have_ilbc="no"
++		])
+ 		
+ 	if test "x$ac_cv_ilbc_cpp" = "xyes"
+ 	then
+ 		AC_DEFINE(HAVE_ILBC_CPP, 1, [Define to 1 if you have a C++ ilbc library.])
+diff -ur twinkle-1.4.2/src/audio/audio_decoder.cpp twinkle-1.4.2.ilbc/src/audio/audio_decoder.cpp
+--- twinkle-1.4.2/src/audio/audio_decoder.cpp	2009-01-18 14:38:00.000000000 +0100
++++ twinkle-1.4.2.ilbc/src/audio/audio_decoder.cpp	2012-11-25 17:28:53.519068012 +0100
+@@ -25,12 +25,28 @@
+ #ifndef HAVE_ILBC_CPP
+ extern "C" {
+ #endif
+-#include <ilbc/iLBC_decode.h>
++#include <ilbc.h>
+ #ifndef HAVE_ILBC_CPP
+ }
+ #endif
+ #endif
+ 
++#ifndef	NO_OF_BYTES_20MS
++#define	NO_OF_BYTES_20MS	38
++#endif
++
++#ifndef	NO_OF_BYTES_30MS
++#define	NO_OF_BYTES_30MS	50
++#endif
++
++#ifndef	MIN_SAMPLE
++#define	MIN_SAMPLE	-32768
++#endif
++
++#ifndef	MAX_SAMPLE
++#define	MAX_SAMPLE	32767
++#endif
++
+ //////////////////////////////////////////
+ // class t_audio_decoder
+ //////////////////////////////////////////
+@@ -278,19 +294,19 @@
+ uint16 t_ilbc_audio_decoder::decode(uint8 *payload, uint16 payload_size,
+ 		int16 *pcm_buf, uint16 pcm_buf_size)
+ {
+-	float sample;
+-	float block[BLOCKL_MAX];
++	int16 sample;
++	int16 block[BLOCKL_MAX];
+ 	int block_len;
+ 	
+ 	if (get_ptime(payload_size) == 20) {
+ 		block_len = BLOCKL_20MS;
+ 		assert(pcm_buf_size >= block_len);
+-		iLBC_decode(block, (unsigned char*)payload, &_ilbc_decoder_20, 1);
++		iLBC_decode(block, (uint16*)payload, &_ilbc_decoder_20, 1);
+ 		_last_received_ptime = 20;
+ 	} else {
+ 		block_len = BLOCKL_30MS;
+ 		assert(pcm_buf_size >= block_len);
+-		iLBC_decode(block, (unsigned char*)payload, &_ilbc_decoder_30, 1);
++		iLBC_decode(block, (uint16*)payload, &_ilbc_decoder_30, 1);
+ 		_last_received_ptime = 30;
+ 	}
+ 	
+@@ -300,15 +316,15 @@
+ 		if (sample < MIN_SAMPLE) sample = MIN_SAMPLE;
+ 		if (sample > MAX_SAMPLE) sample = MAX_SAMPLE;
+ 		
+-		pcm_buf[i] = static_cast<int16>(sample);
++		pcm_buf[i] = sample;
+ 	}
+ 
+ 	return block_len;
+ }
+ 
+ uint16 t_ilbc_audio_decoder::conceal(int16 *pcm_buf, uint16 pcm_buf_size) {
+-	float sample;
+-	float block[BLOCKL_MAX];
++	short int sample;
++	short int block[BLOCKL_MAX];
+ 	int block_len;
+ 	
+ 	if (_last_received_ptime == 0) return 0;
+diff -ur twinkle-1.4.2/src/audio/audio_decoder.h twinkle-1.4.2.ilbc/src/audio/audio_decoder.h
+--- twinkle-1.4.2/src/audio/audio_decoder.h	2012-11-25 17:33:24.559058451 +0100
++++ twinkle-1.4.2.ilbc/src/audio/audio_decoder.h	2012-11-25 17:24:34.305743823 +0100
+@@ -40,7 +40,7 @@
+ #ifndef HAVE_ILBC_CPP
+ extern "C" {
+ #endif
+-#include <ilbc/iLBC_define.h>
++#include <ilbc.h>
+ #ifndef HAVE_ILBC_CPP
+ }
+ #endif
+diff -ur twinkle-1.4.2/src/audio/audio_encoder.cpp twinkle-1.4.2.ilbc/src/audio/audio_encoder.cpp
+--- twinkle-1.4.2/src/audio/audio_encoder.cpp	2009-01-18 15:13:46.000000000 +0100
++++ twinkle-1.4.2.ilbc/src/audio/audio_encoder.cpp	2012-11-25 17:30:53.155730458 +0100
+@@ -24,12 +24,20 @@
+ #ifndef HAVE_ILBC_CPP
+ extern "C" {
+ #endif
+-#include <ilbc/iLBC_encode.h>
++#include <ilbc.h>
+ #ifndef HAVE_ILBC_CPP
+ }
+ #endif
+ #endif
+ 
++#ifndef	NO_OF_BYTES_20MS
++#define	NO_OF_BYTES_20MS	38
++#endif
++
++#ifndef	NO_OF_BYTES_30MS
++#define	NO_OF_BYTES_30MS	50
++#endif
++
+ //////////////////////////////////////////
+ // class t_audio_encoder
+ //////////////////////////////////////////
+@@ -264,13 +272,8 @@
+ 	assert(nsamples == _ilbc_encoder.blockl);
+ 	
+ 	silence = false;
+-	float block[nsamples];
+-	
+-	for (int i = 0; i < nsamples; i++) {
+-		block[i] = static_cast<float>(sample_buf[i]);
+-	}
+ 	
+-	iLBC_encode((unsigned char*)payload, block, &_ilbc_encoder);
++	iLBC_encode((uint16*)payload, sample_buf, &_ilbc_encoder);
+ 	
+ 	return _ilbc_encoder.no_of_bytes;
+ }
+diff -ur twinkle-1.4.2/src/audio/audio_encoder.h twinkle-1.4.2.ilbc/src/audio/audio_encoder.h
+--- twinkle-1.4.2/src/audio/audio_encoder.h	2012-11-25 17:33:24.562391784 +0100
++++ twinkle-1.4.2.ilbc/src/audio/audio_encoder.h	2012-11-25 17:24:34.305743823 +0100
+@@ -39,7 +39,7 @@
+ #ifndef HAVE_ILBC_CPP
+ extern "C" {
+ #endif
+-#include <ilbc/iLBC_define.h>
++#include <ilbc.h>
+ #ifndef HAVE_ILBC_CPP
+ }
+ #endif
diff --git a/twinkle-nobind.patch b/twinkle-nobind.patch
new file mode 100644
index 0000000..3af6362
--- /dev/null
+++ b/twinkle-nobind.patch
@@ -0,0 +1,11 @@
+--- twinkle/configure.in.org	2007-02-28 01:32:56.694623000 +0100
++++ twinkle/configure.in	2007-02-28 01:34:02.458623000 +0100
+@@ -136,7 +136,7 @@
+ 
+ # Check for libbbind or libresolv. libbind is preferred as libresolv gives
+ # GLIBC_PRIVATE on Fedora.
+-AC_CHECK_LIB(bind, main, [
++AC_CHECK_LIB(bind_dont_want, main, [
+ 	LIBS="-lbind $LIBS"
+ 	echo "LIBS += -lbind" >> $QT_INCL_PRO],
+ 	[
diff --git a/twinkle-ucommon.patch b/twinkle-ucommon.patch
new file mode 100644
index 0000000..c8f55bf
--- /dev/null
+++ b/twinkle-ucommon.patch
@@ -0,0 +1,609 @@
+Index: twinkle-1.4.2/configure.in
+===================================================================
+--- twinkle-1.4.2.orig/configure.in	2009-02-24 20:49:20.000000000 +0100
++++ twinkle-1.4.2/configure.in	2011-09-27 12:33:39.787913055 +0200
+@@ -47,7 +47,7 @@ AC_CHECK_HEADERS([linux/errqueue.h],[],[
+ 
+ # Check version of the Common C++ library.
+ # This also sets the cc++2 include directory in CXXFLAGS
+-OST_CCXX2_VERSION(1.6.0,,exit)
++#OST_CCXX2_VERSION(1.6.0,,exit)
+ 
+ # Temporarily add some default directories to PKG_CONFIG_PATH such that
+ # the user will not be burdened with setting PKG_CONFIG_PATH
+@@ -66,7 +66,9 @@ fi
+ 
+ export PKG_CONFIG_PATH
+ 
+-PKG_CHECK_MODULES(CCRTP, libccrtp1 >= 1.6.0)
++PKG_CHECK_MODULES(CCRTP, libccrtp >= 2.0.0)
++PKG_CHECK_MODULES(UCOMMON, ucommon >= 5.0.0)
++CCRTP_LIBS="$CCRTP_LIBS $UCOMMON_LIBS"
+ 
+ PKG_CHECK_MODULES(XML2, libxml-2.0)
+ # AC_CHECK_HEADER(libxml/tree.h, [],
+@@ -136,7 +138,7 @@ done
+ #echo "INCLUDEPATH += `$CCGNU2_CONFIG --includes`" | sed -e s/-I//g > $QT_INCL_PRO
+ # libccrtp1(ccrtp) depend from libccgnu2(commoncpp2) and
+ # should include above flags !
+-echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp1`" | sed -e s/-I//g >> $QT_INCL_PRO
++echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp`" | sed -e s/-I//g >> $QT_INCL_PRO
+ echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libxml-2.0`" | sed -e s/-I//g >> $QT_INCL_PRO
+ 
+ # get libraries specified on command line
+@@ -144,6 +146,7 @@ echo $LDFLAGS | xargs echo LIBS += >> $Q
+ 
+ echo "LIBS += `$CCGNU2_CONFIG --stdlibs`" >> $QT_INCL_PRO
+ echo "LIBS += $CCRTP_LIBS" >> $QT_INCL_PRO
++echo "LIBS += $UCOMMON_LIBS" >> $QT_INCL_PRO
+ echo "LIBS += $XML2_LIBS" >> $QT_INCL_PRO
+ 
+ # Check if KDE is available
+@@ -264,7 +267,7 @@ fi
+ # Check if zrtp is available
+ if test "x$ac_cv_zrtp" = "xyes"
+ then
+-	PKG_CHECK_MODULES(ZRTP, libzrtpcpp >= 1.3.0)
++	PKG_CHECK_MODULES(ZRTP, libzrtpcpp >= 2.0.0)
+ 	AC_CHECK_LIB(zrtpcpp, main, [
+ 		AC_CHECK_HEADER(libzrtpcpp/ZrtpQueue.h, [],
+ 			[AC_MSG_ERROR([zrtp header files missing])])
+Index: twinkle-1.4.2/src/audio/audio_decoder.h
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/audio_decoder.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/audio/audio_decoder.h	2011-09-27 12:33:39.790913085 +0200
+@@ -21,7 +21,6 @@
+ #ifndef _AUDIO_DECODER_H
+ #define _AUDIO_DECODER_H
+ 
+-#include <cc++/config.h>
+ #include "twinkle_config.h"
+ #include "audio_codecs.h"
+ #include "user.h"
+Index: twinkle-1.4.2/src/audio/audio_encoder.h
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/audio_encoder.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/audio/audio_encoder.h	2011-09-27 12:33:39.790913085 +0200
+@@ -21,7 +21,6 @@
+ #ifndef _AUDIO_ENCODER_H
+ #define _AUDIO_ENCODER_H
+ 
+-#include <cc++/config.h>
+ #include "twinkle_config.h"
+ #include "audio_codecs.h"
+ #include "user.h"
+Index: twinkle-1.4.2/src/audio/audio_rx.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/audio_rx.cpp	2009-01-31 13:05:53.000000000 +0100
++++ twinkle-1.4.2/src/audio/audio_rx.cpp	2011-09-27 12:33:39.791913095 +0200
+@@ -22,7 +22,6 @@
+ #include <cstdlib>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <cc++/config.h>
+ 
+ #include "audio_rx.h"
+ #include "log.h"
+Index: twinkle-1.4.2/src/audio/dtmf_player.h
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/dtmf_player.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/audio/dtmf_player.h	2011-09-27 12:33:39.791913095 +0200
+@@ -21,7 +21,6 @@
+ #ifndef _DTMF_PLAYER_H
+ #define _DTMF_PLAYER_H
+ 
+-#include <cc++/config.h>
+ #include "twinkle_config.h"
+ #include "audio_encoder.h"
+ #include "freq_gen.h"
+Index: twinkle-1.4.2/src/audio/freq_gen.h
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/freq_gen.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/audio/freq_gen.h	2011-09-27 12:33:39.791913095 +0200
+@@ -26,7 +26,7 @@
+ #define _FREQ_GEN_H
+ 
+ #include <vector>
+-#include <cc++/config.h>
++#include <commoncpp/config.h>
+ 
+ using namespace std;
+ 
+Index: twinkle-1.4.2/src/audio/tone_gen.h
+===================================================================
+--- twinkle-1.4.2.orig/src/audio/tone_gen.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/audio/tone_gen.h	2011-09-27 12:33:39.792913104 +0200
+@@ -21,7 +21,6 @@
+ 
+ #include <string>
+ #include <fstream>
+-#include <cc++/config.h>
+ #include <sndfile.h>
+ #include "sys_settings.h"
+ #include "threads/mutex.h"
+Index: twinkle-1.4.2/src/call_script.h
+===================================================================
+--- twinkle-1.4.2.orig/src/call_script.h	2009-01-03 17:54:01.000000000 +0100
++++ twinkle-1.4.2/src/call_script.h	2011-09-27 12:33:39.792913104 +0200
+@@ -65,7 +65,6 @@
+ 
+ #include <vector>
+ #include <string>
+-#include <cc++/config.h>
+ #include "user.h"
+ #include "parser/request.h"
+ 
+Index: twinkle-1.4.2/src/log.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/log.cpp	2009-01-18 15:35:28.000000000 +0100
++++ twinkle-1.4.2/src/log.cpp	2011-09-27 12:33:39.792913104 +0200
+@@ -40,6 +40,7 @@ void *main_logview(void *arg) {
+ 		// TODO: handle situation where log file was zapped.
+ 		if (ui) ui->cb_log_updated(false);
+ 	}
++	return NULL;
+ }
+ 
+ bool t_log::move_current_to_old(void) {
+@@ -161,7 +162,7 @@ void t_log::write_header(const string &f
+ 
+ 	gettimeofday(&t, NULL);
+ 	date = t.tv_sec;
+-	localtime_r(&date, &tm);
++	::localtime_r(&date, &tm);
+ 
+ 	*log_stream << "+++ ";
+ 	*log_stream << tm.tm_mday;
+Index: twinkle-1.4.2/src/mwi/mwi_dialog.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/mwi/mwi_dialog.cpp	2009-01-03 17:54:03.000000000 +0100
++++ twinkle-1.4.2/src/mwi/mwi_dialog.cpp	2011-09-27 12:33:39.793913113 +0200
+@@ -32,4 +32,5 @@ t_mwi_dialog::t_mwi_dialog(t_phone_user
+ t_mwi_dialog *t_mwi_dialog::copy(void) {
+ 	// Copy is not needed.
+ 	assert(false);
++	return NULL;
+ }
+Index: twinkle-1.4.2/src/mwi/simple_msg_sum_body.h
+===================================================================
+--- twinkle-1.4.2.orig/src/mwi/simple_msg_sum_body.h	2009-01-03 17:53:57.000000000 +0100
++++ twinkle-1.4.2/src/mwi/simple_msg_sum_body.h	2011-09-27 12:33:39.793913113 +0200
+@@ -26,7 +26,6 @@
+ 
+ #include <string>
+ #include <map>
+-#include <cc++/config.h>
+ #include "parser/sip_body.h"
+ #include "sockets/url.h"
+ 
+Index: twinkle-1.4.2/src/parser/definitions.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/parser/definitions.cpp	2009-01-03 17:54:07.000000000 +0100
++++ twinkle-1.4.2/src/parser/definitions.cpp	2011-09-27 12:33:39.793913113 +0200
+@@ -38,6 +38,7 @@ string method2str(const t_method &m, con
+ 	case METHOD_UNKNOWN:	return unknown;
+ 	default:		assert(false);
+ 	}
++	return unknown;
+ }
+ 
+ t_method str2method(const string &s) {
+Index: twinkle-1.4.2/src/parser/request.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/parser/request.cpp	2009-01-18 15:06:11.000000000 +0100
++++ twinkle-1.4.2/src/parser/request.cpp	2011-09-27 12:33:39.794913123 +0200
+@@ -23,9 +23,11 @@
+ #include "milenage.h"
+ #include "audits/memman.h"
+ #include <sstream>
+-#include <cc++/digest.h>
++#include <ucommon/secure.h>
+ 
+-using namespace ost;
++using namespace UCOMMON_NAMESPACE;
++
++// using namespace ost;
+ 
+ // AKAv1-MD5 algorithm specific helpers
+ 
+@@ -148,10 +150,10 @@ int b64_dec(const u8 * src, u8 * dst, in
+ // authentication with AKAv1-MD5 algorithm (RFC 3310)
+ 
+ bool t_request::authorize_akav1_md5(const t_digest_challenge &dchlg,
+-	const string &username, const string &passwd, uint8 *op, uint8 *amf,
++	const std::string &username, const std::string &passwd, uint8 *op, uint8 *amf,
+ 	unsigned long nc,
+-	const string &cnonce, const string &qop, string &resp, 
+-	string &fail_reason) const
++	const std::string &cnonce, const std::string &qop, std::string &resp, 
++	std::string &fail_reason) const
+ {
+ 	u8 nonce64[B64_DEC_SZ(dchlg.nonce.size())];
+ 	int len = b64_dec((const u8 *)dchlg.nonce.c_str(), nonce64, dchlg.nonce.size());
+@@ -183,7 +185,7 @@ bool t_request::authorize_akav1_md5(cons
+ 	for (i=0; i < AKA_SQNLEN; i++)
+     	sqn[i] = sqnxoraka[i] ^ ak[i];
+ 	
+-	string res_str = string((char *)res, AKA_RESLEN);
++	std::string res_str = std::string((char *)res, AKA_RESLEN);
+ 	
+ 	return authorize_md5(dchlg, username, res_str, nc, cnonce, qop, 
+ 			resp, fail_reason);
+@@ -192,11 +194,11 @@ bool t_request::authorize_akav1_md5(cons
+ // authentication with MD5 algorithm
+ 
+ bool t_request::authorize_md5(const t_digest_challenge &dchlg,
+-	const string &username, const string &passwd, unsigned long nc,
+-	const string &cnonce, const string &qop, string &resp, 
+-	string &fail_reason) const
++	const std::string &username, const std::string &passwd, unsigned long nc,
++	const std::string &cnonce, const std::string &qop, std::string &resp, 
++	std::string &fail_reason) const
+ {
+-	string A1, A2;
++	std::string A1, A2;
+ 	// RFC 2617 3.2.2.2
+ 	A1 = username + ":" + dchlg.realm + ":" + passwd;
+ 
+@@ -207,60 +209,51 @@ bool t_request::authorize_md5(const t_di
+ 		A2 = method2str(method, unknown_method) + ":" + uri.encode();
+ 		A2 += ":";
+ 		if (body) {
+-			MD5Digest MD5body;
+-			MD5body << body->encode();
+-			ostringstream os;
+-			os << MD5body;
+-			A2 += os.str();
++			digest_t MD5body = "md5";
++			MD5body.puts(body->encode().c_str());
++			A2 += std::string(MD5body.c_str());
+ 		} else {
+-			MD5Digest MD5body;
+-			MD5body << "";
+-			ostringstream os;
+-			os << MD5body;
+-			A2 += os.str();
++			digest_t MD5body = "md5";
++			MD5body.puts("");
++			A2 += std::string(MD5body.c_str());
+ 		}
+ 	}
+-
+ 	// RFC 2716 3.2.2.1
+ 	// Caculate digest
+-	MD5Digest MD5A1;
+-	MD5Digest MD5A2;
+-	ostringstream HA1;
+-	ostringstream HA2;
+-
+-	MD5A1 << A1;
+-	MD5A2 << A2;
+-	HA1 << MD5A1;
+-	HA2 << MD5A2;
++	digest_t MD5A1 = "md5";
++	digest_t MD5A2 = "md5";
++
++	MD5A1.puts(A1.c_str());
++	MD5A2.puts(A2.c_str());
+ 
+-	string x;
++	std::string x;
+ 
+ 	if (cmp_nocase(qop, QOP_AUTH) == 0 || cmp_nocase(qop, QOP_AUTH_INT) == 0) {
+-		x = HA1.str() + ":";
++	        x = std::string(MD5A1.c_str());
++		x += ":";
+ 		x += dchlg.nonce + ":";
+ 		x += int2str(nc, "%08x") + ":";
+ 		x += cnonce + ":";
+ 		x += qop + ":";
+-		x += HA2.str();
++		x += std::string(MD5A2.c_str());
+ 	} else {
+-		x = HA1.str() + ":";
++                x = std::string(MD5A1.c_str());
++		x += ":";
+ 		x += dchlg.nonce + ":";
+-		x += HA2.str();
++		x += std::string(MD5A2.c_str());
+ 	}
+ 
+-	MD5Digest digest;
+-	digest << x;
+-	ostringstream dresp;
+-	dresp << digest;
++	digest_t digest = "md5";
++	digest.puts(x.c_str());
+ 
+-	resp = dresp.str();
++	resp = std::string(digest.c_str());
+ 
+ 	return true;
+ }
+ 
+ bool t_request::authorize(const t_challenge &chlg, t_user *user_config,
+-	const string &username, const string &passwd, unsigned long nc,
+-	const string &cnonce, t_credentials &cr, string &fail_reason) const
++	const std::string &username, const std::string &passwd, unsigned long nc,
++	const std::string &cnonce, t_credentials &cr, std::string &fail_reason) const
+ {
+ 	// Only Digest authentication is supported
+ 	if (cmp_nocase(chlg.auth_scheme, AUTH_DIGEST) != 0) {
+@@ -271,17 +264,17 @@ bool t_request::authorize(const t_challe
+ 
+ 	const t_digest_challenge &dchlg = chlg.digest_challenge;
+ 	
+-	string qop = "";
++	std::string qop = "";
+ 
+ 	// Determine QOP
+ 	// If both auth and auth-int are supported by the server, then
+ 	// choose auth to avoid problems with SIP ALGs. A SIP ALG rewrites
+ 	// the body of a message, thereby breaking auth-int authentication.
+ 	if (!dchlg.qop_options.empty()) {
+-		const list<string>::const_iterator i = find(
++		const list<std::string>::const_iterator i = find(
+ 			dchlg.qop_options.begin(), dchlg.qop_options.end(),
+ 			QOP_AUTH_INT);
+-		const list<string>::const_iterator j = find(
++		const list<std::string>::const_iterator j = find(
+ 			dchlg.qop_options.begin(), dchlg.qop_options.end(),
+ 			QOP_AUTH);
+ 		if (j != dchlg.qop_options.end())
+@@ -297,7 +290,7 @@ bool t_request::authorize(const t_challe
+ 	}
+ 
+ 	bool ret = false;
+-	string resp;
++	std::string resp;
+ 
+ 	if (cmp_nocase(dchlg.algorithm, ALG_MD5) == 0) {
+ 		ret = authorize_md5(dchlg, username, passwd, nc, cnonce, 
+@@ -359,15 +352,15 @@ t_request::t_request(const t_method m) :
+ 	method = m;
+ }
+ 
+-void t_request::set_method(const string &s) {
++void t_request::set_method(const std::string &s) {
+ 	method = str2method(s);
+ 	if (method == METHOD_UNKNOWN) {
+ 		unknown_method = s;
+ 	}
+ }
+ 
+-string t_request::encode(bool add_content_length) {
+-	string s;
++std::string t_request::encode(bool add_content_length) {
++	std::string s;
+ 
+ 	s = method2str(method, unknown_method) + ' ' + uri.encode();
+ 	s += " SIP/";
+@@ -377,9 +370,9 @@ string t_request::encode(bool add_conten
+ 	return s;
+ }
+ 
+-list<string> t_request::encode_env(void) {
+-	string s;
+-	list<string> l = t_sip_message::encode_env();
++list<std::string> t_request::encode_env(void) {
++	std::string s;
++	list<std::string> l = t_sip_message::encode_env();
+ 	
+ 	s = "SIPREQUEST_METHOD=";
+ 	s += method2str(method, unknown_method);
+@@ -431,7 +424,7 @@ void t_request::set_route(const t_url &t
+         }
+ }
+ 
+-t_response *t_request::create_response(int code, string reason) const
++t_response *t_request::create_response(int code, std::string reason) const
+ {
+ 	t_response *r;
+ 
+@@ -458,7 +451,7 @@ t_response *t_request::create_response(i
+ 	return r;
+ }
+ 
+-bool t_request::is_valid(bool &fatal, string &reason) const {
++bool t_request::is_valid(bool &fatal, std::string &reason) const {
+ 	if (!t_sip_message::is_valid(fatal, reason)) return false;
+ 
+ 	fatal = false;
+@@ -702,8 +695,8 @@ void t_request::set_destination(const t_
+ }
+ 
+ bool t_request::www_authorize(const t_challenge &chlg, t_user *user_config, 
+-	       const string &username, const string &passwd, unsigned long nc,
+-	       const string &cnonce, t_credentials &cr, string &fail_reason)
++	       const std::string &username, const std::string &passwd, unsigned long nc,
++	       const std::string &cnonce, t_credentials &cr, std::string &fail_reason)
+ {
+ 	if (!authorize(chlg, user_config, username, passwd, nc, cnonce, cr, fail_reason)) {
+ 		return false;
+@@ -715,8 +708,8 @@ bool t_request::www_authorize(const t_ch
+ }
+ 
+ bool t_request::proxy_authorize(const t_challenge &chlg, t_user *user_config,
+-	       const string &username, const string &passwd, unsigned long nc,
+-	       const string &cnonce, t_credentials &cr, string &fail_reason)
++	       const std::string &username, const std::string &passwd, unsigned long nc,
++	       const std::string &cnonce, t_credentials &cr, std::string &fail_reason)
+ {
+ 	if (!authorize(chlg, user_config, username, passwd, nc, cnonce, cr, fail_reason)) {
+ 		return false;
+Index: twinkle-1.4.2/src/parser/sip_body.h
+===================================================================
+--- twinkle-1.4.2.orig/src/parser/sip_body.h	2009-01-03 17:54:00.000000000 +0100
++++ twinkle-1.4.2/src/parser/sip_body.h	2011-09-27 12:33:39.794913123 +0200
+@@ -20,7 +20,7 @@
+ #ifndef _H_SIP_BODY
+ #define _H_SIP_BODY
+ 
+-#include <cc++/config.h>
++#include <commoncpp/config.h>
+ #include <string>
+ #include <libxml/tree.h>
+ 
+Index: twinkle-1.4.2/src/presence/presence_dialog.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/presence/presence_dialog.cpp	2009-01-03 17:54:07.000000000 +0100
++++ twinkle-1.4.2/src/presence/presence_dialog.cpp	2011-09-27 12:33:39.849913648 +0200
+@@ -32,4 +32,5 @@ t_presence_dialog::t_presence_dialog(t_p
+ t_presence_dialog *t_presence_dialog::copy(void) {
+ 	// Copy is not needed.
+ 	assert(false);
++	return NULL;
+ }
+Index: twinkle-1.4.2/src/sdp/sdp.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/sdp/sdp.cpp	2009-01-03 17:54:03.000000000 +0100
++++ twinkle-1.4.2/src/sdp/sdp.cpp	2011-09-27 12:33:39.850913659 +0200
+@@ -37,6 +37,7 @@ string sdp_ntwk_type2str(t_sdp_ntwk_type
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_sdp_ntwk_type str2sdp_ntwk_type(string s) {
+@@ -53,6 +54,7 @@ string sdp_addr_type2str(t_sdp_addr_type
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_sdp_addr_type str2sdp_addr_type(string s) {
+@@ -69,6 +71,7 @@ string sdp_transport2str(t_sdp_transport
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_sdp_transport str2sdp_transport(string s) {
+@@ -92,6 +95,7 @@ string sdp_media_type2str(t_sdp_media_ty
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ string get_rtpmap(unsigned format, t_audio_codec codec) {
+@@ -153,6 +157,7 @@ string sdp_media_direction2str(t_sdp_med
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ ///////////////////////////////////
+Index: twinkle-1.4.2/src/sequence_number.h
+===================================================================
+--- twinkle-1.4.2.orig/src/sequence_number.h	2009-01-03 17:53:58.000000000 +0100
++++ twinkle-1.4.2/src/sequence_number.h	2011-09-27 12:33:39.850913659 +0200
+@@ -24,7 +24,6 @@
+ #ifndef _SEQUENCE_NUMBER_H
+ #define _SEQUENCE_NUMBER_H
+ 
+-#include <cc++/config.h>
+ 
+ /**
+  * Sequence numbers.
+Index: twinkle-1.4.2/src/sys_settings.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/sys_settings.cpp	2009-02-11 22:46:13.000000000 +0100
++++ twinkle-1.4.2/src/sys_settings.cpp	2011-09-27 12:33:39.851913671 +0200
+@@ -1064,7 +1064,7 @@ string t_sys_settings::about(bool html)
+ 	if (html) s += "<BR>";
+ 	s += "\n";
+ 
+-	s += "* GNU CommonC++ - http://www.gnu.org/software/commoncpp";
++	s += "* GNU uCommon C++ - http://www.gnutelephony.org/index.php/Category:Software";
+ 	if (html) s += "<BR><BR>";
+ 	s += "\n\n";
+ 	
+Index: twinkle-1.4.2/src/timekeeper.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/timekeeper.cpp	2009-01-18 15:45:26.000000000 +0100
++++ twinkle-1.4.2/src/timekeeper.cpp	2011-09-27 12:33:39.851913671 +0200
+@@ -782,4 +782,5 @@ void *timekeeper_sigwait(void *arg) {
+ 		if (sigwait(&sigset, &sig) == EINTR) continue;
+ 		evq_timekeeper->interrupt();
+ 	}
++	return NULL;
+ }
+Index: twinkle-1.4.2/src/user.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/user.cpp	2009-02-24 21:33:16.000000000 +0100
++++ twinkle-1.4.2/src/user.cpp	2011-09-27 12:33:39.852913682 +0200
+@@ -225,6 +225,7 @@ string t_user::bit_rate_type2str(t_bit_r
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_dtmf_transport t_user::str2dtmf_transport(const string &s) const {
+@@ -244,6 +245,7 @@ string t_user::dtmf_transport2str(t_dtmf
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_g726_packing t_user::str2g726_packing(const string &s) const {
+@@ -259,6 +261,7 @@ string t_user::g726_packing2str(t_g726_p
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ t_sip_transport t_user::str2sip_transport(const string &s) const {
+@@ -276,6 +279,7 @@ string t_user::sip_transport2str(t_sip_t
+ 	default:
+ 		assert(false);
+ 	}
++	return "";
+ }
+ 
+ string t_user::expand_filename(const string &filename) {
+Index: twinkle-1.4.2/src/user.h
+===================================================================
+--- twinkle-1.4.2.orig/src/user.h	2009-02-18 22:14:52.000000000 +0100
++++ twinkle-1.4.2/src/user.h	2011-09-27 12:33:39.853913692 +0200
+@@ -25,7 +25,6 @@
+ 
+ #include <string>
+ #include <list>
+-#include <cc++/config.h>
+ #include "protocol.h"
+ #include "sys_settings.h"
+ #include "audio/audio_codecs.h"
+Index: twinkle-1.4.2/src/util.h
+===================================================================
+--- twinkle-1.4.2.orig/src/util.h	2009-01-18 16:01:53.000000000 +0100
++++ twinkle-1.4.2/src/util.h	2011-09-27 12:33:39.853913692 +0200
+@@ -26,7 +26,7 @@
+ 
+ #include <vector>
+ #include <string>
+-#include <cc++/config.h>
++#include <commoncpp/config.h>
+ 
+ using namespace std;
+ 
+Index: twinkle-1.4.2/src/gui/twinkle.pro
+===================================================================
+--- twinkle-1.4.2.orig/src/gui/twinkle.pro	2009-02-25 21:14:55.000000000 +0100
++++ twinkle-1.4.2/src/gui/twinkle.pro	2011-09-27 12:33:51.309024215 +0200
+@@ -3,7 +3,7 @@ LANGUAGE	= C++
+ 
+ CONFIG	+= qt warn_on release thread
+ 
+-LIBS	+= ../libtwinkle.a ../parser/libsipparser.a ../sdp/libsdpparser.a ../sockets/libsocket.a ../threads/libthread.a ../audio/libaudio.a ../audits/libaudits.a ../stun/libstun.a ../mwi/libmwi.a ../im/libim.a ../patterns/libpatterns.a ../presence/libpresence.a ../utils/libutils.a -lsndfile -lmagic -lncurses -lreadline
++LIBS	+= ../libtwinkle.a ../parser/libsipparser.a ../sdp/libsdpparser.a ../sockets/libsocket.a ../threads/libthread.a ../audio/libaudio.a ../audits/libaudits.a ../stun/libstun.a ../mwi/libmwi.a ../im/libim.a ../patterns/libpatterns.a ../presence/libpresence.a ../utils/libutils.a -lsndfile -lmagic -lncurses -lreadline -lkio
+ 
+ DEFINES	+= QT_NO_STL
+ 
diff --git a/twinkle.desktop b/twinkle.desktop
new file mode 100644
index 0000000..65820e8
--- /dev/null
+++ b/twinkle.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Twinkle
+Comment=SIP softphone for Linux
+Comment[pl]=Programowy telefon SIP dla Linuksa
+Exec=twinkle
+Icon=twinkle
+Terminal=false
+Type=Application
+Categories=Qt;Network;InstantMessaging;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/twinkle.git/commitdiff/af377a365867f59267cbed7315c23db965c19314



More information about the pld-cvs-commit mailing list