From: jin-gyu.kim Date: Thu, 8 Sep 2016 09:28:20 +0000 (+0900) Subject: Remove profile build dependencies X-Git-Tag: submit/tizen/20160922.004002^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c73dbf2884b185cb746635d471c6c799bd614b5;p=platform%2Fcore%2Fsecurity%2Fsecurity-config.git Remove profile build dependencies - There will be base package and sub pacakges of each profiles. Change-Id: I5e376ce937ff0f43d4b1ab858500d45bfe68a856 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 37d50d0..6a9d250 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,10 +16,8 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/config/90_user-content-permissions.post DESTIN INSTALL(FILES ${CMAKE_SOURCE_DIR}/config/91_user-dbspace-permissions.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d) INSTALL(FILES ${CMAKE_SOURCE_DIR}/upgrade/10.security.upgrade.sh DESTINATION /usr/share/upgrade/scripts) -IF("${PROFILE}" STREQUAL "mobile" OR "${PROFILE}" STREQUAL "wearable") INSTALL(FILES ${CMAKE_SOURCE_DIR}/smack/onlycap DESTINATION /etc/smack) INSTALL(FILES ${CMAKE_SOURCE_DIR}/smack/smack_default_labeling DESTINATION /usr/share/security-config) -ENDIF() INSTALL(FILES ${CMAKE_SOURCE_DIR}/packaging/security-config.manifest @@ -28,6 +26,4 @@ INSTALL(FILES ) ADD_SUBDIRECTORY(test) -IF("${PROFILE}" STREQUAL "mobile" OR "${PROFILE}" STREQUAL "wearable") ADD_SUBDIRECTORY(systemd) -ENDIF() diff --git a/packaging/security-config.spec b/packaging/security-config.spec index 319768b..774c9a1 100755 --- a/packaging/security-config.spec +++ b/packaging/security-config.spec @@ -14,14 +14,34 @@ Requires: libcap-tools set of important system configuration and setup files, such as passwd, group, and profile. +%package profile_mobile +Summary: Additional package for Mobile Profile +Requires: security-config = %{version} + +%description profile_mobile +additional security tests and settings for mobile profile + +%package profile_wearable +Summary: Additional package for Wearable Profile +Requires: security-config = %{version} + +%description profile_wearable +additional security tests and settings for wearable profile + +#%package profile_tv +#Summary: Additional package for TV Profile +#Requires: security-config = %{version} + +#%description profile_tv +#additional security tests and settings for tv profile + %prep %setup -q %build %cmake . -DARCH=%{_arch} \ - -DSYSTEMD_INSTALL_DIR=%{_unitdir} \ - -DPROFILE=%{profile} + -DSYSTEMD_INSTALL_DIR=%{_unitdir} %install rm -rf %{buildroot} @@ -30,10 +50,8 @@ cp LICENSE %{buildroot}%{_datadir}/license/%{name} cp LICENSE %{buildroot}%{_datadir}/license/security-config %make_install -%if ("%{?profile}" == "mobile" || "%{?profile}" == "wearable") mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants ln -s ../%{name}.service %{buildroot}/%{_unitdir}/multi-user.target.wants/%{name}.service -%endif %post /usr/share/security-config/group_id_setting @@ -41,7 +59,31 @@ ln -s ../%{name}.service %{buildroot}/%{_unitdir}/multi-user.target.wants/%{name mkdir -p /usr/share/security-config/result mkdir -p /usr/share/security-config/log -%files -n security-config +%post profile_mobile +mv /usr/share/security-config/test/root_test/mobile/* /usr/share/security-config/test/root_test/ +mv /usr/share/security-config/test/capability_test/mobile/* /usr/share/security-config/test/capability_test/ +rm -r /usr/share/security-config/test/root_test/mobile/ +rm -r /usr/share/security-config/test/root_test/wearable/ +rm -r /usr/share/security-config/test/capability_test/mobile/ +rm -r /usr/share/security-config/test/capability_test/wearable/ + +%postun profile_mobile +rm /usr/share/security-config/test/root_test/* +rm /usr/share/security-config/test/capability_test/* + +%post profile_wearable +mv /usr/share/security-config/test/root_test/wearable/* /usr/share/security-config/test/root_test/ +mv /usr/share/security-config/test/capability_test/wearable/* /usr/share/security-config/test/capability_test/ +rm -r /usr/share/security-config/test/root_test/mobile/ +rm -r /usr/share/security-config/test/root_test/wearable/ +rm -r /usr/share/security-config/test/capability_test/mobile/ +rm -r /usr/share/security-config/test/capability_test/wearable/ + +%postun profile_wearable +rm /usr/share/security-config/test/root_test/* +rm /usr/share/security-config/test/capability_test/* + +%files %manifest %{_datadir}/%{name}.manifest %{_datadir}/license/%{name} %defattr(-,root,root,-) @@ -62,9 +104,22 @@ mkdir -p /usr/share/security-config/log %attr(755,root,root) /usr/share/upgrade/scripts/10.security.upgrade.sh %attr(755,root,root) %{_sysconfdir}/gumd/useradd.d/90_user-content-permissions.post %attr(755,root,root) %{_sysconfdir}/gumd/useradd.d/91_user-dbspace-permissions.post -%if ("%{?profile}" == "mobile" || "%{?profile}" == "wearable") + +%files profile_mobile %attr(-,root,root) %{_unitdir}/security-config.service %attr(-,root,root) %{_unitdir}/multi-user.target.wants/security-config.service %attr(755,root,root) /usr/share/security-config/smack_default_labeling %attr(644,root,root) /etc/smack/onlycap -%endif +%attr(755,root,root) /usr/share/security-config/test/root_test/mobile/* +%attr(755,root,root) /usr/share/security-config/test/capability_test/mobile/* + +%files profile_wearable +%attr(-,root,root) %{_unitdir}/security-config.service +%attr(-,root,root) %{_unitdir}/multi-user.target.wants/security-config.service +%attr(755,root,root) /usr/share/security-config/smack_default_labeling +%attr(644,root,root) /etc/smack/onlycap +%attr(755,root,root) /usr/share/security-config/test/root_test/wearable/* +%attr(755,root,root) /usr/share/security-config/test/capability_test/wearable/* + +#%files profile-tv + diff --git a/test/capability_test/CMakeLists.txt b/test/capability_test/CMakeLists.txt index 63f0771..5eff48f 100755 --- a/test/capability_test/CMakeLists.txt +++ b/test/capability_test/CMakeLists.txt @@ -3,37 +3,38 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FILE(GLOB SHELL_SCRIPT *.sh) IF("${ARCH}" STREQUAL "arm") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/cap_mac_exception_list") - ELSEIF("${PROFILE}" STREQUAL "wearable") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/cap_mac_exception_list") - ENDIF() + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/root_daemon_list") + FILE(GLOB M_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/cap_mac_exception_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/root_daemon_list") + FILE(GLOB W_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/cap_mac_exception_list") ELSEIF("${ARCH}" STREQUAL "aarch64") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/cap_mac_exception_list") - ENDIF() + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/root_daemon_list") + FILE(GLOB M_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/mobile/cap_mac_exception_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/root_daemon_list") + FILE(GLOB W_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/target/wearable/cap_mac_exception_list") ELSEIF("${ARCH}" STREQUAL "i386") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/cap_mac_exception_list") - ELSEIF("${PROFILE}" STREQUAL "wearable") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/cap_mac_exception_list") - ENDIF() + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/root_daemon_list") + FILE(GLOB M_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/cap_mac_exception_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/root_daemon_list") + FILE(GLOB W_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/cap_mac_exception_list") ELSEIF("${ARCH}" STREQUAL "x86_64") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/root_daemon_list") - FILE(GLOB CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/cap_mac_exception_list") - ENDIF() + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/root_daemon_list") + FILE(GLOB M_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/mobile/cap_mac_exception_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/root_daemon_list") + FILE(GLOB W_CAP_MAC_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/capability_test/list/emul/wearable/cap_mac_exception_list") ENDIF() INSTALL(FILES ${SHELL_SCRIPT} - ${ROOT_DAEMON_LIST} - ${CAP_MAC_EXCEPTION_LIST} + ${W_ROOT_DAEMON_LIST} + ${W_CAP_MAC_EXCEPTION_LIST} DESTINATION - /usr/share/security-config/test/capability_test + /usr/share/security-config/test/capability_test/wearable +) +INSTALL(FILES + ${SHELL_SCRIPT} + ${M_ROOT_DAEMON_LIST} + ${M_CAP_MAC_EXCEPTION_LIST} + DESTINATION + /usr/share/security-config/test/capability_test/mobile ) diff --git a/test/root_test/CMakeLists.txt b/test/root_test/CMakeLists.txt index 7390c4e..105e17c 100755 --- a/test/root_test/CMakeLists.txt +++ b/test/root_test/CMakeLists.txt @@ -2,50 +2,57 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FILE(GLOB SHELL_SCRIPT *.sh) IF("${ARCH}" STREQUAL "arm") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/root_daemon_list") - ELSEIF("${PROFILE}" STREQUAL "wearable") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/root_daemon_list") - ENDIF() + FILE(GLOB M_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/exception_list") + FILE(GLOB M_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_daemon_list") + FILE(GLOB M_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_root_list") + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/root_daemon_list") + FILE(GLOB W_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/exception_list") + FILE(GLOB W_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_daemon_list") + FILE(GLOB W_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_root_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/root_daemon_list") ELSEIF("${ARCH}" STREQUAL "aarch64") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/root_daemon_list") - ENDIF() + FILE(GLOB M_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/exception_list") + FILE(GLOB M_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_daemon_list") + FILE(GLOB M_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/non_root_list") + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/mobile/root_daemon_list") + FILE(GLOB W_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/exception_list") + FILE(GLOB W_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_daemon_list") + FILE(GLOB W_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/non_root_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/target/wearable/root_daemon_list") ELSEIF("${ARCH}" STREQUAL "i386") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/root_daemon_list") - ELSEIF("${PROFILE}" STREQUAL "wearable") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/root_daemon_list") - ENDIF() + FILE(GLOB M_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/exception_list") + FILE(GLOB M_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_daemon_list") + FILE(GLOB M_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_root_list") + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/root_daemon_list") + FILE(GLOB W_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/exception_list") + FILE(GLOB W_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_daemon_list") + FILE(GLOB W_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_root_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/root_daemon_list") ELSEIF("${ARCH}" STREQUAL "x86_64") - IF("${PROFILE}" STREQUAL "mobile") - FILE(GLOB EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/exception_list") - FILE(GLOB NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_daemon_list") - FILE(GLOB NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_root_list") - FILE(GLOB ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/root_daemon_list") - ENDIF() + FILE(GLOB M_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/exception_list") + FILE(GLOB M_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_daemon_list") + FILE(GLOB M_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/non_root_list") + FILE(GLOB M_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/mobile/root_daemon_list") + FILE(GLOB W_EXCEPTION_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/exception_list") + FILE(GLOB W_NON_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_daemon_list") + FILE(GLOB W_NON_ROOT_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/non_root_list") + FILE(GLOB W_ROOT_DAEMON_LIST "${CMAKE_SOURCE_DIR}/test/root_test/list/emul/wearable/root_daemon_list") ENDIF() +INSTALL(FILES + ${W_SHELL_SCRIPT} + ${W_EXCEPTION_LIST} + ${W_NON_DAEMON_LIST} + ${W_NON_ROOT_LIST} + ${W_ROOT_DAEMON_LIST} + DESTINATION + /usr/share/security-config/test/root_test/wearable +) INSTALL(FILES ${SHELL_SCRIPT} - ${EXCEPTION_LIST} - ${NON_DAEMON_LIST} - ${NON_ROOT_LIST} - ${ROOT_DAEMON_LIST} + ${M_EXCEPTION_LIST} + ${M_NON_DAEMON_LIST} + ${M_NON_ROOT_LIST} + ${M_ROOT_DAEMON_LIST} DESTINATION - /usr/share/security-config/test/root_test + /usr/share/security-config/test/root_test/mobile ) diff --git a/test/root_test/list/target/mobile/exception_list.stable b/test/root_test/list/target/mobile/exception_list.stable new file mode 100755 index 0000000..8b13789 --- /dev/null +++ b/test/root_test/list/target/mobile/exception_list.stable @@ -0,0 +1 @@ + diff --git a/test/root_test/list/target/mobile/exception_list.statble b/test/root_test/list/target/mobile/exception_list.statble deleted file mode 100755 index 8b13789..0000000 --- a/test/root_test/list/target/mobile/exception_list.statble +++ /dev/null @@ -1 +0,0 @@ -