Create directories for coreclr / corefx 29/202829/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20190405.043110 submit/tizen_4.0/20190405.012155
authorWoongsuk Cho <ws77.cho@samsung.com>
Fri, 5 Apr 2019 01:13:04 +0000 (10:13 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Fri, 5 Apr 2019 01:13:04 +0000 (10:13 +0900)
 - /tmp/.dotnet : lockfiles for IPC is created under /tmp/.dotnet directory
 - /home/owner/.dotnet : intermediate cert and temporal cert chain is stored under /home/owner/.dotnet

Change-Id: I0bc26b5a148dba535da7b349cc17d5f58f2abf9a

NativeLauncher/installer-plugin/tpatool.cc [new file with mode: 0644]
packaging/dotnet-launcher.conf [new file with mode: 0755]
packaging/dotnet-launcher.spec

diff --git a/NativeLauncher/installer-plugin/tpatool.cc b/NativeLauncher/installer-plugin/tpatool.cc
new file mode 100644 (file)
index 0000000..b3c3432
--- /dev/null
@@ -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 (executable)
index 0000000..9833cd2
--- /dev/null
@@ -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"
index f780dde..1399fb3 100644 (file)
@@ -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