b8d0c58b5eed8d5c98be2dd4538d113a87dcdb2a
[platform/core/dotnet/launcher.git] / packaging / dotnet-launcher.spec
1 Name:       dotnet-launcher
2 Summary:    Launchpad plugin for dotnet apps
3 Version:    6.0.9
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-uts-loader
194 chsmack -a User /usr/bin/dotnet-uts-loader
195
196 %files
197 %manifest dotnet-launcher.manifest
198 %{_loaderdir}/dotnet.loader
199 %{_loaderdir}/dotnet.launcher
200 %{_loaderdir}/dotnet.debugger
201 %{_native_lib_dir}/libsqlite3.so
202 %{_bindir}/tpatool
203 %{_bindir}/dotnettool
204 %{_install_mdplugin_dir}/libprefer_nuget_cache_plugin.so
205 %{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so
206 %{_install_plugin_dir}/libdotnet_apptype_plugin.so
207 %{_bindir}/dotnet-launcher
208 %{_bindir}/dotnet-loader
209 %{_bindir}/dotnet
210 %{_bindir}/dotnet-inhouse
211 %{_bindir}/dotnet-hydra-loader
212 %{_libdir}/libdotnet_launcher_util.so
213 %{_libdir}/libdotnet_launcher_core.so
214 %{_libdir}/libni_common.so
215 %{_libdir}/libtac_common.so
216 %{_libdir}/libprofile_common.so
217 %{_libdir}/libprivilege_common.so
218 %{_libdir}/libmulti_target_resolver.so
219 %{_tmpfilesdir}/%{name}.conf
220 /usr/share/parser-plugins/dotnet-launcher.info
221 %{_framework_dir}/Tizen.Runtime.dll
222 %{_dotnet_dir}
223 %{_readonly_app_update_dir}
224 %{_tizen_preload_dir}
225 %{_rw_update_scripts_dir}/%{_rw_dotnet_update_script}
226 %if 0%{_build_dotnet_plugin}
227 %{_native_lib_dir}/libdotnet_plugin.so
228 %endif
229
230 %files devel
231 %manifest dotnet-launcher.manifest
232 %defattr(-,root,root,-)
233 %{_includedir}/ni_common.h
234 %{_includedir}/tac_common.h
235 %{_includedir}/tac_installer.h
236 %{_includedir}/profile_common.h
237 %{_includedir}/privilege_common.h
238 %{_includedir}/dotnet_launcher_plugin.h
239 %{_includedir}/coreclr_host.h
240 %{_libdir}/libdotnet_launcher_util.so
241 %{_libdir}/libni_common.so
242 %{_libdir}/libtac_common.so
243 %{_libdir}/libprofile_common.so
244 %{_libdir}/libprivilege_common.so
245 %{_libdir}/pkgconfig/dotnet-launcher.pc
246 %{_framework_dir}/Tizen.Runtime.pdb
247
248 %files gbs-support
249 %{_bindir}/dotnet-corerun