[Pkg-owncloud-commits] [owncloud-client] 03/03: Used debian version of cmake modules
Sandro Knauß
hefee-guest at moszumanska.debian.org
Mon Feb 17 21:31:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit e354575b90940562202579386078f7f163d60af8
Author: Sandro Knauß <bugs at sandroknauss.de>
Date: Mon Feb 17 22:30:09 2014 +0100
Used debian version of cmake modules
---
debian/patches/series | 2 +
.../use_system_CheckPrototypeDefinition.cmake | 143 ++++++++++
debian/patches/use_system_FindOpenSSL.cmake | 317 +++++++++++++++++++++
3 files changed, 462 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
index 3b7c8da..b13d8d7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,5 @@
0002-create-manpage.patch
0003-respect-the-XDG_CONFIG_HOME-env-variable.patch
use_system_GNUInstallDirs.cmake
+use_system_CheckPrototypeDefinition.cmake
+use_system_FindOpenSSL.cmake
diff --git a/debian/patches/use_system_CheckPrototypeDefinition.cmake b/debian/patches/use_system_CheckPrototypeDefinition.cmake
new file mode 100644
index 0000000..6f4e9e5
--- /dev/null
+++ b/debian/patches/use_system_CheckPrototypeDefinition.cmake
@@ -0,0 +1,143 @@
+Description: use shipped version from debian
+Author: Sandro Knauß <bugs at sandroknauss.de>
+Origin: debian
+Last-Update: 2013-02-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: owncloud-client/cmake/modules/CheckPrototypeDefinition.c.in
+===================================================================
+--- owncloud-client.orig/cmake/modules/CheckPrototypeDefinition.c.in 2014-02-14 15:09:23.661700431 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,29 +0,0 @@
+- at CHECK_PROTOTYPE_DEFINITION_HEADER@
+-
+-static void cmakeRequireSymbol(int dummy, ...) {
+- (void) dummy;
+-}
+-
+-static void checkSymbol(void) {
+-#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@
+- cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@);
+-#endif
+-}
+-
+- at CHECK_PROTOTYPE_DEFINITION_PROTO@ {
+- return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
+-}
+-
+-#ifdef __CLASSIC_C__
+-int main() {
+- int ac;
+- char*av[];
+-#else
+-int main(int ac, char *av[]) {
+-#endif
+- checkSymbol();
+- if (ac > 1000) {
+- return *av[0];
+- }
+- return 0;
+-}
+Index: owncloud-client/cmake/modules/CheckPrototypeDefinition.cmake
+===================================================================
+--- owncloud-client.orig/cmake/modules/CheckPrototypeDefinition.cmake 2014-02-14 15:09:23.661700431 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,98 +0,0 @@
+-# - Check if the protoype we expect is correct.
+-# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
+-# FUNCTION - The name of the function (used to check if prototype exists)
+-# PROTOTYPE- The prototype to check.
+-# RETURN - The return value of the function.
+-# HEADER - The header files required.
+-# VARIABLE - The variable to store the result.
+-# Example:
+-# check_prototype_definition(getpwent_r
+-# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
+-# "NULL"
+-# "unistd.h;pwd.h"
+-# SOLARIS_GETPWENT_R)
+-# The following variables may be set before calling this macro to
+-# modify the way the check is run:
+-#
+-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+-# CMAKE_REQUIRED_INCLUDES = list of include directories
+-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+-
+-#=============================================================================
+-# Copyright 2005-2009 Kitware, Inc.
+-# Copyright 2010-2011 Andreas Schneider <asn at cryptomilk.org>
+-#
+-# Distributed under the OSI-approved BSD License (the "License");
+-# see accompanying file Copyright.txt for details.
+-#
+-# This software is distributed WITHOUT ANY WARRANTY; without even the
+-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-# See the License for more information.
+-#=============================================================================
+-# (To distribute this file outside of CMake, substitute the full
+-# License text for the above reference.)
+-#
+-
+-
+-get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+-
+-
+-function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
+-
+- if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
+- set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
+-
+- set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
+- if (CMAKE_REQUIRED_LIBRARIES)
+- set(CHECK_PROTOTYPE_DEFINITION_LIBS
+- LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+- else()
+- set(CHECK_PROTOTYPE_DEFINITION_LIBS)
+- endif()
+- if (CMAKE_REQUIRED_INCLUDES)
+- set(CMAKE_SYMBOL_EXISTS_INCLUDES
+- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+- else()
+- set(CMAKE_SYMBOL_EXISTS_INCLUDES)
+- endif()
+-
+- foreach(_FILE ${_HEADER})
+- set(CHECK_PROTOTYPE_DEFINITION_HEADER
+- "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
+- endforeach()
+-
+- set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
+- set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
+- set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
+-
+- configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in"
+- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
+-
+- file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
+-
+- try_compile(${_VARIABLE}
+- ${CMAKE_BINARY_DIR}
+- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
+- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+- ${CHECK_PROTOTYPE_DEFINITION_LIBS}
+- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
+- "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
+- OUTPUT_VARIABLE OUTPUT)
+-
+- if (${_VARIABLE})
+- set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
+- message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
+- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+- "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
+- "${OUTPUT}\n\n")
+- else ()
+- message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
+- set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
+- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+- "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
+- "${OUTPUT}\n\n${_SOURCE}\n\n")
+- endif ()
+- endif()
+-
+-endfunction()
diff --git a/debian/patches/use_system_FindOpenSSL.cmake b/debian/patches/use_system_FindOpenSSL.cmake
new file mode 100644
index 0000000..3786838
--- /dev/null
+++ b/debian/patches/use_system_FindOpenSSL.cmake
@@ -0,0 +1,317 @@
+Description: use shipped version from debian
+Author: Sandro Knauß <bugs at sandroknauss.de>
+Origin: debian
+Last-Update: 2013-02-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: owncloud-client/cmake/modules/FindOpenSSLCross.cmake
+===================================================================
+--- owncloud-client.orig/cmake/modules/FindOpenSSLCross.cmake 2014-02-17 22:21:28.449073247 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,306 +0,0 @@
+-# - Try to find the OpenSSL encryption library
+-# Once done this will define
+-#
+-# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
+-#
+-# Read-Only variables:
+-# OPENSSL_FOUND - system has the OpenSSL library
+-# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
+-# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
+-# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
+-
+-#=============================================================================
+-# Copyright 2006-2009 Kitware, Inc.
+-# Copyright 2006 Alexander Neundorf <neundorf at kde.org>
+-# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre at gmail.com>
+-#
+-# Distributed under the OSI-approved BSD License (the "License");
+-# see accompanying file Copyright.txt for details.
+-#
+-# This software is distributed WITHOUT ANY WARRANTY; without even the
+-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-# See the License for more information.
+-#=============================================================================
+-# (To distribute this file outside of CMake, substitute the full
+-# License text for the above reference.)
+-
+-if (UNIX)
+- find_package(PkgConfig QUIET)
+- pkg_check_modules(_OPENSSL QUIET openssl)
+-endif (UNIX)
+-
+-# http://www.slproweb.com/products/Win32OpenSSL.html
+-SET(_OPENSSL_ROOT_HINTS
+- $ENV{OPENSSL_ROOT_DIR}
+- ${OPENSSL_ROOT_DIR}
+- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+- )
+-SET(_OPENSSL_ROOT_PATHS
+- "$ENV{PROGRAMFILES}/OpenSSL"
+- "$ENV{PROGRAMFILES}/OpenSSL-Win32"
+- "$ENV{PROGRAMFILES}/OpenSSL-Win64"
+- "C:/OpenSSL/"
+- "C:/OpenSSL-Win32/"
+- "C:/OpenSSL-Win64/"
+- )
+-SET(_OPENSSL_ROOT_HINTS_AND_PATHS
+- HINTS ${_OPENSSL_ROOT_HINTS}
+- PATHS ${_OPENSSL_ROOT_PATHS}
+- )
+-
+-FIND_PATH(OPENSSL_INCLUDE_DIR
+- NAMES
+- openssl/ssl.h
+- HINTS
+- ${_OPENSSL_INCLUDEDIR}
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- include
+-)
+-
+-IF(WIN32 AND NOT CYGWIN)
+- # MINGW should go here too
+- IF(MSVC)
+- # /MD and /MDd are the standard values - if someone wants to use
+- # others, the libnames have to change here too
+- # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
+- # TODO: handle /MT and static lib
+- # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
+- # * MD for dynamic-release
+- # * MDd for dynamic-debug
+- # * MT for static-release
+- # * MTd for static-debug
+-
+- # Implementation details:
+- # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
+- # libeay32MD.lib is identical to ../libeay32.lib, and
+- # ssleay32MD.lib is identical to ../ssleay32.lib
+- FIND_LIBRARY(LIB_EAY_DEBUG
+- NAMES
+- libeay32MDd
+- libeay32
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "VC"
+- "lib/VC"
+- )
+-
+- FIND_LIBRARY(LIB_EAY_RELEASE
+- NAMES
+- libeay32MD
+- libeay32
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "VC"
+- "lib/VC"
+- )
+-
+- FIND_LIBRARY(SSL_EAY_DEBUG
+- NAMES
+- ssleay32MDd
+- ssleay32
+- ssl
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "VC"
+- "lib/VC"
+- )
+-
+- FIND_LIBRARY(SSL_EAY_RELEASE
+- NAMES
+- ssleay32MD
+- ssleay32
+- ssl
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "VC"
+- "lib/VC"
+- )
+-
+- if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+- set( OPENSSL_LIBRARIES
+- optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
+- optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
+- )
+- else()
+- set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
+- endif()
+- MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
+- MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
+- ELSEIF(MINGW)
+- # same player, for MingW
+- FIND_LIBRARY(LIB_EAY
+- NAMES
+- libeay32
+- crypto
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "lib/MinGW"
+- )
+-
+- FIND_LIBRARY(SSL_EAY
+- NAMES
+- ssleay32
+- ssl
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- "lib"
+- "lib/MinGW"
+- )
+-
+- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+- set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
+- ELSE(MSVC)
+- # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
+- FIND_LIBRARY(LIB_EAY
+- NAMES
+- libeay32
+- HINTS
+- ${_OPENSSL_LIBDIR}
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- lib
+- )
+-
+- FIND_LIBRARY(SSL_EAY
+- NAMES
+- ssleay32
+- HINTS
+- ${_OPENSSL_LIBDIR}
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- lib
+- )
+-
+- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+- set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
+- ENDIF(MSVC)
+-ELSE(WIN32 AND NOT CYGWIN)
+-
+- FIND_LIBRARY(OPENSSL_SSL_LIBRARY
+- NAMES
+- ssl
+- ssleay32
+- ssleay32MD
+- HINTS
+- ${_OPENSSL_LIBDIR}
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- lib
+- )
+-
+- FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
+- NAMES
+- crypto
+- HINTS
+- ${_OPENSSL_LIBDIR}
+- ${_OPENSSL_ROOT_HINTS_AND_PATHS}
+- PATH_SUFFIXES
+- lib
+- )
+-
+- MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
+-
+- # compat defines
+- SET(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
+- SET(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+-
+- SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
+-
+-ENDIF(WIN32 AND NOT CYGWIN)
+-
+-function(from_hex HEX DEC)
+- string(TOUPPER "${HEX}" HEX)
+- set(_res 0)
+- string(LENGTH "${HEX}" _strlen)
+-
+- while (_strlen GREATER 0)
+- math(EXPR _res "${_res} * 16")
+- string(SUBSTRING "${HEX}" 0 1 NIBBLE)
+- string(SUBSTRING "${HEX}" 1 -1 HEX)
+- if (NIBBLE STREQUAL "A")
+- math(EXPR _res "${_res} + 10")
+- elseif (NIBBLE STREQUAL "B")
+- math(EXPR _res "${_res} + 11")
+- elseif (NIBBLE STREQUAL "C")
+- math(EXPR _res "${_res} + 12")
+- elseif (NIBBLE STREQUAL "D")
+- math(EXPR _res "${_res} + 13")
+- elseif (NIBBLE STREQUAL "E")
+- math(EXPR _res "${_res} + 14")
+- elseif (NIBBLE STREQUAL "F")
+- math(EXPR _res "${_res} + 15")
+- else()
+- math(EXPR _res "${_res} + ${NIBBLE}")
+- endif()
+-
+- string(LENGTH "${HEX}" _strlen)
+- endwhile()
+-
+- set(${DEC} ${_res} PARENT_SCOPE)
+-endfunction(from_hex)
+-
+-if (OPENSSL_INCLUDE_DIR)
+- if (_OPENSSL_VERSION)
+- set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
+- elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
+- file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
+- REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
+-
+- # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
+- # The status gives if this is a developer or prerelease and is ignored here.
+- # Major, minor, and fix directly translate into the version numbers shown in
+- # the string. The patch field translates to the single character suffix that
+- # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
+- # on.
+-
+- string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
+- "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
+- list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
+- list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
+- from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
+- list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
+- from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
+- list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
+-
+- if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+- from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
+- # 96 is the ASCII code of 'a' minus 1
+- math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
+- unset(_tmp)
+- # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
+- # this should be updated to handle that, too. This has not happened yet
+- # so it is simply ignored here for now.
+- string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
+- endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+-
+- set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
+- endif (_OPENSSL_VERSION)
+-endif (OPENSSL_INCLUDE_DIR)
+-
+-include(FindPackageHandleStandardArgs)
+-
+-if (OPENSSL_VERSION)
+- find_package_handle_standard_args(OpenSSL
+- REQUIRED_VARS
+- OPENSSL_LIBRARIES
+- OPENSSL_INCLUDE_DIR
+- VERSION_VAR
+- OPENSSL_VERSION
+- FAIL_MESSAGE
+- "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
+- )
+-else (OPENSSL_VERSION)
+- find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
+- OPENSSL_LIBRARIES
+- OPENSSL_INCLUDE_DIR
+- )
+-endif (OPENSSL_VERSION)
+-
+-MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list