Support PBA on aarch64
[platform/core/dotnet/launcher.git] / packaging / dotnet-launcher.spec
1 Name:       dotnet-launcher
2 Summary:    Launchpad plugin for dotnet apps
3 Version:    3.1.3
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: sqlite-devel
27 BuildRequires: boost-devel
28 BuildRequires: aul-devel
29 BuildRequires: dotnet-build-tools
30 BuildRequires: unzip
31
32 %if 0%{?asan_enabled}
33 BuildRequires: clang >= 3.8
34 BuildRequires: compiler-rt
35 %endif
36
37 Requires: aul
38 Requires: liblaunchpad
39 Requires: coreclr
40 Requires: mscorlib
41 Requires: corefx-native
42 Requires: corefx-managed
43 Requires: jsoncpp
44
45 Requires(post): /sbin/ldconfig
46 Requires(post): /usr/bin/systemctl
47 Requires(post): /usr/bin/chsmack
48 Requires(postun): /sbin/ldconfig
49 Requires(postun): /usr/bin/systemctl
50 Requires(preun): /usr/bin/systemctl
51
52 %define _loaderdir %{_prefix}/share/aul
53 %define _device_api_dir %{dotnet_assembly_path}
54 %define _runtime_dir /usr/share/dotnet.tizen/netcoreapp
55 %define _framework_dir /usr/share/dotnet.tizen/framework
56 %define _install_mdplugin_dir /etc/package-manager/parserlib/metadata
57 %define _install_plugin_dir /etc/package-manager/parserlib
58 %define _native_lib_dir /usr/share/dotnet.tizen/lib
59 %define _dotnet_dir /opt/usr/dotnet
60 %define _system_base_addr_file /opt/usr/dotnet.system.base.addr
61
62 %define _ibc_data_dir /usr/share/dotnet.tizen/ibcdata
63 %define _tizen_preload_dir /usr/share/dotnet.tizen/preload
64
65 %define _default_base_addr_start 0x3000000
66
67 %description
68 Launchpad plugin for launching dotnet apps
69
70 %package gbs-support
71 Summary: dotnet corerun for gbs environment
72 Requires: coreclr
73 Requires: mscorlib
74 Requires: corefx-native
75 Requires: corefx-managed
76
77 %description gbs-support
78 This package contains only dotnet-corerun executable to run dotnet processes in gbs build environment
79
80 %package devel
81 Summary: Libraries and Header Files for dotnet-launcher plugins and AOTC tools
82
83 %description devel
84 This package contains library and header files needed to develop plugins for dotnet-launcher
85 and AOTC tools.
86
87 %prep
88 %setup -q
89 cp %{SOURCE1} .
90
91 %build
92
93 %if 0%{?asan_enabled}
94 %define _dotnet_build_conf Debug
95 export CFLAGS=" --target=%{_host} "
96 export CXXFLAGS=" --target=%{_host} "
97 %ifarch %{ix86}
98 export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
99 export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
100 %endif
101 %endif
102
103 dotnet msbuild Managed /t:clean
104 dotnet msbuild Managed /t:restore /p:RestoreSources=/nuget
105 dotnet msbuild Managed /p:Configuration=Release
106
107 cmake \
108         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
109 %if 0%{?asan_enabled}
110         -DCMAKE_C_COMPILER=clang \
111         -DCMAKE_CXX_COMPILER=clang++ \
112         -DASAN_ENABLED=TRUE \
113 %endif
114         -DLIBDIR=%{_libdir} \
115         -DBINDIR=%{_bindir} \
116         -DINCLUDEDIR=%{_includedir} \
117         -DLOADERDIR=%{_loaderdir} \
118         -DCMAKE_BUILD_TYPE=%{_dotnet_build_conf} \
119         -DDEVICE_API_DIR=%{_device_api_dir} \
120         -DRUNTIME_DIR=%{_runtime_dir} \
121         -DFRAMEWORK_DIR=%{_framework_dir} \
122         -DCROSSGEN_PATH=%{_runtime_dir}/crossgen \
123         -DINSTALL_MDPLUGIN_DIR=%{_install_mdplugin_dir} \
124         -DINSTALL_PLUGIN_DIR=%{_install_plugin_dir} \
125         -DDOTNET_DIR=%{_dotnet_dir} \
126         -DVERSION=%{version} \
127         -DNATIVE_LIB_DIR=%{_native_lib_dir} \
128 %ifarch %{arm} aarch64
129 %if 0%{?use_default_base_addr}
130         -DUSE_DEFAULT_BASE_ADDR="" \
131 %endif
132         -DUNIQUE_DEFAULT_BASE_ADDR_SUPPORT="" \
133         -DSYSTEM_BASE_FILE=%{_system_base_addr_file} \
134         -DDEFAULT_BASE_ADDR_START=%{_default_base_addr_start} \
135 %endif
136         NativeLauncher
137
138 make %{?jobs:-j%jobs} VERBOSE=1
139
140 %install
141 rm -rf %{buildroot}
142 %make_install
143 mkdir -p %{buildroot}%{_framework_dir}
144 mv Managed/Tizen.Runtime/bin/Release/Tizen.Runtime.dll %{buildroot}%{_framework_dir}
145
146 mkdir -p %{buildroot}%{_dotnet_dir}
147 mkdir -p %{buildroot}%{_native_lib_dir}
148 ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so
149
150 mkdir -p %{buildroot}/etc/tmpfiles.d
151 install -m 0644 %{name}.conf %{buildroot}/etc/tmpfiles.d/%{name}.conf
152
153 mkdir -p %{buildroot}%{_ibc_data_dir}
154 unzip packaging/ibcdata.zip -d %{buildroot}%{_ibc_data_dir}
155 mkdir -p %{buildroot}%{_tizen_preload_dir}
156 mv packaging/10.Dotnet.Launcher.preload %{buildroot}%{_tizen_preload_dir}
157
158 # for gbs-support
159 cp -a %{buildroot}%{_bindir}/dotnet %{buildroot}%{_bindir}/dotnet-corerun
160
161 %post
162 mkdir -p /opt/etc/skel/.dotnet
163 chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet
164
165 %files
166 %manifest dotnet-launcher.manifest
167 %{_loaderdir}/dotnet.loader
168 %{_loaderdir}/dotnet.launcher
169 %{_loaderdir}/dotnet.debugger
170 %{_loaderdir}/dotnet-nui.loader
171 %{_loaderdir}/dotnet-nui.launcher
172 %{_loaderdir}/dotnet-nui.debugger
173 %{_native_lib_dir}/libsqlite3.so
174 %{_bindir}/tpatool
175 %{_bindir}/dotnettool
176 %{_install_mdplugin_dir}/libprefer_nuget_cache_plugin.so
177 %{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so
178 %{_install_plugin_dir}/libdelete_unused_library_plugin.so
179 %{_bindir}/dotnet-launcher
180 %{_bindir}/dotnet-loader
181 %{_bindir}/dotnet
182 %{_bindir}/dotnet-hydra-loader
183 %{_libdir}/libdotnet_launcher_util.so
184 %{_libdir}/libdotnet_launcher_core.so
185 %{_libdir}/libni_common.so
186 %{_libdir}/libtac_common.so
187 /etc/tmpfiles.d/%{name}.conf
188 /usr/share/parser-plugins/dotnet-launcher.info
189 %{_framework_dir}/Tizen.Runtime.dll
190 %{_dotnet_dir}
191 %{_ibc_data_dir}
192 %{_tizen_preload_dir}
193
194 %files devel
195 %manifest dotnet-launcher.manifest
196 %defattr(-,root,root,-)
197 %{_includedir}/ni_common.h
198 %{_includedir}/tac_common.h
199 %{_includedir}/dotnet_launcher_plugin.h
200 %{_includedir}/coreclr_host.h
201 %{_libdir}/libdotnet_launcher_util.so
202 %{_libdir}/libni_common.so
203 %{_libdir}/libtac_common.so
204 %{_libdir}/pkgconfig/dotnet-launcher.pc
205
206 %files gbs-support
207 %{_bindir}/dotnet-corerun