From 1e3ec2d0f6adc6ddfce386986951f0901392db34 Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Thu, 12 Sep 2013 13:51:12 +0900 Subject: [PATCH] code cleanup and fix build problems Change-Id: Iadd55f6faa0a33fe020693df1e450d4aaa9d7a5a --- CMakeLists.txt | 46 +++++-- client/CMakeLists.txt | 72 +++------- client/ClientChannel.cpp | 8 -- client/Reader.cpp | 8 -- client/SEService.cpp | 2 - client/include/ClientChannel.h | 6 +- client/include/Reader.h | 4 + client/include/SEService.h | 9 +- client/include/Session.h | 4 + client/smartcard-service.pc | 13 -- client/smartcard-service.pc.in | 11 ++ common/CMakeLists.txt | 66 +++------ common/GPARFACL.cpp | 1 + common/include/APDUHelper.h | 6 +- common/include/ByteArray.h | 7 +- common/include/Debug.h | 4 + common/include/FileObject.h | 2 +- common/include/GDBusHelper.h | 2 +- common/include/GPACE.h | 2 +- common/include/PKCS15.h | 2 +- common/include/SignatureHelper.h | 2 +- common/include/Synchronous.h | 7 +- common/smartcard-service-common.pc | 13 -- common/smartcard-service-common.pc.in | 11 ++ debian/changelog | 55 -------- debian/compat | 1 - debian/control | 65 --------- debian/rules | 33 ----- debian/smartcard-service-common-dev.dirs | 2 - debian/smartcard-service-common-dev.install | 5 - debian/smartcard-service-common.dirs | 1 - debian/smartcard-service-common.install | 1 - debian/smartcard-service-dev.dirs | 2 - debian/smartcard-service-dev.install | 5 - debian/smartcard-service-server.dirs | 2 - debian/smartcard-service-server.init | 28 ---- debian/smartcard-service-server.install | 2 - debian/smartcard-service.dirs | 1 - debian/smartcard-service.install | 1 - packaging/smartcard-service | 206 ---------------------------- packaging/smartcard-service-common | 206 ---------------------------- packaging/smartcard-service-server | 206 ---------------------------- packaging/smartcard-service.spec | 68 +++++---- server/CMakeLists.txt | 55 ++------ server/ServerGDBus.cpp | 11 +- server/smartcard-daemon.cpp | 6 - smartcard-service-common-devel.manifest | 6 - smartcard-service-common.manifest | 6 - smartcard-service-devel.manifest | 6 - smartcard-service-server.manifest | 17 --- smartcard-service.manifest | 6 - test-client/CMakeLists.txt | 39 +----- 52 files changed, 177 insertions(+), 1173 deletions(-) delete mode 100644 client/smartcard-service.pc create mode 100644 client/smartcard-service.pc.in delete mode 100644 common/smartcard-service-common.pc create mode 100644 common/smartcard-service-common.pc.in delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100755 debian/rules delete mode 100644 debian/smartcard-service-common-dev.dirs delete mode 100644 debian/smartcard-service-common-dev.install delete mode 100644 debian/smartcard-service-common.dirs delete mode 100644 debian/smartcard-service-common.install delete mode 100644 debian/smartcard-service-dev.dirs delete mode 100644 debian/smartcard-service-dev.install delete mode 100644 debian/smartcard-service-server.dirs delete mode 100755 debian/smartcard-service-server.init delete mode 100644 debian/smartcard-service-server.install delete mode 100644 debian/smartcard-service.dirs delete mode 100644 debian/smartcard-service.install delete mode 100644 packaging/smartcard-service delete mode 100644 packaging/smartcard-service-common delete mode 100644 packaging/smartcard-service-server delete mode 100644 smartcard-service-common-devel.manifest delete mode 100644 smartcard-service-common.manifest delete mode 100644 smartcard-service-devel.manifest delete mode 100644 smartcard-service-server.manifest delete mode 100644 smartcard-service.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index f391106..6e59a80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,28 +1,44 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(smartcard-service CXX C) MESSAGE("build smartcard-service") -SET(CMAKE_VERBOSE_MAKEFILE OFF) +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") -# apply smack -ADD_DEFINITIONS("-DUSER_SPACE_SMACK") +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + +INCLUDE(FindPkgConfig) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + +SET(CMAKE_SHARED_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}") +SET(CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}") +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" MATCHES "^arm.*") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mabi=aapcs-linux -fno-common") +ENDIF("${ARCH}" MATCHES "^arm.*") + +# names +SET(CLIENT_LIB ${PROJECT_NAME}) +SET(COMMON_LIB "smartcard-service-common") +SET(DAEMON "smartcard-daemon") + +# For *.pc files +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +# Defines IF(DEFINED USE_AUTOSTART) ADD_DEFINITIONS("-DUSE_AUTOSTART") ENDIF() -SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GC_SECTIONS_FLAGS}") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GC_SECTIONS_FLAGS}") - -FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen) -EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS - " \\ - --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/common/smartcard-service-gdbus \\ - --c-namespace SmartcardService\\ - --interface-prefix org.tizen.SmartcardService. \\ - ${CMAKE_CURRENT_SOURCE_DIR}/common/smartcard-service-gdbus.xml \\ - ") +# apply smack +##ADD_DEFINITIONS("-DUSER_SPACE_SMACK") ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(client) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 08b52c6..d00cf10 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -1,67 +1,24 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(smartcard-service CXX) - -SET(LIB_NAME "smartcard-service") -SET(VERSION_MAJOR 1) -SET(VERSION ${VERSION_MAJOR}.0.0) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../server/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/include) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS) -IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Release") -ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") -MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") - -# pkg config -INCLUDE(FindPkgConfig) - -SET(PKG_MODULE glib-2.0 dlog) - -pkg_check_modules(pkgs_client REQUIRED ${PKG_MODULE}) - -MESSAGE("${LIB_NAME} ld flag : ${pkgs_client_LDFLAGS}") - +pkg_check_modules(pkgs_client REQUIRED glib-2.0 dlog) FOREACH(flag ${pkgs_client_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -finstrument-functions") -#SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") -#SET(CMAKE_C_FLAGS_RELEASE "-O2") - -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -finstrument-functions -std=c++0x") -#SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -#SET(CMAKE_CXX_FLAGS_RELEASE "-O2") - -FIND_PROGRAM(UNAME NAMES uname) -EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - -MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS("-DSLP_DEBUG") ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_CLIENT\"") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - -ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) +ADD_LIBRARY(${CLIENT_LIB} SHARED ${SRCS}) +SET_TARGET_PROPERTIES(${CLIENT_LIB} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER}) +TARGET_LINK_LIBRARIES(${CLIENT_LIB} ${pkgs_client_LDFLAGS}) -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${VERSION}) - -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_client_LDFLAGS}) - -SET(EXPORT_HEADER +SET(EXPORT_HEADER ../common/include/smartcard-types.h ../common/include/ByteArray.h ../common/include/Debug.h @@ -84,8 +41,11 @@ SET(EXPORT_HEADER # include/ ) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) +CONFIGURE_FILE(${CLIENT_LIB}.pc.in ${CLIENT_LIB}.pc @ONLY) + +INSTALL(FILES ${CLIENT_LIB}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +INSTALL(TARGETS ${CLIENT_LIB} DESTINATION ${LIB_INSTALL_DIR}) + FOREACH(hfile ${EXPORT_HEADER}) - INSTALL(FILES ${hfile} DESTINATION include/${LIB_NAME}) + INSTALL(FILES ${hfile} DESTINATION include/${CLIENT_LIB}) ENDFOREACH(hfile) diff --git a/client/ClientChannel.cpp b/client/ClientChannel.cpp index 3a5a6d7..596d044 100644 --- a/client/ClientChannel.cpp +++ b/client/ClientChannel.cpp @@ -55,14 +55,6 @@ namespace smartcard_service_api this->selectResponse = selectResponse; this->context = context; - /* initialize client */ - if (!g_thread_supported()) - { - g_thread_init(NULL); - } - - g_type_init(); - /* init default context */ GError *error = NULL; diff --git a/client/Reader.cpp b/client/Reader.cpp index 4a8b78c..f4260ee 100644 --- a/client/Reader.cpp +++ b/client/Reader.cpp @@ -45,14 +45,6 @@ namespace smartcard_service_api return; } - /* initialize client */ - if (!g_thread_supported()) - { - g_thread_init(NULL); - } - - g_type_init(); - /* init default context */ GError *error = NULL; diff --git a/client/SEService.cpp b/client/SEService.cpp index 5475a7e..60a6336 100644 --- a/client/SEService.cpp +++ b/client/SEService.cpp @@ -260,8 +260,6 @@ namespace smartcard_service_api _BEGIN(); - g_type_init(); - /* init default context */ GError *error = NULL; diff --git a/client/include/ClientChannel.h b/client/include/ClientChannel.h index 1cc607e..cfca093 100644 --- a/client/include/ClientChannel.h +++ b/client/include/ClientChannel.h @@ -18,7 +18,9 @@ #define CLIENTCHANNEL_H_ /* standard library header */ +#ifdef USE_AUTOSTART #include +#endif /* SLP library header */ @@ -42,12 +44,12 @@ namespace smartcard_service_api ClientChannel(void *context, Session *session, int channelNum, const ByteArray &selectResponse, void *handle); ~ClientChannel(); - +#ifdef USE_AUTOSTART static void channel_transmit_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); static void channel_close_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); - +#endif public: int close(closeChannelCallback callback, void *userParam); int transmit(const ByteArray &command, diff --git a/client/include/Reader.h b/client/include/Reader.h index 8b22f71..92fe0bf 100644 --- a/client/include/Reader.h +++ b/client/include/Reader.h @@ -18,8 +18,10 @@ #define READER_H_ /* standard library header */ +#ifdef USE_AUTOSTART #include #include +#endif /* SLP library header */ @@ -44,8 +46,10 @@ namespace smartcard_service_api ~Reader(); inline void unavailable() { present = false; } +#ifdef USE_AUTOSTART static void reader_open_session_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); +#endif public: void closeSessions() diff --git a/client/include/SEService.h b/client/include/SEService.h index d464184..bfbd4b8 100644 --- a/client/include/SEService.h +++ b/client/include/SEService.h @@ -18,8 +18,10 @@ #define SESERVICE_H_ /* standard library header */ +#ifdef USE_AUTOSTART #include #include +#endif /* SLP library header */ @@ -49,8 +51,9 @@ namespace smartcard_service_api void addReader(unsigned int handle, const char *name); bool parseReaderInformation(unsigned int count, const ByteArray &data); +#ifdef USE_AUTOSTART bool parseReaderInformation(GVariant *variant); - +#endif bool _initialize() throw(ErrorIO &); bool initialize(void *context, serviceConnected handler) @@ -59,7 +62,7 @@ namespace smartcard_service_api throw(ErrorIO &, ErrorIllegalParameter &); SEService *initializeSync(void *context, serviceConnected handler) throw(ErrorIO &, ErrorIllegalParameter &); - +#ifdef USE_AUTOSTART static void reader_inserted(GObject *source_object, guint reader_id, gchar *reader_name, gpointer user_data); @@ -70,7 +73,7 @@ namespace smartcard_service_api GAsyncResult *res, gpointer user_data); static void se_service_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); - +#endif public: SEService(void *user_data, serviceConnected handler) throw(ErrorIO &, ErrorIllegalParameter &); diff --git a/client/include/Session.h b/client/include/Session.h index 04945a1..7fc3aa8 100644 --- a/client/include/Session.h +++ b/client/include/Session.h @@ -18,7 +18,9 @@ #define SESSION_H_ /* standard library header */ +#ifdef USE_AUTOSTART #include +#endif /* SLP library header */ @@ -48,12 +50,14 @@ namespace smartcard_service_api throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); +#ifdef USE_AUTOSTART static void session_get_atr_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); static void session_open_channel_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); static void session_close_cb(GObject *source_object, GAsyncResult *res, gpointer user_data); +#endif public: void closeChannels() diff --git a/client/smartcard-service.pc b/client/smartcard-service.pc deleted file mode 100644 index a58f2e7..0000000 --- a/client/smartcard-service.pc +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=/usr -exec_prefix=${prefix}/bin -includedir=${prefix}/include -libdir=${prefix}/lib - -Name: smartcard-service -Description: Make flags of Common library of Smartcard service -Version: 1.0 -Requires: -Libs: -L${libdir} -lsmartcard-service -Cflags: -I${includedir}/smartcard-service \ No newline at end of file diff --git a/client/smartcard-service.pc.in b/client/smartcard-service.pc.in new file mode 100644 index 0000000..5b3d1d7 --- /dev/null +++ b/client/smartcard-service.pc.in @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +exec_prefix=${prefix}/bin +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDE_INSTALL_DIR@/@PROJECT_NAME@ + +Name: @PROJECT_NAME@ +Description: library of Smartcard service +Version: @FULLVER@ +Requires: glib-2.0 +Libs: -L${libdir} -l@PROJECT_NAME@ +Cflags: -I${includedir} diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 0c77a9b..1b5fc13 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,57 +1,28 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(smartcard-service-common CXX) - -SET(LIB_NAME "smartcard-service-common") -SET(VERSION_MAJOR 1) -SET(VERSION ${VERSION_MAJOR}.0.0) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - -AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS) +INCLUDE_DIRECTORIES(include) + +FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen) +EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS + " --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/smartcard-service-gdbus" + " --c-namespace SmartcardService" + " --interface-prefix org.tizen.SmartcardService." + " ${CMAKE_CURRENT_SOURCE_DIR}/smartcard-service-gdbus.xml" +) -#IF("${CMAKE_BUILD_TYPE}" STREQUAL "") -# SET(CMAKE_BUILD_TYPE "Debug") -#ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") -#MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") +AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} COMMON_SRCS) -INCLUDE(FindPkgConfig) pkg_check_modules(pkgs_common REQUIRED glib-2.0 gio-unix-2.0 dlog aul libssl pkgmgr pkgmgr-info) - -MESSAGE("${LIB_NAME} ld flag : ${pkgs_common_LDFLAGS}") - FOREACH(flag ${pkgs_common_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -finstrument-functions") -#SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") -#SET(CMAKE_C_FLAGS_RELEASE "-O2") - -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -finstrument-functions -std=c++0x") -#SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -#SET(CMAKE_CXX_FLAGS_RELEASE "-O2") - -FIND_PROGRAM(UNAME NAMES uname) -EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS("-DSLP_DEBUG") -ADD_DEFINITIONS("-DUSE_UNIX_DOMAIN") ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_COMMON\"") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - -ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) - -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) -SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${VERSION}) +SET(CMAKE_C_FLAGS "${EXTRA_CXXFLAGS}") -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_common_LDFLAGS}) +ADD_LIBRARY(${COMMON_LIB} SHARED ${COMMON_SRCS}) +SET_TARGET_PROPERTIES(${COMMON_LIB} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER}) +TARGET_LINK_LIBRARIES(${COMMON_LIB} ${pkgs_common_LDFLAGS}) SET(EXPORT_HEADER include/smartcard-types.h @@ -65,8 +36,9 @@ SET(EXPORT_HEADER include/SignatureHelper.h ) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) +CONFIGURE_FILE(${COMMON_LIB}.pc.in ${COMMON_LIB}.pc @ONLY) +INSTALL(FILES ${COMMON_LIB}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +INSTALL(TARGETS ${COMMON_LIB} DESTINATION ${LIB_INSTALL_DIR}) FOREACH(hfile ${EXPORT_HEADER}) - INSTALL(FILES ${hfile} DESTINATION include/${LIB_NAME}) + INSTALL(FILES ${hfile} DESTINATION include/${COMMON_LIB}) ENDFOREACH(hfile) diff --git a/common/GPARFACL.cpp b/common/GPARFACL.cpp index a136c83..9c27935 100644 --- a/common/GPARFACL.cpp +++ b/common/GPARFACL.cpp @@ -394,6 +394,7 @@ namespace smartcard_service_api } else { + /* empty file, it means deny for all application */ _INFO("access denied for all applications, aid : %s", condition.getAID().toString().c_str()); condition.setAccessCondition(false); diff --git a/common/include/APDUHelper.h b/common/include/APDUHelper.h index 5f3cf95..732c186 100644 --- a/common/include/APDUHelper.h +++ b/common/include/APDUHelper.h @@ -26,7 +26,7 @@ namespace smartcard_service_api { - class ResponseHelper + class EXPORT ResponseHelper { private: ByteArray response; @@ -75,7 +75,7 @@ namespace smartcard_service_api // static char *getErrorString(); }; - class APDUCommand + class EXPORT APDUCommand { private: typedef struct _command_header_t @@ -171,7 +171,7 @@ namespace smartcard_service_api bool getBuffer(ByteArray &array) const; }; - class APDUHelper + class EXPORT APDUHelper { public: static const int COMMAND_OPEN_LOGICAL_CHANNEL = 1; diff --git a/common/include/ByteArray.h b/common/include/ByteArray.h index e35bef0..cbcd9dd 100644 --- a/common/include/ByteArray.h +++ b/common/include/ByteArray.h @@ -22,10 +22,7 @@ #include #include -/* SLP library header */ - -/* local header */ -//#include "Serializable.h" +#include "Debug.h" #define ARRAY_AND_SIZE(x) (uint8_t *)(&x), sizeof(x) @@ -33,7 +30,7 @@ using namespace std; namespace smartcard_service_api { - class ByteArray //: public Serializable + class EXPORT ByteArray //: public Serializable { protected: uint8_t *buffer; diff --git a/common/include/Debug.h b/common/include/Debug.h index 355974a..a171592 100644 --- a/common/include/Debug.h +++ b/common/include/Debug.h @@ -23,6 +23,10 @@ /* SLP library header */ #include "dlog.h" +#ifndef EXPORT +#define EXPORT __attribute__((visibility("default"))) +#endif + /* local header */ #define COLOR_BLACK "\033[0;30m" diff --git a/common/include/FileObject.h b/common/include/FileObject.h index 1802784..27e56a8 100644 --- a/common/include/FileObject.h +++ b/common/include/FileObject.h @@ -32,7 +32,7 @@ using namespace std; namespace smartcard_service_api { - class FileObject : public ProviderHelper + class EXPORT FileObject : public ProviderHelper { private: FCI fci; diff --git a/common/include/GDBusHelper.h b/common/include/GDBusHelper.h index a32c269..eae14dd 100644 --- a/common/include/GDBusHelper.h +++ b/common/include/GDBusHelper.h @@ -31,7 +31,7 @@ namespace smartcard_service_api void *user_param; }; - class GDBusHelper + class EXPORT GDBusHelper { public : static void convertVariantToByteArray(GVariant *var, diff --git a/common/include/GPACE.h b/common/include/GPACE.h index 5300dfd..1720e7c 100644 --- a/common/include/GPACE.h +++ b/common/include/GPACE.h @@ -30,7 +30,7 @@ #ifdef __cplusplus namespace smartcard_service_api { - class GPACE : public AccessControlList + class EXPORT GPACE : public AccessControlList { private : AccessControlList *acl; diff --git a/common/include/PKCS15.h b/common/include/PKCS15.h index 3900f13..b114b53 100644 --- a/common/include/PKCS15.h +++ b/common/include/PKCS15.h @@ -30,7 +30,7 @@ using namespace std; namespace smartcard_service_api { - class PKCS15: public PKCS15Object + class EXPORT PKCS15: public PKCS15Object { private: map recordElement; diff --git a/common/include/SignatureHelper.h b/common/include/SignatureHelper.h index f65844c..0595ba0 100644 --- a/common/include/SignatureHelper.h +++ b/common/include/SignatureHelper.h @@ -35,7 +35,7 @@ using namespace std; namespace smartcard_service_api { - class SignatureHelper + class EXPORT SignatureHelper { public: static int getPackageName(int pid, char *package, size_t length); diff --git a/common/include/Synchronous.h b/common/include/Synchronous.h index 479b902..c228171 100644 --- a/common/include/Synchronous.h +++ b/common/include/Synchronous.h @@ -17,16 +17,13 @@ #ifndef SYNCHRONOUS_H_ #define SYNCHRONOUS_H_ -/* standard library header */ #include -/* SLP library header */ - -/* local header */ +#include "Debug.h" namespace smartcard_service_api { - class Synchronous + class EXPORT Synchronous { protected: pthread_mutex_t syncMutex; diff --git a/common/smartcard-service-common.pc b/common/smartcard-service-common.pc deleted file mode 100644 index 36ea9c9..0000000 --- a/common/smartcard-service-common.pc +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=/usr -exec_prefix=${prefix}/bin -includedir=${prefix}/include -libdir=${prefix}/lib - -Name: smartcard-service-common -Description: Make flags of Common library of Smartcard service -Version: 1.0 -Requires: -Libs: -L${libdir} -lsmartcard-service-common -Cflags: -I${includedir}/smartcard-service-common \ No newline at end of file diff --git a/common/smartcard-service-common.pc.in b/common/smartcard-service-common.pc.in new file mode 100644 index 0000000..733efdf --- /dev/null +++ b/common/smartcard-service-common.pc.in @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +exec_prefix=${prefix}/bin +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDE_INSTALL_DIR@/@COMMON_LIB@ + +Name: @COMMON_LIB@ +Description: Common library of Smartcard service +Version: @FULLVER@ +Requires: glib-2.0 +Libs: -L${libdir} -l@COMMON_LIB@ +Cflags: -I${includedir} diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index c7c2e9a..0000000 --- a/debian/changelog +++ /dev/null @@ -1,55 +0,0 @@ -smartcard-service (0.1.0-3) unstable; urgency=low - - * add an exceptional case when is openning client channel (nfc-manager) - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.1.0-3 - - -- Wonkyu Kwon Fri, 20 Apr 2012 11:00:00 +0900 - -smartcard-service (0.1.0-2) unstable; urgency=low - - * add helpers for openssl and package signature - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.1.0-2 - - -- Wonkyu Kwon Fri, 23 Mar 2012 12:40:00 +0900 - -smartcard-service (0.1.0-1) unstable; urgency=low - - * Upload package - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.1.0-1 - - -- Wonkyu Kwon Wed, 14 Mar 2012 13:30:00 +0900 - -smartcard-service (0.0.0-4) unstable; urgency=low - - * Upload package - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.0.0-4 - - -- Wonkyu Kwon Tue, 13 Mar 2012 13:10:00 +0900 - -smartcard-service (0.0.0-3) unstable; urgency=low - - * namespace and macro name change - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.0.0-3 - - -- Sangsoo Lee Wed, 07 Mar 2012 19:26:46 +0900 - -smartcard-service (0.0.0-2) unstable; urgency=low - - * getChannelCount api add - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.0.0-2 - - -- Sangsoo Lee Thu, 23 Feb 2012 21:10:42 +0900 - -smartcard-service (0.0.0-1) unstable; urgency=low - - * Initial release - * Git: slp/pkgs/s/smartcard-service - * Tag: smartcard-service_0.0.0-1 - - -- Wonkyu Kwon Thu, 31 Jan 2012 00:00:00 +0900 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 45a4fb7..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/debian/control b/debian/control deleted file mode 100644 index f0eabd9..0000000 --- a/debian/control +++ /dev/null @@ -1,65 +0,0 @@ -Source: smartcard-service -Priority: extra -Maintainer: Wonkyu Kwon , Sangsoo Lee , Sungjae Lim , Junyong Sim , Sechang Sohn -Build-Depends: debhelper (>= 8.0.0), libglib2.0-dev, libvconf-dev, libsecurity-server-client-dev, dlog-dev, wrt-commons-dev, libaul-1-dev, libssl-dev -#Build-Depends: debhelper (>= 8.0.0), libglib2.0-dev, libvconf-dev, libsecurity-server-client-dev, dlog-dev, libpkcs11-helper1-dev, wrt-commons, libaul-dev, libssl-dev -#Standards-Version: 3.9.2 -Section: mixed -Homepage: -#Vcs-Git: git://git.debian.org/collab-maint/smartcard-service.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/smartcard-service.git;a=summary - -Package: smartcard-service-common -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Common library of Smart card service - Common library of Smart card service - -Package: smartcard-service-common-dev -Section: libdevel -Architecture: any -Depends: smartcard-service-common (= ${binary:Version}) -Description: Common library of Smart card service - Common library of Smart card service - -Package: smartcard-service-common-dbg -Section: debug -Architecture: any -Depends: smartcard-service-common (= ${binary:Version}) -Description: Common library of Smart card service (unstripped) - Common library of Smart card service (unstripped) - -Package: smartcard-service-server -Architecture: any -Depends: smartcard-service-common-dev (= ${binary:Version}) -Description: Main process of Smart card service - Main process of Smart card service - -Package: smartcard-service-server-dbg -Section: debug -Architecture: any -Depends: smartcard-service-server (= ${binary:Version}) -Description: Main process of Smart card service (unstripped) - Main process of Smart card service (unstripped) - -Package: smartcard-service -Section: libs -Architecture: any -Depends: smartcard-service-common-dev (= ${binary:Version}) -Description: User library of Smart card service - User library of Smart card service - -Package: smartcard-service-dev -Section: libdevel -Architecture: any -Depends: smartcard-service (= ${binary:Version}) -Description: User library of Smart card service - User library of Smart card service - -Package: smartcard-service-dbg -Section: debug -Architecture: any -Depends: smartcard-service (= ${binary:Version}) -Description: User library of Smart card service (unstripped) - User library of Smart card service (unstripped) diff --git a/debian/rules b/debian/rules deleted file mode 100755 index d6ef688..0000000 --- a/debian/rules +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -override_dh_auto_build: - - cd $(CMAKE_BINARY_DIR) - dh_auto_build - -override_dh_install: - - mkdir -p $(CURDIR)/debian/tmp/etc/init.d - mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/ - mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/ - - cp -af $(CURDIR)/debian/smartcard-service-server.init $(CURDIR)/debian/tmp/etc/init.d/smartcard-service-server - ln -s ../init.d/smartcard-service-server $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S79smartcard-service-server - ln -s ../init.d/smartcard-service-server $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S79smartcard-service-server - - dh_install - -override_dh_installinit: - -%: - dh $@ - diff --git a/debian/smartcard-service-common-dev.dirs b/debian/smartcard-service-common-dev.dirs deleted file mode 100644 index 4418816..0000000 --- a/debian/smartcard-service-common-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib -usr/include diff --git a/debian/smartcard-service-common-dev.install b/debian/smartcard-service-common-dev.install deleted file mode 100644 index 2d332a5..0000000 --- a/debian/smartcard-service-common-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -usr/include/smartcard-service-common/* -#usr/lib/lib*.a -usr/lib/libsmartcard-service-common.so -usr/lib/pkgconfig/smartcard-service-common.pc -#usr/share/pkgconfig/* diff --git a/debian/smartcard-service-common.dirs b/debian/smartcard-service-common.dirs deleted file mode 100644 index 6845771..0000000 --- a/debian/smartcard-service-common.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib diff --git a/debian/smartcard-service-common.install b/debian/smartcard-service-common.install deleted file mode 100644 index 3b87046..0000000 --- a/debian/smartcard-service-common.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/libsmartcard-service-common.so.* diff --git a/debian/smartcard-service-dev.dirs b/debian/smartcard-service-dev.dirs deleted file mode 100644 index 4418816..0000000 --- a/debian/smartcard-service-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib -usr/include diff --git a/debian/smartcard-service-dev.install b/debian/smartcard-service-dev.install deleted file mode 100644 index a547e24..0000000 --- a/debian/smartcard-service-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -usr/include/smartcard-service/* -#usr/lib/lib*.a -usr/lib/libsmartcard-service.so -usr/lib/pkgconfig/smartcard-service.pc -#usr/share/pkgconfig/* diff --git a/debian/smartcard-service-server.dirs b/debian/smartcard-service-server.dirs deleted file mode 100644 index 2d445a0..0000000 --- a/debian/smartcard-service-server.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin -etc \ No newline at end of file diff --git a/debian/smartcard-service-server.init b/debian/smartcard-service-server.init deleted file mode 100755 index ffc409b..0000000 --- a/debian/smartcard-service-server.init +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: smartcard-service-server -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: -# Description: -# <...> -# <...> -### END INIT INFO - -# Author: Wonkyu Kwon - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/usr/bin -DESC=smartcard-daemon # Introduce a short description here -NAME=smartcard-daemon # Introduce the short server's name here -DAEMON=/usr/bin/smartcard-daemon # Introduce the server's location here -DAEMON_ARGS="" # Arguments to run the daemon with -PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/$NAME - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -$DAEMON $DAEMON_ARGS & \ No newline at end of file diff --git a/debian/smartcard-service-server.install b/debian/smartcard-service-server.install deleted file mode 100644 index 8a71c41..0000000 --- a/debian/smartcard-service-server.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin/smartcard-daemon -etc/* \ No newline at end of file diff --git a/debian/smartcard-service.dirs b/debian/smartcard-service.dirs deleted file mode 100644 index 6845771..0000000 --- a/debian/smartcard-service.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib diff --git a/debian/smartcard-service.install b/debian/smartcard-service.install deleted file mode 100644 index 05b76e3..0000000 --- a/debian/smartcard-service.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/libsmartcard-service.so.* diff --git a/packaging/smartcard-service b/packaging/smartcard-service deleted file mode 100644 index 2e43946..0000000 --- a/packaging/smartcard-service +++ /dev/null @@ -1,206 +0,0 @@ -Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/packaging/smartcard-service-common b/packaging/smartcard-service-common deleted file mode 100644 index 2e43946..0000000 --- a/packaging/smartcard-service-common +++ /dev/null @@ -1,206 +0,0 @@ -Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/packaging/smartcard-service-server b/packaging/smartcard-service-server deleted file mode 100644 index 2e43946..0000000 --- a/packaging/smartcard-service-server +++ /dev/null @@ -1,206 +0,0 @@ -Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/packaging/smartcard-service.spec b/packaging/smartcard-service.spec index 5be4bcd..dcab8cb 100644 --- a/packaging/smartcard-service.spec +++ b/packaging/smartcard-service.spec @@ -3,16 +3,21 @@ #%%global test_client "-DTEST_CLIENT=1" Name: smartcard-service -Summary: Smartcard Service FW -Version: 0.1.22 +Summary: Smartcard Service +Version: 0.1.27 Release: 0 -Group: libs +Group: Network & Connectivity/Service License: Apache-2.0 Source0: %{name}-%{version}.tar.gz %if 0%{!?use_autostart:1} Source1: smartcard-service-server.init %endif BuildRequires: cmake +Source1001: %{name}.manifest +Source1002: %{name}-devel.manifest +Source1003: smartcard-service-common.manifest +Source1004: smartcard-service-common-devel.manifest +Source1005: smartcard-service-server.manifest BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(security-server) @@ -30,61 +35,54 @@ Requires: smartcard-service-common = %{version}-%{release} %description -Smartcard Service FW. +A library for Smartcard applications. %prep %setup -q +cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} . %package devel -Summary: smartcard service -Group: Development/Libraries +Summary: Smartcard service +Group: Network & Connectivity/Development Requires: %{name} = %{version}-%{release} - %description devel -smartcard service. +For developing Smartcard applications. %package -n smartcard-service-common -Summary: common smartcard service -Group: Development/Libraries - +Summary: Common smartcard service +Group: Network & Connectivity/Service %description -n smartcard-service-common -common smartcard service. +Common smartcard service for developing internally %package -n smartcard-service-common-devel -Summary: common smartcard service -Group: Development/Libraries +Summary: Common smartcard service +Group: Network & Connectivity/Development Requires: smartcard-service-common = %{version}-%{release} - %description -n smartcard-service-common-devel -common smartcard service. +For developing smartcard services internally. %package -n smartcard-service-server -Summary: server smartcard service -Group: Development/Libraries +Summary: Smartcard service server +Group: Network & Connectivity/Service Requires: smartcard-service-common = %{version}-%{release} - %description -n smartcard-service-server -smartcard service. +Server for smartcard service %build -mkdir obj-arm-limux-qnueabi -cd obj-arm-limux-qnueabi -%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client} -#make %{?jobs:-j%jobs} - +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +%cmake . %{?use_autostart} %{?test_client} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} %install -cd obj-arm-limux-qnueabi %make_install %if 0%{!?use_autostart:1} %__mkdir -p %{buildroot}/etc/init.d/ @@ -93,11 +91,6 @@ cd obj-arm-limux-qnueabi %__cp -af %SOURCE1 %{buildroot}/etc/init.d/smartcard-service-server chmod 755 %{buildroot}/etc/init.d/smartcard-service-server %endif -mkdir -p %{buildroot}/usr/share/license -cp -af %{_builddir}/%{name}-%{version}/packaging/%{name} %{buildroot}/usr/share/license/ -cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-common %{buildroot}/usr/share/license/ -cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buildroot}/usr/share/license/ - %post /sbin/ldconfig @@ -106,7 +99,6 @@ cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buil ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc5.d/S79smartcard-service-server %endif - %postun /sbin/ldconfig %if 0%{!?use_autostart:1} @@ -114,12 +106,18 @@ cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buil rm -f /etc/rc.d/rc5.d/S79smartcard-service-server %endif +%post -n smartcard-service-common +/sbin/ldconfig + +%postun -n smartcard-service-common +/sbin/ldconfig + %files %manifest %{name}.manifest %defattr(-,root,root,-) %{_libdir}/libsmartcard-service.so.* -%{_datadir}/license/%{name} +%license LICENSE.APLv2 %files devel @@ -134,7 +132,7 @@ cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buil %manifest smartcard-service-common.manifest %defattr(-,root,root,-) %{_libdir}/libsmartcard-service-common.so.* -%{_datadir}/license/smartcard-service-common +%license LICENSE.APLv2 %files -n smartcard-service-common-devel @@ -158,4 +156,4 @@ cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buil %else %{_sysconfdir}/init.d/smartcard-service-server %endif -%{_datadir}/license/smartcard-service-server +%license LICENSE.APLv2 diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 1898c0c..e84676b 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -1,60 +1,23 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(smartcard-daemon CXX) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +LINK_DIRECTORIES(${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ SRCS) -IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Release") -ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") - -# pkg config -INCLUDE(FindPkgConfig) - -SET(PKG_MODULE glib-2.0 gio-2.0 gio-unix-2.0 security-server dlog) - -pkg_check_modules(pkgs_server REQUIRED ${PKG_MODULE}) - +pkg_check_modules(pkgs_server REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 security-server dlog) FOREACH(flag ${pkgs_server_CFLAGS}) SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) - -MESSAGE("CHECK MODULE in ${PROJECT_NAME} ${pkgs_server_LDFLAGS}") - -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden") -SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") - -SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden -std=c++0x") -SET(ARM_CXXFLAGS "${ARM_CXXLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") -SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") - -FIND_PROGRAM(UNAME NAMES uname) -EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") -IF("${ARCH}" MATCHES "^arm.*") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM_CXXFLAGS}") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}") -ENDIF() -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_SERVER\"") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - -ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) - -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_server_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-pie -ldl") +ADD_EXECUTABLE(${DAEMON} ${SRCS}) +TARGET_LINK_LIBRARIES(${DAEMON} ${pkgs_server_LDFLAGS} ${COMMON_LIB} dl) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) +INSTALL(TARGETS ${DAEMON} DESTINATION bin) IF("${USE_AUTOSTART}" STREQUAL "1") - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.smartcard_service.service DESTINATION share/dbus-1/services) + INSTALL(FILES org.tizen.smartcard_service.service DESTINATION share/dbus-1/services) ENDIF() INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/smartcard-service-server.xml DESTINATION share/packages) diff --git a/server/ServerGDBus.cpp b/server/ServerGDBus.cpp index 30838c0..6a26095 100644 --- a/server/ServerGDBus.cpp +++ b/server/ServerGDBus.cpp @@ -157,16 +157,15 @@ namespace smartcard_service_api const gchar *interface_name, const gchar *signal_name, GVariant *parameters, gpointer user_data) { - GVariantIter *iter; gchar *name; gchar *old_owner; gchar *new_owner; - iter = g_variant_iter_new(parameters); - - g_variant_iter_next(iter, "s", &name); - g_variant_iter_next(iter, "s", &old_owner); - g_variant_iter_next(iter, "s", &new_owner); + g_variant_get(parameters, + "(sss)", + &name, + &old_owner, + &new_owner); name_owner_changed((GDBusProxy *)connection, name, old_owner, new_owner, user_data); diff --git a/server/smartcard-daemon.cpp b/server/smartcard-daemon.cpp index 3c2890a..cb9c75f 100644 --- a/server/smartcard-daemon.cpp +++ b/server/smartcard-daemon.cpp @@ -123,12 +123,6 @@ int main(int argc, char *argv[]) daemonize(); #endif - if (!g_thread_supported()) { - g_thread_init(NULL); - } - - g_type_init(); - main_loop = g_main_new(TRUE); id = g_bus_own_name(G_BUS_TYPE_SYSTEM, diff --git a/smartcard-service-common-devel.manifest b/smartcard-service-common-devel.manifest deleted file mode 100644 index ca37499..0000000 --- a/smartcard-service-common-devel.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/smartcard-service-common.manifest b/smartcard-service-common.manifest deleted file mode 100644 index ca37499..0000000 --- a/smartcard-service-common.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/smartcard-service-devel.manifest b/smartcard-service-devel.manifest deleted file mode 100644 index ca37499..0000000 --- a/smartcard-service-devel.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/smartcard-service-server.manifest b/smartcard-service-server.manifest deleted file mode 100644 index d4d3a32..0000000 --- a/smartcard-service-server.manifest +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/smartcard-service.manifest b/smartcard-service.manifest deleted file mode 100644 index ca37499..0000000 --- a/smartcard-service.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test-client/CMakeLists.txt b/test-client/CMakeLists.txt index b7c3e66..05b2d24 100644 --- a/test-client/CMakeLists.txt +++ b/test-client/CMakeLists.txt @@ -1,48 +1,23 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(smartcard-test-client CXX) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../client/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +LINK_DIRECTORIES(${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/include) #AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ SRCS) SET(SRCS "${CMAKE_CURRENT_SOURCE_DIR}/test-client-sync.cpp") #SET(SRCS "${CMAKE_CURRENT_SOURCE_DIR}/test-client.cpp") -IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Release") -ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") - -INCLUDE(FindPkgConfig) pkg_check_modules(pkgs_test_client REQUIRED glib-2.0 dlog) - FOREACH(flag ${pkgs_test_client_CFLAGS}) SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) - -MESSAGE("CHECK MODULE in ${PROJECT_NAME} ${pkgs_test_client_LDFLAGS}") - -# this for NFC flag - -SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden -std=c++0x") -SET(ARM_CXXFLAGS "${ARM_CXXLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") -SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") -FIND_PROGRAM(UNAME NAMES uname) -EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") -IF("${ARCH}" MATCHES "^arm.*") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM_CXXFLAGS}") -ENDIF() +MESSAGE("CHECK MODULE in ${PROJECT_NAME} ${pkgs_test_client_LDFLAGS}") -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -#ADD_DEFINITIONS("-DSLP_DEBUG") ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_TEST\"") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_test_client_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-L../client" "-lsmartcard-service" "-pie -ldl") +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_test_client_LDFLAGS} ${COMMON_LIB} ${CLIENT_LIB}) + INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) -- 2.7.4