From f4ab9bf9e847aac46433271f3ba6c7b748aa282e Mon Sep 17 00:00:00 2001 From: Federico Fuga Date: Thu, 13 Jan 2022 18:48:38 +0100 Subject: [PATCH 1/5] Fix #311, removed unnecessary check for CMAKE_BUILD_TYPE The check for Release or Debug in CMAKE_BUILD_TYPE breaks some assumption in Debian packaging. Since the check is useless, it has been removed. Also fix some PUBLIC/PRIVATE mistake in target_include_directories to correctly pass the properties to client code. --- CMakeLists.txt | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78293cd3..e4a55148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,25 +1,22 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR) -PROJECT(sioclient) +PROJECT(sioclient + VERSION 3.1.0 + ) option(BUILD_SHARED_LIBS "Build the shared library" OFF) -option(BUILD_UNIT_TESTS "Builds unit tests target" OFF) +option(BUILD_UNIT_TESTS "Builds unit tests target" OFF) -set(MAJOR 1) -set(MINOR 6) -set(PATCH 0) - -if(NOT CMAKE_BUILD_TYPE ) -MESSAGE(STATUS "not define build type, set to release" ) -set(CMAKE_BUILD_TYPE Release ) -elseif(NOT (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )) -MESSAGE(SEND_ERROR "CMAKE_BUILD_TYPE must be either Release or Debug") -return() -endif() +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/asio/asio/README) + message("Updating submodules") + execute_process( + COMMAND git submodule update --init + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +endif () aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src ALL_SRC) aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/internal ALL_SRC) -file(GLOB ALL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/*.h ) -set(SIO_INCLUDEDIR ${CMAKE_CURRENT_LIST_DIR}) + +file(GLOB ALL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/*.h) add_definitions( # These will force ASIO to compile without Boost @@ -32,10 +29,10 @@ add_definitions( ) add_library(sioclient ${ALL_SRC}) -target_include_directories(sioclient PUBLIC +target_include_directories(sioclient PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src PRIVATE - ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp + ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp ${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include ${CMAKE_CURRENT_LIST_DIR}/lib/asio/asio/include ) @@ -61,7 +58,7 @@ add_library(sioclient_tls ${ALL_SRC}) target_include_directories(sioclient_tls PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src PRIVATE - ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp + ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp ${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include ${CMAKE_CURRENT_LIST_DIR}/lib/asio/asio/include ${OPENSSL_INCLUDE_DIR} From 44e5c5b778e5b46029ba15ce6bc3096c55636ea4 Mon Sep 17 00:00:00 2001 From: Federico Fuga Date: Thu, 13 Jan 2022 10:37:37 +0100 Subject: [PATCH 2/5] Add files under debian/ necessary to build .deb packages --- debian/README.Debian | 6 ++++ debian/README.source | 10 +++++++ debian/changelog | 5 ++++ debian/control | 18 +++++++++++ debian/copyright | 40 +++++++++++++++++++++++++ debian/rules | 20 +++++++++++++ debian/socket.io-client-cpp-dev.dirs | 2 ++ debian/socket.io-client-cpp-dev.install | 0 debian/socket.io-client-cpp-docs.docs | 2 ++ debian/source/format | 1 + 10 files changed, 104 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/socket.io-client-cpp-dev.dirs create mode 100644 debian/socket.io-client-cpp-dev.install create mode 100644 debian/socket.io-client-cpp-docs.docs create mode 100644 debian/source/format diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 00000000..70e3ef81 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +socket.io-client-cpp for Debian +------------------------------ + + + + -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 00000000..ecc1fd01 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,10 @@ +socket.io-client-cpp for Debian +------------------------------ + + + + + + -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..7e4957c2 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +socket.io-client-cpp (3.1.0-1) unstable; urgency=medium + + * Initial porting of project to Debian + + -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..460e5da4 --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: socket.io-client-cpp +Priority: optional +Maintainer: Federico Fuga +Build-Depends: debhelper-compat (= 12) +Standards-Version: 4.4.1 +Section: libs +Homepage: https://github.com/socketio/socket.io-client-cpp +#Vcs-Browser: https://salsa.debian.org/debian/socket.io-client-cpp +#Vcs-Git: https://salsa.debian.org/debian/socket.io-client-cpp.git + +Package: socket.io-client-cpp-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends} +Description: Development files for the Socket.io-client-cpp library, a C++11 library for Socket.io + Socket.IO is a bidirectional and low-latency communication for every platform. + This package contains the development files for a C++11 client library. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..3c3eec7a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,40 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: socket.io-client-cpp +Upstream-Contact: +Source: https://github.com/socketio/socket.io-client-cpp + +Files: * +Copyright: Copyright (c) 2015, Melo Yao +License: MIT + +Files: debian/* +Copyright: 2022 Federico Fuga +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. +# +# If you need, there are some extra license texts available in two places: +# /usr/share/debhelper/dh_make/licenses/ +# /usr/share/common-licenses/ diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..d7ce6f70 --- /dev/null +++ b/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_BUILD_TYPE=Release diff --git a/debian/socket.io-client-cpp-dev.dirs b/debian/socket.io-client-cpp-dev.dirs new file mode 100644 index 00000000..44188162 --- /dev/null +++ b/debian/socket.io-client-cpp-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/socket.io-client-cpp-dev.install b/debian/socket.io-client-cpp-dev.install new file mode 100644 index 00000000..e69de29b diff --git a/debian/socket.io-client-cpp-docs.docs b/debian/socket.io-client-cpp-docs.docs new file mode 100644 index 00000000..73190411 --- /dev/null +++ b/debian/socket.io-client-cpp-docs.docs @@ -0,0 +1,2 @@ +README.source +README.Debian diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) From 61de121ee9adf3c77faa357baea57524d449b437 Mon Sep 17 00:00:00 2001 From: Federico Fuga Date: Thu, 13 Jan 2022 11:11:11 +0100 Subject: [PATCH 3/5] Fix debian files for native building --- debian/README.Debian | 3 ++- debian/README.source | 10 ---------- debian/changelog | 2 +- debian/control | 2 +- debian/copyright | 9 --------- debian/source/format | 2 +- 6 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 debian/README.source diff --git a/debian/README.Debian b/debian/README.Debian index 70e3ef81..39be9523 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -1,6 +1,7 @@ socket.io-client-cpp for Debian ------------------------------ - +The source of this library is managed through git, and depends on a few submodules. +This porting includes all those modules, that are statically linked. -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index ecc1fd01..00000000 --- a/debian/README.source +++ /dev/null @@ -1,10 +0,0 @@ -socket.io-client-cpp for Debian ------------------------------- - - - - - - -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 - diff --git a/debian/changelog b/debian/changelog index 7e4957c2..f5eece2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,4 +2,4 @@ socket.io-client-cpp (3.1.0-1) unstable; urgency=medium * Initial porting of project to Debian - -- Federico Fuga Wed, 12 Jan 2022 16:18:30 +0100 + -- Federico Fuga Thu, 13 Jan 2022 11:03:37 +0100 diff --git a/debian/control b/debian/control index 460e5da4..1a79f260 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,6 @@ Section: libdevel Architecture: any Multi-Arch: same Depends: ${misc:Depends} -Description: Development files for the Socket.io-client-cpp library, a C++11 library for Socket.io +Description: Development files for the Socket.io-client-cpp library Socket.IO is a bidirectional and low-latency communication for every platform. This package contains the development files for a C++11 client library. diff --git a/debian/copyright b/debian/copyright index 3c3eec7a..e60169d0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -29,12 +29,3 @@ License: MIT CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. -# Please avoid picking licenses with terms that are more restrictive than the -# packaged work, as it may make Debian's contributions unacceptable upstream. -# -# If you need, there are some extra license texts available in two places: -# /usr/share/debhelper/dh_make/licenses/ -# /usr/share/common-licenses/ diff --git a/debian/source/format b/debian/source/format index 163aaf8d..89ae9db8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) From d2395caaedcffb50dac060c8f55e5a9bcff7a791 Mon Sep 17 00:00:00 2001 From: Federico Fuga Date: Thu, 13 Jan 2022 12:14:29 +0100 Subject: [PATCH 4/5] Automatically clone submodules if asio/asio/README is not present --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4a55148..ded75cc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,13 @@ if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/asio/asio/README) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) endif () +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/asio/asio/README) + message("Updating submodules") + execute_process( + COMMAND git submodule update --init + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +endif() + aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src ALL_SRC) aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/internal ALL_SRC) From 6c12bed4047de8c5dfc1ee800ed56541d5d440e0 Mon Sep 17 00:00:00 2001 From: Federico Fuga Date: Thu, 13 Jan 2022 19:06:39 +0100 Subject: [PATCH 5/5] Debian package: Remove workaround due to Issue #311 --- debian/rules | 4 ---- 1 file changed, 4 deletions(-) diff --git a/debian/rules b/debian/rules index d7ce6f70..f1415823 100755 --- a/debian/rules +++ b/debian/rules @@ -14,7 +14,3 @@ %: dh $@ - -override_dh_auto_configure: - dh_auto_configure -- \ - -DCMAKE_BUILD_TYPE=Release