From d5cfca5d6eae5fdc99f04e50c19b12e1803ca90b Mon Sep 17 00:00:00 2001 From: open-license-manager Date: Wed, 15 Oct 2014 18:55:25 +0000 Subject: [PATCH] optional dbus --- .travis.yml | 2 +- CMakeLists.txt | 11 +++++---- README.md | 40 ++++++++++++++++++++++++--------- build/modules/add_boost.cmake | 3 +-- src/library/os/linux/os-linux.c | 8 ++++++- 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb25dbb7..755125fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake - sudo apt-get update -qq - - sudo apt-get install cmake doxygen + - sudo apt-get install cmake doxygen > /dev/null - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; echo "+++GCC4.8"; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2703b1..c54b3010 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,10 +81,13 @@ if(NOT WIN32) find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) - FIND_PACKAGE(Dbus REQUIRED) - include_directories(${DBUS_INCLUDE_DIR}) - include_directories(${DBUS_ARCH_INCLUDE_DIR}) - list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) + if(USE_DBUS_IDENTIFIER) + FIND_PACKAGE(Dbus REQUIRED) + add_definitions(-DUSE_DBUS) + include_directories(${DBUS_INCLUDE_DIR}) + include_directories(${DBUS_ARCH_INCLUDE_DIR}) + list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) + endif(USE_DBUS_IDENTIFIER) list(APPEND EXTERNAL_LIBS dl) endif(NOT WIN32) diff --git a/README.md b/README.md index b90e7ccf..248bcbda 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,33 @@ -license-manager-cpp +open-license-manager =================== +![Build Status](https://travis-ci.org/open-license-manager/open-license-manager.png "Build Status") -A lincense manager written in C++ +A lincense manager written in C/C++ for Windows and Linux environments. -Linux -=================== +It allows to protect the software you develop from unauthorized copies, +limit the usage in time, to a specific set of machines, or prevent the usage in +virtualized environments. + +The software is made by 2 main sub-components: + * a C library with no external dependencies (the part you have to integrate in your software). + * a license generator written in C++ (allows you to generate a license). + +these are planned.... + * a license backoffice in php (in order to handle multiple licenses). + * a license debugger to be sent to the final customer when there are licensing problems. + * a log decriptor in order to decript logs generated by the license system. + +You can notice 2 more sub-projects: + * bootstrap: allows to generate private keys and modify the library on the fly after the downloading. + * testing : runs the tests (and publish the results on cdash) + +Licensing +===================== +The project comes out with a very large freedom of use for everyone (and it will always be). +It uses a BSD 3 clauses licensing schema. -apt-get install -libboost-dev libboost-filesystem-dev -libboost-program-options-dev libboost-test-dev libboost-date-time-dev -libssl-dev? -libdbus-1-dev -#libcrypto++dev (version 5.6.1) -openssl genrsa -out src/license-generator/privkey.pem 2048 \ No newline at end of file +Elsewhere on Internet +===================== + * Wiki : + * Project home page : + \ No newline at end of file diff --git a/build/modules/add_boost.cmake b/build/modules/add_boost.cmake index 7292f5bc..5498d9ef 100644 --- a/build/modules/add_boost.cmake +++ b/build/modules/add_boost.cmake @@ -100,10 +100,10 @@ function(add_boost) if(NOT EXISTS ${ZipFilePath}) message(STATUS "Downloading boost ${BoostVersion} to ${BoostCacheDir}") endif() + #SHOW_PROGRESS file(DOWNLOAD http://sourceforge.net/projects/boost/files/boost/${BoostVersion}/${BoostFolderName}.tar.bz2/download ${ZipFilePath} STATUS Status - SHOW_PROGRESS EXPECTED_HASH SHA1=${BoostSHA1} ) @@ -220,7 +220,6 @@ function(add_boost) elseif(UNIX) list(APPEND b2Args variant=release cxxflags=-fPIC cxxflags=-std=c++11 -sNO_BZIP2=1 --layout=tagged) # Need to configure the toolset based on whatever version CMAKE_CXX_COMPILER is - message(STATUS "cmake compiler version ${CMAKE_CXX_COMPILER_VERSION}") string(REGEX MATCH "[0-9]+\\.[0-9]+" ToolsetVer "${CMAKE_CXX_COMPILER_VERSION}") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") list(APPEND b2Args toolset=clang-${ToolsetVer}) diff --git a/src/library/os/linux/os-linux.c b/src/library/os/linux/os-linux.c index 7469d832..79ec0e5e 100644 --- a/src/library/os/linux/os-linux.c +++ b/src/library/os/linux/os-linux.c @@ -25,8 +25,10 @@ #include #include -#include #include +#ifdef USE_DBUS +#include +#endif /** *Usually uuid are hex number separated by "-". this method read up to 8 hex @@ -277,6 +279,7 @@ FUNCTION_RETURN getMachineName(unsigned char identifier[6]) { } FUNCTION_RETURN getOsSpecificIdentifier(unsigned char identifier[6]) { +#if USE_DBUS char* dbus_id = dbus_get_local_machine_id(); if (dbus_id == NULL) { return FUNC_RET_ERROR; @@ -284,6 +287,9 @@ FUNCTION_RETURN getOsSpecificIdentifier(unsigned char identifier[6]) { memcpy(identifier, dbus_id, 6); dbus_free(dbus_id); return FUNC_RET_OK; +#else + return FUNC_RET_NOT_AVAIL; +#endif } FUNCTION_RETURN getModuleName(char buffer[MAX_PATH]) {