[Pkg-voip-commits] [sipsak] 17/19: Add build-system fixes sent upstream

Victor Seva vseva at moszumanska.debian.org
Wed Aug 31 09:07:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

vseva pushed a commit to branch master
in repository sipsak.

commit 56c9ca899810389d09ae23dd2efd00b54206e22d
Author: Guillem Jover <gjover at sipwise.com>
Date:   Tue Aug 30 17:00:06 2016 +0200

    Add build-system fixes sent upstream
---
 debian/changelog                                   |  8 ++
 ...Use-standard-autotools-checks-for-libruli.patch | 97 ++++++++++++++++++++++
 ...-Use-standard-autotools-checks-for-distcc.patch | 48 +++++++++++
 ...-digest-implementation-only-if-GnuTLS-is-.patch | 70 ++++++++++++++++
 ...e-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch | 28 +++++++
 .../0005-Use-automake-subdir-objects-option.patch  | 60 +++++++++++++
 ..._STRING-instead-of-deprecated-AC_HELP_STR.patch | 53 ++++++++++++
 .../patches/0007-Fix-stack-protector-check.patch   | 28 +++++++
 debian/patches/series                              |  7 ++
 9 files changed, 399 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 384db6a..5bf61e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,14 @@ sipsak (0.9.6-3) UNRELEASED; urgency=medium
   * Bump Standards-Version to 3.9.8.
   * Switch to use dh-autoreconf.
   * Enable test suite at build-time.
+  * Fix the build-system, all patches sent upstream:
+    - 0001-Use-standard-autotools-checks-for-libruli.patch
+    - 0002-Use-standard-autotools-checks-for-distcc.patch
+    - 0003-Use-OpenSSL-digest-implementation-only-if-GnuTLS-is-.patch
+    - 0004-Remove-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch
+    - 0005-Use-automake-subdir-objects-option.patch
+    - 0006-Use-AS_HELP_STRING-instead-of-deprecated-AC_HELP_STR.patch
+    - 0007-Fix-stack-protector-check.patch
 
  -- Guillem Jover <gjover at sipwise.com>  Mon, 04 Jul 2016 12:19:42 +0200
 
diff --git a/debian/patches/0001-Use-standard-autotools-checks-for-libruli.patch b/debian/patches/0001-Use-standard-autotools-checks-for-libruli.patch
new file mode 100644
index 0000000..c092808
--- /dev/null
+++ b/debian/patches/0001-Use-standard-autotools-checks-for-libruli.patch
@@ -0,0 +1,97 @@
+From f2c4f4b3689f18540382861c73215fa5d7f36aa3 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 12:23:44 +0200
+Subject: [PATCH 1/7] Use standard autotools checks for libruli
+
+Use AC_CHECK_HEADERS instead of ad-hoc checks, and AC_SEARCH_LIBS
+instead of AC_CHECK_LIB.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ configure.ac    |  6 +++++-
+ m4/acinclude.m4 | 52 ----------------------------------------------------
+ 2 files changed, 5 insertions(+), 53 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7252493..2f2c3c7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,7 +93,11 @@ PKG_CHECK_MODULES([CARES], [libcares], [
+   CFLAGS="$CFLAGS $CARES_CFLAGS"
+   AC_CHECK_HEADERS([arpa/nameser.h])
+ ], [
+-  CHECK_LIB_RULI
++  AC_CHECK_HEADERS([ruli.h], [
++    AC_SEARCH_LIBS([ruli_sync_query], [ruli], [
++      AC_DEFINE([HAVE_RULI_H], [1], [Has ruli.h])
++    ])
++  ])
+ ])
+ 
+ # FIXME: this has to replaced with a real check
+diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
+index e579799..655c978 100644
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -95,58 +95,6 @@ AC_DEFUN([SIPSAK_DBG_PRINT],
+        ])
+ ])
+ 
+-AC_DEFUN([CHECK_LIB_RULI],
+-[
+-	AC_MSG_CHECKING([for ruli.h])
+-
+-	ruli_incdir=NONE
+-	ruli_libdir=NONE
+-	ruli_incdirs="/usr/include /usr/local/include /sw/include /opt/include /opt/local/include"
+-	ruli_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib /opt/lib /opt/local/lib"
+-	ruli_libexten=".so .dylib .a"
+-
+-	for dir in $ruli_incdirs; do
+-		try="$dir/ruli.h"
+-		if test -f $try; then
+-			ruli_incdir=$dir;
+-			break;
+-		fi
+-	done
+-
+-	if test "$ruli_incdir" = "NONE"; then
+-		AC_MSG_RESULT([not found])
+-	else
+-		AC_MSG_RESULT([found at $ruli_incdir])
+-
+-		AC_MSG_CHECKING([for libruli])
+-
+-		for dir in $ruli_libdirs; do
+-			for extension in $ruli_libexten; do
+-				try="$dir/libruli$extension"
+-				if test -f $try; then
+-					ruli_libdir=$dir;
+-					break;
+-				fi
+-			done
+-			if test "$ruli_libdir" != "NONE"; then
+-				break;
+-			fi
+-		done
+-
+-		if test "$ruli_libdir" = "NONE"; then
+-			AC_MSG_RESULT([not found])
+-		else
+-			AC_MSG_RESULT([found at $ruli_libdir])
+-		fi
+-
+-		AC_CHECK_LIB(ruli, ruli_sync_query,
+-		  AC_DEFINE([HAVE_RULI_H], [1], [Has ruli.h])
+-		  LIBS="$LIBS -L$ruli_libdir -lruli"
+-		  CFLAGS="$CFLAGS -I$ruli_incdir"
+-		)
+-	fi
+-])
+-
+ AC_DEFUN([CHECK_PROG_DISTCC],
+ [
+     AC_MSG_CHECKING([for distcc])
+-- 
+2.9.3
+
diff --git a/debian/patches/0002-Use-standard-autotools-checks-for-distcc.patch b/debian/patches/0002-Use-standard-autotools-checks-for-distcc.patch
new file mode 100644
index 0000000..7a4cbc1
--- /dev/null
+++ b/debian/patches/0002-Use-standard-autotools-checks-for-distcc.patch
@@ -0,0 +1,48 @@
+From fdcc7a08b12d0f6490d01e2356d7fecd76018d08 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 12:25:01 +0200
+Subject: [PATCH 2/7] Use standard autotools checks for distcc
+
+Use AC_CHECK_PROG instead of an ad-hoc list of directories and manual
+checks.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ m4/acinclude.m4 | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
+index 655c978..a990e28 100644
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -97,24 +97,12 @@ AC_DEFUN([SIPSAK_DBG_PRINT],
+ 
+ AC_DEFUN([CHECK_PROG_DISTCC],
+ [
+-    AC_MSG_CHECKING([for distcc])
++    AC_MSG_CHECKING([whether to use distcc])
+     AC_ARG_ENABLE([distcc],
+         AC_HELP_STRING([--enable-distcc], [compile in parallel with distcc]),
+         [
+-			distcc_dirs="/ /usr /usr/local /usr/local/gnu /usr/gnu /opt /opt/local"
+-            for dir in $distcc_dirs; do
+-                if test -x "$dir/bin/distcc"; then
+-                    found_distcc=yes;
+-                    DISTCC="$dir/bin/distcc"
+-                    break;
+-                fi
+-            done
+-            if test x_$found_distcc != x_yes; then
+-                AC_MSG_ERROR([not found])
+-            else
+-                AC_MSG_RESULT([yes])
+-                AC_SUBST([DISTCC])
+-            fi
++          AC_MSG_RESULT([yes])
++          AC_CHECK_PROG([DISTCC], [distcc])
+         ],
+         [ AC_MSG_RESULT([not requested])
+         ])
+-- 
+2.9.3
+
diff --git a/debian/patches/0003-Use-OpenSSL-digest-implementation-only-if-GnuTLS-is-.patch b/debian/patches/0003-Use-OpenSSL-digest-implementation-only-if-GnuTLS-is-.patch
new file mode 100644
index 0000000..7215459
--- /dev/null
+++ b/debian/patches/0003-Use-OpenSSL-digest-implementation-only-if-GnuTLS-is-.patch
@@ -0,0 +1,70 @@
+From 63676e50da19b3a23ec35509f32fe1f48eaba1f0 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 12:36:42 +0200
+Subject: [PATCH 3/7] Use OpenSSL digest implementation only if GnuTLS is not
+ available
+
+The code is checking for the wrong _LIBS variable, so it will always
+check for OpenSSL's MD5 implementation. Move both MD5 and SHA1 checks
+on the ACTION-IF-NOT-FOUND block of the GnuTLS check.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ configure.ac | 32 +++++++++++++-------------------
+ 1 file changed, 13 insertions(+), 19 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2f2c3c7..8b23c9c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -59,34 +59,28 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], [
+   ], []
+ )
+ 
+-
+ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 1.0.0], [
+     AC_DEFINE([HAVE_GNUTLS], [1], [Has gnutls >= 1.0.0])
+     LIBS="${LIBS} ${GNUTLS_LIBS}"
+     CFLAGS="${CFLAGS} ${GNUTLS_CFLAGS}"
+-  ], []
+-)
++  ], [
++    AC_CHECK_HEADERS([openssl/md5.h], [
++      AC_SEARCH_LIBS([MD5_Init], [crypto], [
++        AC_DEFINE([HAVE_CRYPTO_WITH_MD5], [1], [The crypto lib has MD5 functions])
++      ])
++    ])
++
++    AC_CHECK_HEADERS([openssl/sha.h], [
++      AC_SEARCH_LIBS([SHA1_Init], [crypto], [
++        AC_DEFINE([HAVE_CRYPTO_WITH_SHA1], [1], [The crpyto lib has SHA1 functions])
++      ])
++    ])
++])
+ PKG_CHECK_MODULES([GNUTLS319], [gnutls >= 3.1.9], [
+     AC_DEFINE([HAVE_GNUTLS_319], [1], [Has gntuls >= 3.1.9])
+   ], []
+ )
+ 
+-if test "X$GNUTLS_LIBS" = "X";then
+-  AC_CHECK_HEADERS([openssl/md5.h],
+-    AC_CHECK_LIB(crypto, MD5_Init,
+-    AC_DEFINE([HAVE_CRYPTO_WITH_MD5], [1], [The crypto lib has MD5 functions])
+-      LIBS="$LIBS -lcrypto"
+-    )
+-  )
+-fi
+-
+-AC_CHECK_HEADERS([openssl/sha.h],
+-  AC_CHECK_LIB(crypto, SHA1_Init,
+-    AC_DEFINE([HAVE_CRYPTO_WITH_SHA1], [1], [The crpyto lib has SHA1 functions])
+-    LIBS="$LIBS -lcrypto"
+-  )
+-)
+-
+ PKG_CHECK_MODULES([CARES], [libcares], [
+   AC_DEFINE([HAVE_CARES_H], [1], [Has cares.h])
+   LIBS="$LIBS $CARES_LIBS"
+-- 
+2.9.3
+
diff --git a/debian/patches/0004-Remove-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch b/debian/patches/0004-Remove-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch
new file mode 100644
index 0000000..eec2f41
--- /dev/null
+++ b/debian/patches/0004-Remove-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch
@@ -0,0 +1,28 @@
+From 3b92e1b6a0c03f80d968f1b7190d7f12bbba0497 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 12:39:09 +0200
+Subject: [PATCH 4/7] Remove unnecessary call to PKG_PROG_PKG_CONFIG
+
+This is only needed if the calls to PKG_CHECK_MODULES are behind
+conditionals. Otherwise that macro already AC_REQUIREs the other.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8b23c9c..5fd281b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -51,7 +51,6 @@ AC_FUNC_MALLOC
+ AC_FUNC_SELECT_ARGTYPES
+ AC_CHECK_FUNCS([getchar gethostbyname gethostname getopt getpid gettimeofday memset ntohs regcomp select socket strchr strcmp strstr strtol uname],,[AC_MSG_ERROR([missing required function (see above)])])
+ AC_CHECK_FUNCS([calloc getdomainname getopt_long inet_ntop strncasecmp strcasestr syslog])
+-PKG_PROG_PKG_CONFIG()
+ 
+ # Check if the check unit test framework is available
+ PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], [
+-- 
+2.9.3
+
diff --git a/debian/patches/0005-Use-automake-subdir-objects-option.patch b/debian/patches/0005-Use-automake-subdir-objects-option.patch
new file mode 100644
index 0000000..db4ab40
--- /dev/null
+++ b/debian/patches/0005-Use-automake-subdir-objects-option.patch
@@ -0,0 +1,60 @@
+From 683be4f6459fad2602ace5dbcb2f0bedcdada801 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 13:10:17 +0200
+Subject: [PATCH 5/7] Use automake subdir-objects option
+
+Newer automake complain whenever there are subdirectories compiling code
+from other directories. With this option we make sure the objects are
+stored on the current build directory and do not interfere with the ones
+they are coming from.
+
+Use relative paths in _SOURCES, because automake does not cope well with
+variables there.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ .gitignore        | 1 +
+ configure.ac      | 2 +-
+ tests/Makefile.am | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/.gitignore b/.gitignore
+index 0b77e5d..37caad1 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,6 +1,7 @@
+ # Autotools
+ *~
+ .deps/
++.dirstamp
+ INSTALL
+ Makefile
+ Makefile.in
+diff --git a/configure.ac b/configure.ac
+index 7252493..fdaddb3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,7 +3,7 @@
+ 
+ AC_PREREQ(2.59)
+ AC_INIT([sipsak],[0.9.7pre],[nils at sipsak.org])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([subdir-objects])
+ AM_MAINTAINER_MODE
+ AC_CONFIG_SRCDIR([sipsak.c])
+ AC_CONFIG_HEADER([config.h])
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 5d9456c..f048bad 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -2,6 +2,6 @@ TESTS = check_helper
+ 
+ check_PROGRAMS = check_helper
+ 
+-check_helper_SOURCES = check_helper.c $(top_srcdir)/helper.h $(top_srcdir)/helper.c $(top_srcdir)/exit_code.h $(top_srcdir)/exit_code.c
++check_helper_SOURCES = check_helper.c ../helper.h ../helper.c ../exit_code.h ../exit_code.c
+ check_helper_CFLAGS = @CHECK_CFLAGS@ -DRUNNING_CHECK
+ check_helper_LDADD = @CHECK_LIBS@
+-- 
+2.9.3
+
diff --git a/debian/patches/0006-Use-AS_HELP_STRING-instead-of-deprecated-AC_HELP_STR.patch b/debian/patches/0006-Use-AS_HELP_STRING-instead-of-deprecated-AC_HELP_STR.patch
new file mode 100644
index 0000000..b3dba33
--- /dev/null
+++ b/debian/patches/0006-Use-AS_HELP_STRING-instead-of-deprecated-AC_HELP_STR.patch
@@ -0,0 +1,53 @@
+From 556170fc4193b7b4697fac9f3fc80a069c02fde0 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Wed, 6 Jul 2016 13:12:14 +0200
+Subject: [PATCH 6/7] Use AS_HELP_STRING instead of deprecated AC_HELP_STRING
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ m4/acinclude.m4 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
+index a990e28..04c44bd 100644
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -60,7 +60,7 @@ AC_DEFUN([SIPSAK_OLD_FQDN],
+ [
+     AC_MSG_CHECKING([oldstyle numeric])
+     AC_ARG_ENABLE([ips],
+-       AC_HELP_STRING([--disbale-ips], [compile with oldstyle --numeric behavior]),
++       AS_HELP_STRING([--disbale-ips], [compile with oldstyle --numeric behavior]),
+        [
+         AC_MSG_RESULT([yes])
+         AC_DEFINE([OLDSTYLE_FQDN], [1], [Oldstyle FQDN behavior])
+@@ -73,7 +73,7 @@ AC_DEFUN([SIPSAK_TLS],
+ [
+     AC_MSG_CHECKING([disable TLS])
+     AC_ARG_ENABLE([tls],
+-       AC_HELP_STRING([--disable-tls], [compile without TLS transport]),
++       AS_HELP_STRING([--disable-tls], [compile without TLS transport]),
+        [
+         AC_MSG_RESULT([yes])
+         AC_DEFINE([SIPSAK_NO_TLS], [1], [Skip TLS transport])
+@@ -86,7 +86,7 @@ AC_DEFUN([SIPSAK_DBG_PRINT],
+ [
+     AC_MSG_CHECKING([enable debug messages])
+     AC_ARG_ENABLE([debug],
+-       AC_HELP_STRING([--enable-debug], [compile extra debug messages]),
++       AS_HELP_STRING([--enable-debug], [compile extra debug messages]),
+        [
+         AC_MSG_RESULT([yes])
+         AC_DEFINE([SIPSAK_PRINT_DBG], [1], [Enable debug messages])
+@@ -99,7 +99,7 @@ AC_DEFUN([CHECK_PROG_DISTCC],
+ [
+     AC_MSG_CHECKING([whether to use distcc])
+     AC_ARG_ENABLE([distcc],
+-        AC_HELP_STRING([--enable-distcc], [compile in parallel with distcc]),
++        AS_HELP_STRING([--enable-distcc], [compile in parallel with distcc]),
+         [
+           AC_MSG_RESULT([yes])
+           AC_CHECK_PROG([DISTCC], [distcc])
+-- 
+2.9.3
+
diff --git a/debian/patches/0007-Fix-stack-protector-check.patch b/debian/patches/0007-Fix-stack-protector-check.patch
new file mode 100644
index 0000000..1b7c551
--- /dev/null
+++ b/debian/patches/0007-Fix-stack-protector-check.patch
@@ -0,0 +1,28 @@
+From c241023446041e5d18e399030a1ee5c35069ff2a Mon Sep 17 00:00:00 2001
+From: Guillem Jover <gjover at sipwise.com>
+Date: Tue, 30 Aug 2016 16:04:43 +0200
+Subject: [PATCH 7/7] Fix stack-protector check
+
+Fixes #21.
+
+Signed-off-by: Guillem Jover <gjover at sipwise.com>
+---
+ m4/acinclude.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
+index 04c44bd..8c32d9a 100644
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -134,7 +134,7 @@ AC_DEFUN([SIPSAK_GCC_STACK_PROTECT_CC],[
+     AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
+     ssp_old_cflags="$CFLAGS"
+     CFLAGS="$CFLAGS -fstack-protector"
+-    AC_COMPILE_IFELSE(,,, ssp_cc=no)
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [], [], [ssp_cc=no])
+     AC_MSG_RESULT([$ssp_cc])
+     if test "X$ssp_cc" = "Xno"; then
+       CFLAGS="$ssp_old_cflags"
+-- 
+2.9.3
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..67c8a4f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,7 @@
+0001-Use-standard-autotools-checks-for-libruli.patch
+0002-Use-standard-autotools-checks-for-distcc.patch
+0003-Use-OpenSSL-digest-implementation-only-if-GnuTLS-is-.patch
+0004-Remove-unnecessary-call-to-PKG_PROG_PKG_CONFIG.patch
+0005-Use-automake-subdir-objects-option.patch
+0006-Use-AS_HELP_STRING-instead-of-deprecated-AC_HELP_STR.patch
+0007-Fix-stack-protector-check.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/sipsak.git



More information about the Pkg-voip-commits mailing list