-%{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly}
-
Name: dotnet-launcher
Summary: Launchpad plugin for dotnet apps
-Version: 1.0.1
-Release: 2
+Version: 3.0.0
+Release: 1
Group: Application Framework/Application State Management
-License: Apache License, Version 2.0
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
AutoReqProv: no
+Source1: %{name}.conf
BuildRequires: cmake
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(launchpad)
+BuildRequires: pkgconfig(liblaunchpad)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(pkgmgr-installer)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(libsmack)
+BuildRequires: pkgconfig(capi-appfw-app-common)
+BuildRequires: pkgconfig(storage)
+BuildRequires: pkgconfig(jsoncpp)
+BuildRequires: pkgconfig(openssl)
+BuildRequires: sqlite-devel
+BuildRequires: boost-devel
BuildRequires: aul-devel
-BuildRequires: mono-compiler
-BuildRequires: mono-devel
-BuildRequires: csapi-tizen-nuget
BuildRequires: dotnet-build-tools
+
+%if 0%{?asan_enabled}
+BuildRequires: clang >= 3.8
+BuildRequires: compiler-rt
+%endif
+
Requires: aul
+Requires: liblaunchpad
+Requires: coreclr
+Requires: mscorlib
+Requires: corefx-native
+Requires: corefx-managed
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
%define _loaderdir %{_prefix}/share/aul
-%define _configdir /etc
%define _device_api_dir %{dotnet_assembly_path}
-%define _runtime_dir /opt/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0
-%define _preload_dir /opt/usr/share/dotnet.tizen/preload
-%define _install_plugin_dir /usr/etc/package-manager/parserlib
+%define _runtime_dir /usr/share/dotnet.tizen/netcoreapp
+%define _framework_dir /usr/share/dotnet.tizen/framework
+%define _install_mdplugin_dir /etc/package-manager/parserlib/metadata
+%define _native_lib_dir /usr/share/dotnet.tizen/lib
+%define _tac_dir /opt/usr/dotnet
+%define _system_base_addr_file /opt/usr/dotnet.system.base.addr
+
+%define _default_base_addr_start 0x3000000
+
+ExcludeArch: aarch64
%description
Launchpad plugin for launching dotnet apps
+%package devel
+Summary: Libraries and Header Files for dotnet-launcher plugins and AOTC tools
+Requires: %{name} = %{version}
+
+%description devel
+This package contains library and header files needed to develop plugins for dotnet-launcher
+and AOTC tools.
+
%prep
%setup -q
+cp %{SOURCE1} .
%build
-%if 0%{?tizen_build_devel_mode}
-%define _buildmode Debug
-%else
-%define _buildmode Release
+
+%if 0%{?asan_enabled}
+%define _dotnet_build_conf Debug
+export CFLAGS=" --target=%{_host} "
+export CXXFLAGS=" --target=%{_host} "
+%ifarch %{ix86}
+export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
+export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
%endif
+%endif
+
+dotnet msbuild Init/Tizen.Init.csproj /t:clean
+dotnet msbuild Init/Tizen.Init.csproj /t:restore /p:RestoreSources=/nuget
+dotnet msbuild Init/Tizen.Init.csproj
+
+dotnet msbuild Managed/Dotnet.Launcher.csproj /t:clean
+dotnet msbuild Managed/Dotnet.Launcher.csproj /t:restore /p:RestoreSources=/nuget
+dotnet msbuild Managed/Dotnet.Launcher.csproj
+
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DPACKAGE_NAME=%{name} \
+%if 0%{?asan_enabled}
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
+ -DASAN_ENABLED=TRUE \
+%endif
-DLIBDIR=%{_libdir} \
-DBINDIR=%{_bindir} \
+ -DINCLUDEDIR=%{_includedir} \
-DLOADERDIR=%{_loaderdir} \
- -DCONFIGDIR=%{_configdir} \
- -DCMAKE_BUILD_TYPE=%{_buildmode} \
+ -DCMAKE_BUILD_TYPE=%{_dotnet_build_conf} \
-DDEVICE_API_DIR=%{_device_api_dir} \
-DRUNTIME_DIR=%{_runtime_dir} \
- -DCROSSGEN_PATH=%{_device_api_dir}/crossgen \
- -DCORECLR_LAUNCHER_ASSEMBLY_PATH=%{_bindir}/Tizen.Runtime.Coreclr.dll \
- -DMONO_LAUNCHER_ASSEMBLY_PATH=%{_bindir}/Tizen.Runtime.Mono.dll \
- -DINSTALL_PLUGIN_DIR=%{_install_plugin_dir} \
+ -DCROSSGEN_PATH=%{_runtime_dir}/crossgen \
+ -DINSTALL_MDPLUGIN_DIR=%{_install_mdplugin_dir} \
+ -DTAC_DIR=%{_tac_dir} \
-DVERSION=%{version} \
+ -DNATIVE_LIB_DIR=%{_native_lib_dir} \
+%if 0%{?use_default_base_addr}
+ -DUSE_DEFAULT_BASE_ADDR="" \
+%endif
+ -DUNIQUE_DEFAULT_BASE_ADDR_SUPPORT="" \
+ -DSYSTEM_BASE_FILE=%{_system_base_addr_file} \
+ -DDEFAULT_BASE_ADDR_START=%{_default_base_addr_start} \
NativeLauncher
make %{?jobs:-j%jobs} VERBOSE=1
-nuget restore Tizen.Runtime/Tizen.Runtime.Coreclr.project.json
-
-xbuild \
- /p:Configuration=%{_buildmode} \
- /p:PreloadPath=%{_preload_dir} \
- Tizen.Runtime/Tizen.Runtime.Coreclr.csproj
-
-nuget restore Tizen.Runtime/Tizen.Runtime.Mono.project.json
-
-xbuild \
- /p:Configuration=%{_buildmode} \
- /p:PreloadPath=%{_preload_dir} \
- Tizen.Runtime/Tizen.Runtime.Mono.csproj
-
%install
rm -rf %{buildroot}
%make_install
-install -p -m 644 Tizen.Runtime/bin/Tizen.Runtime.Coreclr.dll %{buildroot}%{_bindir}
-install -p -m 644 Tizen.Runtime/bin/Tizen.Runtime.Mono.dll %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_framework_dir}
+mv Init/bin/Release/Tizen.Init.dll %{buildroot}%{_framework_dir}
+mv Managed/bin/Release/Dotnet.Launcher.dll %{buildroot}%{_framework_dir}
+
+mkdir -p %{buildroot}%{_tac_dir}
+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
+%{_bindir}/dotnettool --ni-dll %{_runtime_dir}/System.Private.CoreLib.dll
%files
%manifest dotnet-launcher.manifest
%{_loaderdir}/dotnet.loader
%{_loaderdir}/dotnet.launcher
%{_loaderdir}/dotnet.debugger
-%caps(cap_mac_admin,cap_setgid=ei) %{_bindir}/dotnet-launcher
-%caps(cap_mac_admin,cap_setgid=ei) %{_bindir}/nitool
-%caps(cap_mac_admin,cap_setgid=ei) %{_install_plugin_dir}/libui-application.so
-%caps(cap_mac_admin,cap_setgid=ei) %{_bindir}/Tizen.Runtime.Coreclr.dll
-%caps(cap_mac_admin,cap_setgid=ei) %{_bindir}/Tizen.Runtime.Mono.dll
+%{_native_lib_dir}/libsqlite3.so
+%{_bindir}/nitool
+%{_bindir}/tpatool
+%{_bindir}/dotnettool
+%{_install_mdplugin_dir}/libprefer_nuget_cache_plugin.so
+%{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so
+%{_bindir}/dotnet-launcher
+%{_libdir}/libdotnet_launcher_util.so
+%{_libdir}/libni_common.so
+/etc/tmpfiles.d/%{name}.conf
+/usr/share/parser-plugins/dotnet-launcher.info
+%{_framework_dir}/Tizen.Init.dll
+%{_framework_dir}/Dotnet.Launcher.dll
+%{_tac_dir}
+
+%files devel
+%manifest dotnet-launcher.manifest
+%defattr(-,root,root,-)
+%{_includedir}/ni_common.h
+%{_includedir}/tac_common.h
+%{_includedir}/dotnet_launcher_plugin.h
+%{_includedir}/coreclr_host.h
+%{_libdir}/libdotnet_launcher_util.so
+%{_libdir}/libni_common.so
+%{_libdir}/pkgconfig/dotnet-launcher.pc