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