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