e44f13aa44a5682f4e297badb18fa3f687861824
[platform/core/dotnet/launcher.git] / packaging / dotnet-launcher.spec
1 Name:       dotnet-launcher
2 Summary:    Launchpad plugin for dotnet apps
3 Version:    6.0.0
4 Release:    1
5 Group:      Application Framework/Application State Management
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 AutoReqProv: no
9 Source1: %{name}.conf
10
11 BuildRequires: cmake
12 BuildRequires: pkgconfig(aul)
13 BuildRequires: pkgconfig(bundle)
14 BuildRequires: pkgconfig(dlog)
15 BuildRequires: pkgconfig(ecore)
16 BuildRequires: pkgconfig(liblaunchpad)
17 BuildRequires: pkgconfig(liblaunchpad-hydra)
18 BuildRequires: pkgconfig(pkgmgr-info)
19 BuildRequires: pkgconfig(pkgmgr-installer)
20 BuildRequires: pkgconfig(glib-2.0)
21 BuildRequires: pkgconfig(libsmack)
22 BuildRequires: pkgconfig(capi-appfw-app-common)
23 BuildRequires: pkgconfig(storage)
24 BuildRequires: pkgconfig(jsoncpp)
25 BuildRequires: pkgconfig(openssl1.1)
26 BuildRequires: pkgconfig(libsystemd)
27 BuildRequires: pkgconfig(libtzplatform-config)
28 BuildRequires: sqlite-devel
29 BuildRequires: boost-devel
30 BuildRequires: aul-devel
31 BuildRequires: dotnet-build-tools
32 BuildRequires: unzip
33 BuildRequires: coreclr-devel
34
35 %if 0%{?asan_enabled}
36 BuildRequires: clang >= 3.8
37 BuildRequires: compiler-rt
38 %endif
39
40 Requires: aul
41 Requires: liblaunchpad
42 Requires: coreclr
43 Requires: mscorlib
44 Requires: corefx-native
45 Requires: corefx-managed
46 Requires: jsoncpp
47
48 Requires(post): /sbin/ldconfig
49 Requires(post): /usr/bin/systemctl
50 Requires(post): /usr/bin/chsmack
51 Requires(postun): /sbin/ldconfig
52 Requires(postun): /usr/bin/systemctl
53 Requires(preun): /usr/bin/systemctl
54
55 %define _loaderdir %{_prefix}/share/aul
56 %define _device_api_dir %{dotnet_assembly_path}
57 %define _runtime_dir /usr/share/dotnet.tizen/netcoreapp
58 %define _framework_dir /usr/share/dotnet.tizen/framework
59 %define _install_mdplugin_dir /etc/package-manager/parserlib/metadata
60 %define _install_plugin_dir /etc/package-manager/parserlib
61 %define _native_lib_dir /usr/share/dotnet.tizen/lib
62 %define _dotnet_dir /opt/usr/dotnet
63 %define _readonly_app_update_dir /opt/usr/dotnet/apps
64 %define _system_base_addr_file /opt/usr/dotnet.system.base.addr
65 %define _tizen_preload_dir /usr/share/dotnet.tizen/preload
66
67 %ifarch x86_64 aarch64
68 %define _default_base_addr_start 0x6000000000
69 %endif
70
71 %ifarch %{arm}
72 %define _default_base_addr_start 0x30000000
73 %endif
74
75 %define _rw_update_scripts_dir /usr/share/upgrade/scripts
76 %define _rw_dotnet_update_script 715.dotnet_regen_app_ni.patch.sh
77
78 %define _build_dotnet_plugin 0
79
80 %description
81 Launchpad plugin for launching dotnet apps
82
83 %package gbs-support
84 Summary: dotnet corerun for gbs environment
85 Requires: coreclr
86 Requires: mscorlib
87 Requires: corefx-native
88 Requires: corefx-managed
89
90 %description gbs-support
91 This package contains only dotnet-corerun executable to run dotnet processes in gbs build environment
92
93 %package devel
94 Summary: Libraries and Header Files for dotnet-launcher plugins and AOTC tools
95
96 %description devel
97 This package contains library and header files needed to develop plugins for dotnet-launcher
98 and AOTC tools.
99
100 %prep
101 %setup -q
102 cp %{SOURCE1} .
103
104 %build
105
106 %if 0%{?asan_enabled}
107 %define _dotnet_build_conf Debug
108 export CFLAGS=" --target=%{_host} "
109 export CXXFLAGS=" --target=%{_host} "
110 %ifarch %{ix86}
111 export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
112 export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
113 %endif
114 %endif
115
116 %ifarch x86_64 aarch64
117 export CFLAGS+=" -DBIT64 -DHOST_64BIT "
118 export CXXFLAGS+=" -DBIT64 -DHOST_64BIT "
119 %endif
120
121 dotnet msbuild Managed /t:clean
122 dotnet msbuild Managed /t:restore /p:RestoreSources=/nuget
123 dotnet msbuild Managed /p:Configuration=Release
124
125 cmake \
126         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
127 %if 0%{?asan_enabled}
128         -DCMAKE_C_COMPILER=clang \
129         -DCMAKE_CXX_COMPILER=clang++ \
130         -DASAN_ENABLED=TRUE \
131 %endif
132         -DLIBDIR=%{_libdir} \
133         -DBINDIR=%{_bindir} \
134         -DINCLUDEDIR=%{_includedir} \
135         -DLOADERDIR=%{_loaderdir} \
136         -DCMAKE_BUILD_TYPE=%{_dotnet_build_conf} \
137         -DDEVICE_API_DIR=%{_device_api_dir} \
138         -DRUNTIME_DIR=%{_runtime_dir} \
139         -DFRAMEWORK_DIR=%{_framework_dir} \
140         -DCROSSGEN_PATH=%{_runtime_dir}/crossgen \
141         -DINSTALL_MDPLUGIN_DIR=%{_install_mdplugin_dir} \
142         -DINSTALL_PLUGIN_DIR=%{_install_plugin_dir} \
143         -DDOTNET_DIR=%{_dotnet_dir} \
144         -DREAD_ONLY_APP_UPDATE_DIR=%{_readonly_app_update_dir} \
145         -DVERSION=%{version} \
146         -DNATIVE_LIB_DIR=%{_native_lib_dir} \
147 %ifarch %{arm} aarch64
148 %if 0%{?use_default_base_addr}
149         -DUSE_DEFAULT_BASE_ADDR="" \
150 %endif
151         -DUNIQUE_DEFAULT_BASE_ADDR_SUPPORT="" \
152         -DSYSTEM_BASE_FILE=%{_system_base_addr_file} \
153         -DDEFAULT_BASE_ADDR_START=%{_default_base_addr_start} \
154 %endif
155 %if 0%{_build_dotnet_plugin}
156         -DBUILD_DOTNET_PLUGIN="" \
157 %endif
158         NativeLauncher
159
160 make %{?jobs:-j%jobs} VERBOSE=1
161
162 %install
163 rm -rf %{buildroot}
164 %make_install
165 mkdir -p %{buildroot}%{_framework_dir}
166 mv Managed/Tizen.Runtime/bin/Release/Tizen.Runtime.dll %{buildroot}%{_framework_dir}
167 mv Managed/Tizen.Runtime/bin/Release/Tizen.Runtime.pdb %{buildroot}%{_framework_dir}
168
169 mkdir -p %{buildroot}%{_dotnet_dir}
170 mkdir -p %{buildroot}%{_readonly_app_update_dir}
171 mkdir -p %{buildroot}%{_native_lib_dir}
172 ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so
173
174 mkdir -p %{buildroot}%{_tmpfilesdir}
175 install -m 0644 %{name}.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf
176
177 mkdir -p %{buildroot}%{_tizen_preload_dir}
178 mv packaging/10.Dotnet.Launcher.preload %{buildroot}%{_tizen_preload_dir}
179
180 # for gbs-support
181 cp -a %{buildroot}%{_bindir}/dotnet %{buildroot}%{_bindir}/dotnet-corerun
182
183 # for crossgen2-support
184 cp -a %{buildroot}%{_bindir}/dotnet %{buildroot}%{_bindir}/dotnet-inhouse
185
186 # to support fota upgrade
187 mkdir -p %{buildroot}/%{_rw_update_scripts_dir}
188 install -m 0755 packaging/%{_rw_dotnet_update_script} %{buildroot}/%{_rw_update_scripts_dir}/%{_rw_dotnet_update_script}
189
190 %post
191 mkdir -p /opt/etc/skel/.dotnet
192 chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet
193 ln -sf /usr/bin/dotnet-loader /usr/bin/dotnet-nui-loader
194 chsmack -a User /usr/bin/dotnet-nui-loader
195
196 %files
197 %manifest dotnet-launcher.manifest
198 %{_loaderdir}/dotnet.loader
199 %{_loaderdir}/dotnet.launcher
200 %{_loaderdir}/dotnet.debugger
201 %{_loaderdir}/dotnet-nui.loader
202 %{_loaderdir}/dotnet-nui.launcher
203 %{_loaderdir}/dotnet-nui.debugger
204 %{_native_lib_dir}/libsqlite3.so
205 %{_bindir}/tpatool
206 %{_bindir}/dotnettool
207 %{_install_mdplugin_dir}/libprefer_nuget_cache_plugin.so
208 %{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so
209 %{_install_plugin_dir}/libdotnet_apptype_plugin.so
210 %{_bindir}/dotnet-launcher
211 %{_bindir}/dotnet-loader
212 %{_bindir}/dotnet
213 %{_bindir}/dotnet-inhouse
214 %{_bindir}/dotnet-hydra-loader
215 %{_libdir}/libdotnet_launcher_util.so
216 %{_libdir}/libdotnet_launcher_core.so
217 %{_libdir}/libni_common.so
218 %{_libdir}/libtac_common.so
219 %{_libdir}/libprofile_common.so
220 %{_libdir}/libprivilege_common.so
221 %{_libdir}/libmulti_target_resolver.so
222 %{_tmpfilesdir}/%{name}.conf
223 /usr/share/parser-plugins/dotnet-launcher.info
224 %{_framework_dir}/Tizen.Runtime.dll
225 %{_dotnet_dir}
226 %{_readonly_app_update_dir}
227 %{_tizen_preload_dir}
228 %{_rw_update_scripts_dir}/%{_rw_dotnet_update_script}
229 %if 0%{_build_dotnet_plugin}
230 %{_native_lib_dir}/libdotnet_plugin.so
231 %endif
232
233 %files devel
234 %manifest dotnet-launcher.manifest
235 %defattr(-,root,root,-)
236 %{_includedir}/ni_common.h
237 %{_includedir}/tac_common.h
238 %{_includedir}/profile_common.h
239 %{_includedir}/privilege_common.h
240 %{_includedir}/dotnet_launcher_plugin.h
241 %{_includedir}/coreclr_host.h
242 %{_libdir}/libdotnet_launcher_util.so
243 %{_libdir}/libni_common.so
244 %{_libdir}/libtac_common.so
245 %{_libdir}/libprofile_common.so
246 %{_libdir}/libprivilege_common.so
247 %{_libdir}/pkgconfig/dotnet-launcher.pc
248 %{_framework_dir}/Tizen.Runtime.pdb
249
250 %files gbs-support
251 %{_bindir}/dotnet-corerun