- There will be base package and sub pacakges of each profiles.
Change-Id: I5e376ce937ff0f43d4b1ab858500d45bfe68a856
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
)
ADD_SUBDIRECTORY(test)
-IF("${PROFILE}" STREQUAL "mobile" OR "${PROFILE}" STREQUAL "wearable")
ADD_SUBDIRECTORY(systemd)
-ENDIF()
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}
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
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,-)
%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
+
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
)
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
)