Source0: %{name}-%{version}.tar.gz
Source1: security-manager.manifest
Source3: libsecurity-manager-client.manifest
+Requires(post): smack
BuildRequires: cmake
BuildRequires: zip
BuildRequires: pkgconfig(dlog)
%cmake . -DVERSION=%{version} \
-DBIN_INSTALL_DIR=%{_bindir} \
+ -DDB_INSTALL_DIR=%{TZ_SYS_DB} \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
-DCMAKE_VERBOSE_MAKEFILE=ON
make %{?jobs:-j%jobs}
# update
systemctl restart security-manager.service
fi
+chsmack -a System %{TZ_SYS_DB}/.security-manager.db
+chsmack -a System %{TZ_SYS_DB}/.security-manager.db-journal
%preun
if [ $1 = 0 ]; then
%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-manager-installer.socket
%attr(-,root,root) %{_unitdir}/security-manager-installer.socket
%attr(-,root,root) %{TZ_SYS_SMACK}/app-rules-template.smack
+%config(noreplace) %attr(0600,root,root) %{TZ_SYS_DB}/.security-manager.db
+%config(noreplace) %attr(0600,root,root) %{TZ_SYS_DB}/.security-manager.db-journal
%{_datadir}/license/%{name}
%files -n libsecurity-manager-client
SET(TARGET_SERVER "security-manager")
SET(TARGET_CLIENT "security-manager-client")
SET(TARGET_COMMON "security-manager-commons")
+SET(TARGET_DB ".security-manager.db")
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(common)
${SERVER_DEP_LIBRARIES}
)
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${TARGET_DB} ${TARGET_DB}-journal
+ COMMAND sqlite3 ${TARGET_DB} <db/app-permissions-db.sql
+ )
+
+# Add a dummy build target to trigger building of ${TARGET_DB}
+ADD_CUSTOM_TARGET(DB ALL DEPENDS ${TARGET_DB})
+
INSTALL(TARGETS ${TARGET_SERVER} DESTINATION ${BIN_INSTALL_DIR})
+INSTALL(FILES ${TARGET_DB} DESTINATION ${DB_INSTALL_DIR})
+INSTALL(FILES ${TARGET_DB}-journal DESTINATION ${DB_INSTALL_DIR})