- generate NI for System.Private.CoreLib.dll
[platform/core/dotnet/launcher.git] / packaging / dotnet-launcher.spec
1 Name:       dotnet-launcher
2 Summary:    Launchpad plugin for dotnet apps
3 Version:    2.1.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(pkgmgr-info)
18 BuildRequires: pkgconfig(pkgmgr-installer)
19 BuildRequires: pkgconfig(glib-2.0)
20 BuildRequires: pkgconfig(libsmack)
21 BuildRequires: pkgconfig(capi-appfw-app-common)
22 BuildRequires: pkgconfig(storage)
23 BuildRequires: aul-devel
24 BuildRequires: dotnet-build-tools
25
26 %if 0%{?asan_enabled}
27 BuildRequires: clang >= 3.8
28 BuildRequires: compiler-rt
29 %endif
30
31 Requires: aul
32 Requires: liblaunchpad
33 Requires: coreclr
34 Requires: mscorlib
35 Requires: corefx-native
36 Requires: corefx-managed
37
38 Requires(post): /sbin/ldconfig
39 Requires(post): /usr/bin/systemctl
40 Requires(post): /usr/bin/chsmack
41 Requires(postun): /sbin/ldconfig
42 Requires(postun): /usr/bin/systemctl
43 Requires(preun): /usr/bin/systemctl
44
45 %define _loaderdir %{_prefix}/share/aul
46 %define _device_api_dir %{dotnet_assembly_path}
47 %define _runtime_dir /usr/share/dotnet.tizen/netcoreapp
48 %define _install_mdplugin_dir /etc/package-manager/parserlib/metadata
49 %define _native_lib_dir /usr/share/dotnet.tizen/lib
50
51 ExcludeArch: aarch64
52
53 %description
54 Launchpad plugin for launching dotnet apps
55
56 %package devel
57 Summary: Libraries and Header Files for dotnet-launcher plugins and AOTC tools
58 Requires: %{name} = %{version}
59
60 %description devel
61 This package contains library and header files needed to develop plugins for dotnet-launcher
62 and AOTC tools.
63
64 %prep
65 %setup -q
66 cp %{SOURCE1} .
67
68 %build
69
70 %if 0%{?asan_enabled}
71 %define _dotnet_build_conf Debug
72 export CFLAGS=" --target=%{_host} "
73 export CXXFLAGS=" --target=%{_host} "
74 %ifarch %{ix86}
75 export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
76 export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
77 %endif
78 %endif
79
80 cmake \
81         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
82 %if 0%{?asan_enabled}
83         -DCMAKE_C_COMPILER=clang \
84         -DCMAKE_CXX_COMPILER=clang++ \
85         -DASAN_ENABLED=TRUE \
86 %endif
87         -DLIBDIR=%{_libdir} \
88         -DBINDIR=%{_bindir} \
89         -DINCLUDEDIR=%{_includedir} \
90         -DLOADERDIR=%{_loaderdir} \
91         -DCMAKE_BUILD_TYPE=%{_dotnet_build_conf} \
92         -DDEVICE_API_DIR=%{_device_api_dir} \
93         -DRUNTIME_DIR=%{_runtime_dir} \
94         -DCROSSGEN_PATH=%{_runtime_dir}/crossgen \
95         -DINSTALL_MDPLUGIN_DIR=%{_install_mdplugin_dir} \
96         -DVERSION=%{version} \
97         -DNATIVE_LIB_DIR=%{_native_lib_dir} \
98         NativeLauncher
99
100 make %{?jobs:-j%jobs} VERBOSE=1
101
102 %install
103 rm -rf %{buildroot}
104 %make_install
105
106 mkdir -p %{buildroot}%{_native_lib_dir}
107 ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so
108
109 mkdir -p %{buildroot}/etc/tmpfiles.d
110 install -m 0644 %{name}.conf %{buildroot}/etc/tmpfiles.d/%{name}.conf
111
112 %post
113 mkdir -p /opt/etc/skel/.dotnet
114 chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet
115 %{_bindir}/nitool --dll %{_runtime_dir}/System.Private.CoreLib.dll
116
117 %files
118 %manifest dotnet-launcher.manifest
119 %{_loaderdir}/dotnet.loader
120 %{_loaderdir}/dotnet.launcher
121 %{_loaderdir}/dotnet.debugger
122 %{_native_lib_dir}/libsqlite3.so
123 %{_bindir}/nitool
124 %{_bindir}/tpatool
125 %{_install_mdplugin_dir}/libprefer_dotnet_aot_plugin.so
126 %{_bindir}/dotnet-launcher
127 %{_libdir}/libdotnet_launcher_util.so
128 %{_libdir}/libni_common.so
129 /etc/tmpfiles.d/%{name}.conf
130
131 %files devel
132 %manifest dotnet-launcher.manifest
133 %defattr(-,root,root,-)
134 %{_includedir}/ni_common.h
135 %{_includedir}/dotnet_launcher_plugin.h
136 %{_includedir}/coreclr_host.h
137 %{_libdir}/libdotnet_launcher_util.so
138 %{_libdir}/libni_common.so
139 %{_libdir}/pkgconfig/dotnet-launcher.pc
140