diff options
-rw-r--r-- | NativeLauncher/installer-plugin/tpatool.cc | 46 | ||||
-rwxr-xr-x | packaging/dotnet-launcher.conf | 13 | ||||
-rw-r--r-- | packaging/dotnet-launcher.spec | 11 |
3 files changed, 70 insertions, 0 deletions
diff --git a/NativeLauncher/installer-plugin/tpatool.cc b/NativeLauncher/installer-plugin/tpatool.cc new file mode 100644 index 0000000..b3c3432 --- /dev/null +++ b/NativeLauncher/installer-plugin/tpatool.cc @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +#include <fstream> +#include <string> +#include <iostream> + +#include "utils.h" + +const char* RUNTIME_DIR = "/usr/share/dotnet.tizen/netcoreapp"; +const char* TIZENFX_DIR = "/usr/share/dotnet.tizen/framework"; +const char* TIZENFX_REF_DIR = "/usr/share/dotnet.tizen/framework/ref"; +const char* TPA_CACHE_FILE = "/usr/share/dotnet.tizen/lib/platform_tpa_cache"; + + +int main(int argc, char* argv[]) +{ + std::string tpaList; + std::vector<std::string> tpaDir; + + tpaDir.push_back(RUNTIME_DIR); + tpaDir.push_back(TIZENFX_DIR); + tpaDir.push_back(TIZENFX_REF_DIR); + + assembliesInDirectory(tpaDir, tpaList); + + std::ofstream out("TPA_CACHE_FILE"); + out << tpaList; + out.close(); + + return 0; +} + diff --git a/packaging/dotnet-launcher.conf b/packaging/dotnet-launcher.conf new file mode 100755 index 0000000..9833cd2 --- /dev/null +++ b/packaging/dotnet-launcher.conf @@ -0,0 +1,13 @@ +d /tmp/.dotnet 1777 root users +t /tmp/.dotnet - - - - security.SMACK64="User::App::Shared" +t /tmp/.dotnet - - - - security.SMACK64TRANSMUTE="TRUE" +d /tmp/.dotnet/lockfiles 1777 root users +t /tmp/.dotnet/lockfiles - - - - security.SMACK64="User::App::Shared" +d /tmp/.dotnet/lockfiles/global 1777 root users +t /tmp/.dotnet/lockfiles/global - - - - security.SMACK64="User::App::Shared" +t /tmp/.dotnet/lockfiles/global - - - - security.SMACK64TRANSMUTE="TRUE" +d /tmp/.dotnet/shm 1777 root users +t /tmp/.dotnet/shm - - - - security.SMACK64="User::App::Shared" +d /tmp/.dotnet/shm/global 1777 root users +t /tmp/.dotnet/shm/global - - - - security.SMACK64="User::App::Shared" +t /tmp/.dotnet/shm/global - - - - security.SMACK64TRANSMUTE="TRUE" diff --git a/packaging/dotnet-launcher.spec b/packaging/dotnet-launcher.spec index f780dde..1399fb3 100644 --- a/packaging/dotnet-launcher.spec +++ b/packaging/dotnet-launcher.spec @@ -6,6 +6,7 @@ Group: Application Framework/Application State Management License: Apache-2.0 Source0: %{name}-%{version}.tar.gz AutoReqProv: no +Source1: %{name}.conf BuildRequires: cmake BuildRequires: pkgconfig(aul) @@ -25,6 +26,7 @@ Requires: launchpad Requires(post): /sbin/ldconfig Requires(post): /usr/bin/systemctl +Requires(post): /usr/bin/chsmack Requires(postun): /sbin/ldconfig Requires(postun): /usr/bin/systemctl Requires(preun): /usr/bin/systemctl @@ -46,6 +48,7 @@ Launchpad plugin for launching dotnet apps %prep %setup -q +cp %{SOURCE1} . %build cmake \ @@ -75,6 +78,13 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{_native_lib_dir} ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so +mkdir -p %{buildroot}/etc/tmpfiles.d +install -m 0644 %{name}.conf %{buildroot}/etc/tmpfiles.d/%{name}.conf + +%post +mkdir -p /opt/etc/skel/.dotnet +chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet + %files %manifest dotnet-launcher.manifest %{_loaderdir}/dotnet.loader @@ -86,4 +96,5 @@ ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so %{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so %{_bindir}/dotnet-launcher %attr(700,root,root) %{_rw_update_scripts_dir}/595.dotnet-launcher.regen_ni.patch.sh +/etc/tmpfiles.d/%{name}.conf |