From 9325e100046c6d6039b66395dd8031551fe9dd14 Mon Sep 17 00:00:00 2001 From: Seok Hong Date: Thu, 11 May 2017 11:01:45 +0900 Subject: [PATCH] [SECIOTSW-413] Support Tizen 4.0 Unified Build Environment Change-Id: I683a653926f9069d301b47c8fec49d091298511a Signed-off-by: Seok Hong --- libs/CMakeLists.txt | 42 +----- libs/dpm.pc.in | 2 +- packaging/device-policy-manager.spec | 267 +---------------------------------- server/CMakeLists.txt | 61 ++------ tests/CMakeLists.txt | 40 +----- 5 files changed, 28 insertions(+), 384 deletions(-) diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index a7ae612..0381807 100755 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -32,19 +32,15 @@ SET(POLICY administration.cpp security.cpp storage.cpp wifi.cpp + password.cpp + krate.cpp dpm/administration.cpp dpm/application.cpp dpm/bluetooth.cpp dpm/restriction.cpp dpm/security.cpp dpm/wifi.cpp -) -# wearable, ivi, common, mobile -SET(POLICY_EXT_PASSWORD password.cpp dpm/password.cpp -) -# ivi, common, mobile -SET(POLICY_EXT_KRATE_ZONE krate.cpp dpm/zone.cpp ) @@ -55,37 +51,15 @@ SET(CAPI dpm/device-policy-manager.h dpm/restriction.h dpm/security.h dpm/wifi.h + dpm/password.h + dpm/password_internal.h + dpm/zone.h ) SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack") ADD_LIBRARY(${PROJECT_NAME} SHARED ${FOUNDATION} ${POLICY}) -IF(DEFINED NO_EXT_PASSWORD) -MESSAGE("Password disabled") -ELSE(DEFINED NO_EXT_PASSWORD) -ADD_LIBRARY(${PROJECT_NAME}-ext-password SHARED ${FOUNDATION} ${POLICY_EXT_PASSWORD}) -SET(CAPI ${CAPI} - dpm/password.h - dpm/password_internal.h -) -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-password PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-password PROPERTIES SOVERSION ${LIB_SOVERSION}) -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-password PROPERTIES VERSION ${LIB_VERSION}) -ENDIF(DEFINED NO_EXT_PASSWORD) - -IF(DEFINED NO_EXT_KRATE_ZONE) -MESSAGE("Krate, Zone disabled") -ELSE(DEFINED NO_EXT_KRATE_ZONE) -ADD_LIBRARY(${PROJECT_NAME}-ext-krate_zone SHARED ${FOUNDATION} ${POLICY_EXT_KRATE_ZONE}) -SET(CAPI ${CAPI} - dpm/zone.h -) -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-krate_zone PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-krate_zone PROPERTIES SOVERSION ${LIB_SOVERSION}) -SET_TARGET_PROPERTIES(${PROJECT_NAME}-ext-krate_zone PROPERTIES VERSION ${LIB_VERSION}) -ENDIF(DEFINED NO_EXT_KRATE_ZONE) - SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${LIB_SOVERSION}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${LIB_VERSION}) @@ -104,12 +78,6 @@ CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY) INSTALL(FILES ${CMAKE_BINARY_DIR}/${PC_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) -IF(NOT DEFINED NO_EXT_PASSWORD) -INSTALL(TARGETS ${PROJECT_NAME}-ext-password DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) -ENDIF(NOT DEFINED NO_EXT_PASSWORD) -IF(NOT DEFINED NO_EXT_KRATE_ZONE) -INSTALL(TARGETS ${PROJECT_NAME}-ext-krate_zone DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) INSTALL(FILES ${CAPI} DESTINATION ${INCLUDE_INSTALL_DIR}/dpm) #Tizen Device Security Monitor Client Library diff --git a/libs/dpm.pc.in b/libs/dpm.pc.in index 9136e5c..6ba2138 100644 --- a/libs/dpm.pc.in +++ b/libs/dpm.pc.in @@ -8,5 +8,5 @@ includedir=@INCLUDE_INSTALL_DIR@ Name: dpm Description: Tizen Device Policy Client library Version: @VERSION@ -Libs: -L${libdir} -ldpm -ldpm-ext-password -ldpm-ext-krate_zone +Libs: -L${libdir} -ldpm Cflags: -I${includedir}/dpm diff --git a/packaging/device-policy-manager.spec b/packaging/device-policy-manager.spec index ec97c27..31e15f5 100755 --- a/packaging/device-policy-manager.spec +++ b/packaging/device-policy-manager.spec @@ -37,34 +37,9 @@ BuildRequires: pkgconfig(key-manager) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) BuildRequires: pkgconfig(jsoncpp) -BuildRequires: sed - -# The usage of "profile" in the following expressions is for -# backward compatility and GBM build optimization only. They will be -# ignored in Tizen 4.0 Unified Build Environment. -%if "%{?profile}" != "tv" BuildRequires: pkgconfig(capi-location-manager) BuildRequires: pkgconfig(auth-fw-admin) -%if "%{?profile}" != "wearable" BuildRequires: pkgconfig(krate) -%endif -%endif -Requires: %{name}-compat = %{version}-%{release} -# The usage of "profile" in the following expressions is for -# backward compatility and GBM build optimization only. They will be -# ignored in Tizen 4.0 Unified Build Environment. -%if "%{?profile}" == "tv" -# Obsolete Build System Support -Requires: %{name}-minimal -%else -%if "%{?profile}" == "wearable" -# Obsolete Build System Support -Requires: %{name}-ext-password -%else -# 4.0 Build System Will Always Profile-Agnostic -Recommends: %{name}-full -%endif -%endif %description The device-policy-manager package provides a daemon which is responsible for @@ -74,74 +49,16 @@ managing device policies. %manifest device-policy-manager.manifest %defattr(644,root,root,755) %attr(700,root,root) %{_bindir}/dpm-admin-cli -# dpm-admin-cli: no differences per profile %attr(755,root,root) %{_bindir}/dpm-syspopup %attr(755,root,root) %{_bindir}/dpm-storage-builder +%attr(755,root,root) %{_bindir}/device-policy-manager %{_unitdir}/device-policy-manager.service %{_unitdir}/multi-user.target.wants/device-policy-manager.service -%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" -%package full -Summary: Device-policy-manager binaries with full features (common/mobile/ivi) -Provides: %{name}-compat = %{version}-%{release} -Provides: %{name}-profile_common = %{version}-%{release} -Provides: %{name}-profile_mobile = %{version}-%{release} -Provides: %{name}-profile_ivi = %{version}-%{release} -Conflicts: %{name}-minimal -Conflicts: %{name}-ext-password -%description full -The device-policy-manager server binary with full features (common/mobile/ivi). -%files full -%attr(755,root,root) %{_bindir}/device-policy-manager -%endif - -%if "%{?profile}" != "tv" -%package ext-password -Summary: Device-policy-manager binaries with min+password features (wearable) -Provides: %{name}-compat = %{version}-%{release} -Provides: %{name}-profile_wearable = %{version}-%{release} -Conflicts: %{name}-minimal -Conflicts: %{name}-full -%description ext-password -The device-policy-manager server binary with min+password features (wearable) -%post ext-password -ln -sf device-policy-manager.ext-pwd %{_bindir}/device-policy-manager -%preun ext-password -rm device-policy-manager -%files ext-password -%attr(755,root,root) %{_bindir}/device-policy-manager.ext-pwd -%endif - -%package minimal -Summary: Device-policy-manager binaries with minimal features (tv) -Provides: %{name}-compat = %{version}-%{release} -Provides: %{name}-profile_tv = %{version}-%{release} -Conflicts: %{name}-ext-password -Conflicts: %{name}-full -%description minimal -The device-policy-manager server binary with minimal features (tv) -%post minimal -ln -sf device-policy-manager.minimal %{_bindir}/device-policy-manager -%preun minimal -rm device-policy-manager -%files minimal -%attr(755,root,root) %{_bindir}/device-policy-manager.minimal - %prep %setup -q %build -# The usage of "profile" in the following expressions is for -# backward compatility and GBM build optimization only. They will be -# ignored in Tizen 4.0 Unified Build Environment. -%if "%{?profile}" == "tv" -sed -i "s|-ldpm-ext-password||" libs/dpm.pc.in -sed -i "s|-ldpm-ext-krate_zone||" libs/dpm.pc.in -%endif -%if "%{?profile}" == "wearable" -sed -i "s|-ldpm-ext-krate_zone||" libs/dpm.pc.in -%endif - %{!?build_type:%define build_type "RELEASE"} %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING" || %{build_type} == "CCOV" @@ -149,21 +66,8 @@ sed -i "s|-ldpm-ext-krate_zone||" libs/dpm.pc.in CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE" %endif -# Add -DNO_EXT_KRATE_ZONE for wearable, tv GBM only -# Add -DNO_EXT_PASSWORD for tv GBM only (implied no bluetooth/location as well) -# -DNO_EXT_PASSWORD requires -DNO_EXT_KRATE_ZONE. (otherwise: unexpected behavior) -# The usage of "profile" in the following expressions is for -# backward compatility and GBM build optimization only. They will be -# ignored in Tizen 4.0 Unified Build Environment. %cmake . -DVERSION=%{version} \ -DCMAKE_BUILD_TYPE=%{build_type} \ -%if "%{profile}" == "tv" - -DNO_EXT_PASSWORD=on \ - -DNO_EXT_KRATE_ZONE=on \ -%endif -%if "%{profile}" == "wearable" - -DNO_EXT_KRATE_ZONE=on \ -%endif -DSCRIPT_INSTALL_DIR=%{_scriptdir} \ -DSYSTEMD_UNIT_INSTALL_DIR=%{_unitdir} \ -DDATA_INSTALL_DIR=%{TZ_SYS_DATA}/dpm \ @@ -180,14 +84,6 @@ make %{?jobs:-j%jobs} mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants ln -s ../device-policy-manager.service %{buildroot}/%{_unitdir}/multi-user.target.wants/device-policy-manager.service -# Enforce devel pacakge to be independent to profile. -# This is a requirement of Tizen 4.0 (Configurability & Building Blocks) -# Do not worry for SDK rootstraping. You need to supply an XML that states -# public API sets for each profile anyway, which filters CAPI headers for SDK. -install -m 0644 libs/dpm/password.h %{buildroot}%{_includedir}/dpm/ -install -m 0644 libs/dpm/password_internal.h %{buildroot}%{_includedir}/dpm/ -install -m 0644 libs/dpm/zone.h %{buildroot}%{_includedir}/dpm/ - %find_lang dpm-syspopup %clean @@ -203,110 +99,20 @@ rm -rf %{buildroot} %package -n libdpm Summary: Metapacakge for Tizen Device Policy Client Library Group: Development/Libraries -Requires: libdpm-compat = %{version}-%{release} -%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" -Recommends: libdpm-full = %{version}-%{release} -%endif -%if "%{?profile}" == "tv" -Requires: libdpm-profile_tv = %{version}-%{release} -%endif -%if "%{?profile}" == "wearable" -Requires: libdpm-profile_wearable = %{version}-%{release} -%endif -%if "%{?profile}" == "mobile" -Requires: libdpm-profile_mobile = %{version}-%{release} -%endif %description -n libdpm Metapackage for Tizen Device Policy Client Library. -This is to support libdpm-full/minimal/ext with the common name. -%files -n libdpm -# Null (this is a meta package) - -%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" -%package -n libdpm-full -Summary: Tizen Device Policy Client library (full: mobile, ivi, common) -Group: Development/Libraries -Requires: %{name}-full = %{version}-%{release} -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig -Provides: libdpm-compat = %{version}-%{release} -Provides: libdpm-profile_common = %{version}-%{release} -Provides: libdpm-profile_mobile = %{version}-%{release} -Provides: libdpm-profile_ivi = %{version}-%{release} -Requires: libdpm-ext-password = %{version}-%{release} - -%description -n libdpm-full -The libdpm package contains the libraries needed to run DPM client. -This containts the full library (mobile/ivi/common) - -%post -n libdpm-full -p /sbin/ldconfig -%postun -n libdpm-full -p /sbin/ldconfig - -%files -n libdpm-full -%manifest device-policy-manager.manifest -%defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/libdpm-ext-krate_zone.so.%{version} -%{_libdir}/libdpm-ext-krate_zone.so.0 -%endif - -%package -n libdpm-minimal -Summary: Tizen Device Policy Client library (minimal: tv) -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig -Provides: libdpm-compat = %{version}-%{release} -Provides: libdpm-profile_tv = %{version}-%{release} -%description -n libdpm-minimal -The libdpm package contains the libraries needed to run DPM client. -This containts the minimal library (tv) -%post -n libdpm-minimal -p /sbin/ldconfig -%postun -n libdpm-minimal -p /sbin/ldconfig -%files -n libdpm-minimal +%files -n libdpm %manifest device-policy-manager.manifest %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/libdpm.so.%{version} %{_libdir}/libdpm.so.0 -%if "%{?profile}" != "tv" -%package -n libdpm-ext-password -Summary: Tizen Device Policy Client library (min+password: wearable) -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig -Provides: libdpm-compat = %{version}-%{release} -Provides: libdpm-profile_wearable = %{version}-%{release} -Requires: libdpm-minimal = %{version}-%{release} -%description -n libdpm-ext-password -The libdpm package contains the libraries needed to run DPM client. -This containts the minimal + password library (wearable) -%post -n libdpm-ext-password -p /sbin/ldconfig -%postun -n libdpm-ext-password -p /sbin/ldconfig -%files -n libdpm-ext-password -%manifest device-policy-manager.manifest -%defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/libdpm-ext-password.so.%{version} -%{_libdir}/libdpm-ext-password.so.0 -%endif - ## Devel Package ############################################################## %package -n libdpm-devel Summary: Libraries and header files for device policy client development Group: Development/Libraries -%if "%{?profile}" == "tv" -# Obsolete Build System Support -Requires: libdpm-minimal = %{version}-%{release} -%endif -%if "%{?profile}" == "wearable" -# Obsolete Build System Support -Requires: libdpm-ext-password = %{version}-%{release} -%endif -%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" -Requires: libdpm-full = %{version}-%{release} -%endif Requires: libdpm = %{version}-%{release} %description -n libdpm-devel @@ -317,79 +123,21 @@ developing the DPM client program. %manifest device-policy-manager.manifest %defattr(644,root,root,755) %{_libdir}/libdpm.so -# The usage of "profile" in the following expressions is for -# backward compatility and GBM build optimization only. They will be -# ignored in Tizen 4.0 Unified Build Environment. -%if "%{?profile}" != "tv" -%{_libdir}/libdpm-ext-password.so -%if "%{?profile}" != "wearable" -%{_libdir}/libdpm-ext-krate_zone.so -%endif -%endif %{_includedir}/dpm %{_libdir}/pkgconfig/dpm.pc ## Test Package ############################################################## -%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" -%package -n dpm-testcases-full +%package -n dpm-testcases Summary: Device Policy Manager test cases Group: Development/Libraries -Requires: libdpm-full = %{version}-%{release} -Provides: dpm-testcases = %{version}-%{release} -Provides: dpm-testcases-profile_common = %{version}-%{release} -Provides: dpm-testcases-profile_mobile = %{version}-%{release} -Provides: dpm-testcases-profile_ivi = %{version}-%{release} -Conflicts: dpm-testcases-minimal -Conflicts: dpm-testcases-ext-password - -%description -n dpm-testcases-full +Requires: libdpm = %{version}-%{release} + +%description -n dpm-testcases Testcases for device policy manager and device policy client -This supports "full" version of dpm (common/mobile/ivi profiles) -%files -n dpm-testcases-full +%files -n dpm-testcases %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/dpm-api-tests -# common+ivi+wearable vs mobile vs tv -%endif - -%package -n dpm-testcases-minimal -Summary: Device Policy Manager test cases (minimal for TV) -Group: Development/Libraries -Requires: libdpm-minimal = %{version}-%{release} -Provides: dpm-testcases-profile_tv = %{version}-%{release} -Conflicts: dpm-testcases-full -Conflicts: dpm-testcases-ext-password -%description -n dpm-testcases-minimal -Minimal testcases for device policy manager and device policy client -This support "minimal" version of dpm (tv profile) -%post -n dpm-testcases-minimal -ln -sf dpm-api-tests.minimal %{_bindir}/dpm-api-tests -%preun -n dpm-testcases-minimal -rm %{_bindir}/dpm-api-tests -%files -n dpm-testcases-minimal -%defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/dpm-api-tests.minimal - -%if "%{?profile}" != "tv" -%package -n dpm-testcases-ext-password -Summary: Device Policy Manager test cases (minimal+password for wearable) -Group: Development/Libraries -Requires: libdpm-ext-password = %{version}-%{release} -Provides: dpm-testcases-profile_wearable = %{version}-%{release} -Conflicts: dpm-testcases-minimal -Conflicts: dpm-testcases-full -%description -n dpm-testcases-ext-password -Minimal+password testcases for device policy manager and device policy client -This support "minimal+password" version of dpm (wearable profile) -%post -n dpm-testcases-ext-password -ln -sf dpm-api-tests.ext-pwd %{_bindir}/dpm-api-tests -%preun -n dpm-testcases-ext-password -rm %{_bindir}/dpm-api-tests -%files -n dpm-testcases-ext-password -%defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/dpm-api-tests.ext-pwd -# common+ivi+wearable vs mobile vs tv -%endif ## DPM Syspopup Package ###################################################### %package -n org.tizen.dpm-syspopup @@ -403,7 +151,6 @@ BuildRequires: pkgconfig(capi-system-info) %description -n org.tizen.dpm-syspopup Tizen DPM system popup interface package -# No differences per profile. %files -n org.tizen.dpm-syspopup -f dpm-syspopup.lang %defattr(-,root,root,-) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 1955f88..fc25edb 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -43,14 +43,10 @@ SET(POLICY ${SECURITY_MONITOR} security.cpp storage.cpp wifi.cpp -) -SET(POLICY_1 ${POLICY} bluetooth.cpp location.cpp password.cpp password-manager.cpp -) -SET(POLICY_2 ${POLICY_1} krate.cpp ) @@ -79,68 +75,27 @@ SET(DEPENDENCY klay cynara-client cynara-session jsoncpp -) -IF(NOT DEFINED NO_EXT_PASSWORD) -SET(DEPENDENCY ${DEPENDENCY} capi-location-manager + capi-location-manager capi-network-bluetooth auth-fw-admin bluetooth-api + krate ) -IF (NOT DEFINED NO_EXT_KRATE_ZONE) -SET(DEPENDENCY ${DEPENDENCY} krate -) -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) -ELSE(NOT DEFINED NO_EXT_PASSWORD) -IF (NOT DEFINED NO_EXT_KRATE_ZONE) -# It is error if !NO_EXT_KRATE_ZONE + NO_EXT_PASSWORD - error("NO_EXT_KRATE_ZONE should be defined if NO_EXT_PASSWORD is defined.") -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) -ENDIF(NOT DEFINED NO_EXT_PASSWORD) PKG_CHECK_MODULES(SERVER_DEPS REQUIRED ${DEPENDENCY}) INCLUDE_DIRECTORIES(SYSTEM ${SERVER_DEPS_INCLUDE_DIRS} ${DPM_POLICY} ${DPM_SERVER} dsm) -ADD_EXECUTABLE(${TARGET}.minimal ${FOUNDATION} ${POLICY}) -TARGET_LINK_LIBRARIES(${TARGET}.minimal ${SERVER_DEPS_LIBRARIES} pthread sqlite3) -SET_TARGET_PROPERTIES(${TARGET}.minimal PROPERTIES COMPILE_FLAGS "-fPIE") -SET_TARGET_PROPERTIES(${TARGET}.minimal PROPERTIES LINK_FLAGS "-pie") -TARGET_COMPILE_DEFINITIONS(${TARGET}.minimal PRIVATE +ADD_EXECUTABLE(${TARGET} ${FOUNDATION} ${POLICY}) +TARGET_LINK_LIBRARIES(${TARGET} ${SERVER_DEPS_LIBRARIES} pthread sqlite3) +SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "-fPIE") +SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS "-pie") +TARGET_COMPILE_DEFINITIONS(${TARGET} PRIVATE DATA_PATH="${DATA_INSTALL_DIR}" RUN_PATH="${RUN_INSTALL_DIR}" DB_PATH="${DB_INSTALL_DIR}" ) -INSTALL(TARGETS ${TARGET}.minimal DESTINATION bin) - - -# Add "Password" (no TV). (password, location, bluetooth) -IF(NOT DEFINED NO_EXT_PASSWORD) - ADD_EXECUTABLE(${TARGET}.ext-pwd ${FOUNDATION} ${POLICY_1}) - TARGET_LINK_LIBRARIES(${TARGET}.ext-pwd ${SERVER_DEPS_LIBRARIES} pthread sqlite3) - SET_TARGET_PROPERTIES(${TARGET}.ext-pwd PROPERTIES COMPILE_FLAGS "-fPIE") - SET_TARGET_PROPERTIES(${TARGET}.ext-pwd PROPERTIES LINK_FLAGS "-pie") - TARGET_COMPILE_DEFINITIONS(${TARGET}.ext-pwd PRIVATE - DATA_PATH="${DATA_INSTALL_DIR}" - RUN_PATH="${RUN_INSTALL_DIR}" - DB_PATH="${DB_INSTALL_DIR}" - ) - INSTALL(TARGETS ${TARGET}.ext-pwd DESTINATION bin) - -# Add "Krate" (no TV, WEARABLE). (krate) -IF (NOT DEFINED NO_EXT_KRATE_ZONE) - ADD_EXECUTABLE(${TARGET} ${FOUNDATION} ${POLICY_2}) - TARGET_LINK_LIBRARIES(${TARGET} ${SERVER_DEPS_LIBRARIES} pthread sqlite3) - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "-fPIE") - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS "-pie") - TARGET_COMPILE_DEFINITIONS(${TARGET} PRIVATE - DATA_PATH="${DATA_INSTALL_DIR}" - RUN_PATH="${RUN_INSTALL_DIR}" - DB_PATH="${DB_INSTALL_DIR}" - ) - INSTALL(TARGETS ${TARGET} DESTINATION bin) - -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) -ENDIF(NOT DEFINED NO_EXT_PASSWORD) +INSTALL(TARGETS ${TARGET} DESTINATION bin) CONFIGURE_FILE(systemd/device-policy-manager.service.in systemd/device-policy-manager.service) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd243ec..691b5df 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,39 +24,13 @@ SET(API_TEST_SOURCES main.c restriction.c security.c wifi.c - smack.c + password.c + zone.c + smack.c ) -SET(API_TEST_SOURCES_1 ${API_TEST_SOURCES} - password.c -) -SET(API_TEST_SOURCES_2 ${API_TEST_SOURCES_1} - zone.c -) -INCLUDE_DIRECTORIES(SYSTEM ${DPM_LIBS} ${DPM_LIBS}/dsm ${DPM_TESTS}) - -ADD_EXECUTABLE(${API_TEST_TARGET}.minimal ${API_TEST_SOURCES}) -TARGET_LINK_LIBRARIES(${API_TEST_TARGET}.minimal dpm dsm glib-2.0) -INSTALL(TARGETS ${API_TEST_TARGET}.minimal DESTINATION bin) - -# Add "Password" (no TV). (password, location, bluetooth) -IF(NOT DEFINED NO_EXT_PASSWORD) - ADD_EXECUTABLE(${API_TEST_TARGET}.ext-pwd ${API_TEST_SOURCES_1}) - TARGET_LINK_LIBRARIES(${API_TEST_TARGET}.ext-pwd dpm dpm-ext-password dsm glib-2.0) - INSTALL(TARGETS ${API_TEST_TARGET}.ext-pwd DESTINATION bin) - -# Add "Krate" (no TV, WEARABLE). (krate) -IF (NOT DEFINED NO_EXT_KRATE_ZONE) - ADD_EXECUTABLE(${API_TEST_TARGET} ${API_TEST_SOURCES_2}) - TARGET_LINK_LIBRARIES(${API_TEST_TARGET} dpm dpm-ext-password dpm-ext-krate_zone dsm glib-2.0) - INSTALL(TARGETS ${API_TEST_TARGET} DESTINATION bin) - -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) - -ELSE(NOT DEFINED NO_EXT_PASSWORD) -IF (NOT DEFINED NO_EXT_KRATE_ZONE) -# It is error if !NO_EXT_KRATE_ZONE + NO_EXT_PASSWORD - error("NO_EXT_KRATE_ZONE should be defined if NO_EXT_PASSWORD is defined.") -ENDIF(NOT DEFINED NO_EXT_KRATE_ZONE) -ENDIF(NOT DEFINED NO_EXT_PASSWORD) +INCLUDE_DIRECTORIES(SYSTEM ${DPM_LIBS} ${DPM_LIBS}/dsm ${DPM_TESTS}) +ADD_EXECUTABLE(${API_TEST_TARGET} ${API_TEST_SOURCES}) +TARGET_LINK_LIBRARIES(${API_TEST_TARGET} dpm dsm glib-2.0) +INSTALL(TARGETS ${API_TEST_TARGET} DESTINATION bin) -- 2.7.4