Skip to content

Commit

Permalink
optional dbus
Browse files Browse the repository at this point in the history
  • Loading branch information
open-license-manager committed Oct 15, 2014
1 parent fb3bb66 commit d5cfca5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Elsewhere on Internet
=====================
* Wiki :
* Project home page :

3 changes: 1 addition & 2 deletions build/modules/add_boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

Expand Down Expand Up @@ -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})
Expand Down
8 changes: 7 additions & 1 deletion src/library/os/linux/os-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
#include <dirent.h>
#include <stdio.h>

#include <dbus-1.0/dbus/dbus.h>
#include <sys/utsname.h>
#ifdef USE_DBUS
#include <dbus-1.0/dbus/dbus.h>
#endif

/**
*Usually uuid are hex number separated by "-". this method read up to 8 hex
Expand Down Expand Up @@ -277,13 +279,17 @@ 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;
}
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]) {
Expand Down

0 comments on commit d5cfca5

Please sign in to comment.