[Build] Add APITool to csapi-tizenfx-tools rpm package
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizenfx.spec.in
1
2 %define TIZEN_NET_API_VERSION @api_version@
3 %define TIZEN_NET_RPM_VERSION @rpm_version@
4 %define TIZEN_NET_NUGET_VERSION @nuget_version@
5
6 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
7 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
8 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
9 %define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
10 %define DOTNET_NUGET_SOURCE /nuget
11
12 Name:       csapi-tizenfx
13 Summary:    Assemblies of Tizen .NET
14 Version:    %{TIZEN_NET_RPM_VERSION}
15 Release:    1
16 Group:      Development/Libraries
17 License:    Apache-2.0 and MIT
18 URL:        https://www.tizen.org
19 Source0:    %{name}-%{version}.tar.gz
20 Source1:    %{name}.manifest
21
22 BuildArch:   noarch
23 ExcludeArch: aarch64
24 AutoReqProv: no
25
26 BuildRequires: dotnet-build-tools
27 Requires(post): /usr/bin/vconftool
28
29 %description
30 %{summary}
31
32 %package nuget
33 Summary:   NuGet package for %{name}
34 Group:     Development/Libraries
35 AutoReqProv: no
36
37 %description nuget
38 NuGet package for %{name}
39
40 %package tools
41 Summary:   Tools for TizenFX
42 Group:     Development/Libraries
43 AutoReqProv: no
44
45 %description tools
46 Tools for TizenFX
47
48 %package dummy
49 Summary:   not used package
50 Group:     Development/Libraries
51 AutoReqProv: no
52
53 %description dummy
54 not used package
55
56 %package full
57 Summary:   All Tizen .NET assemblies
58 Group:     Development/Libraries
59 Requires:  %{name} = %{version}-%{release}
60 AutoReqProv: no
61
62 %description full
63 All Tizen .NET assemblies
64
65 %package debug
66 Summary:   All .pdb files of Tizen .NET
67 Group:     Development/Libraries
68 AutoReqProv: no
69
70 %description debug
71 All .pdb files of Tizen .NET
72
73 %package common
74 Summary:   Tizen .NET assemblies for Common profile
75 Group:     Development/Libraries
76 Requires:  %{name} = %{version}-%{release}
77 AutoReqProv: no
78
79 %description common
80 Tizen .NET assemblies for Common profile
81
82 %package mobile
83 Summary:   Tizen .NET assemblies for Mobile profile
84 Group:     Development/Libraries
85 Requires:  %{name} = %{version}-%{release}
86 AutoReqProv: no
87
88 %description mobile
89 Tizen .NET assemblies for Mobile profile
90
91 %package mobile-emul
92 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
93 Group:     Development/Libraries
94 Requires:  %{name} = %{version}-%{release}
95 AutoReqProv: no
96
97 %description mobile-emul
98 Tizen .NET assemblies for Emulator of Mobile profile
99
100 %package tv
101 Summary:   Tizen .NET assemblies for TV profile
102 Group:     Development/Libraries
103 Requires:  %{name} = %{version}-%{release}
104 AutoReqProv: no
105
106 %description tv
107 Tizen .NET assemblies for TV profile
108
109 %package wearable
110 Summary:   Tizen .NET assemblies for Wearable profile
111 Group:     Development/Libraries
112 Requires:  %{name} = %{version}-%{release}
113 AutoReqProv: no
114
115 %description wearable
116 Tizen .NET assemblies for Wearable profile
117
118 %prep
119 %setup -q
120 cp %{SOURCE1} .
121
122 %build
123 %{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
124
125 %define _tizenfx_bin_path Artifacts
126
127 rm -fr %{_tizenfx_bin_path}
128 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
129
130 %define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
131 %{build_cmd} --full
132 %{build_cmd} --dummy
133 %{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
134
135 GetFileList() {
136   PROFILE=$1
137   cat packaging/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
138   for f in $(cat packaging/PlatformFileList.txt | grep -v -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1); do
139     if [ -f %{_tizenfx_bin_path}/bin/dummy/$f ]; then
140       echo "%{DOTNET_ASSEMBLY_PATH}/ref/$f"
141     fi
142   done
143 }
144
145 GetFileList common > common.filelist
146 GetFileList mobile > mobile.filelist
147 GetFileList mobile-emul > mobile-emul.filelist
148 GetFileList tv > tv.filelist
149 GetFileList wearable > wearable.filelist
150
151 %install
152 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
153 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
154 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
155 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
156 mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
157
158 # Install Runtime Assemblies
159 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
160 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
161
162 # Install Debug Symbols
163 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
164 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
165
166 # Install Resource files
167 [ -d %{_tizenfx_bin_path}/bin/public/res ] \
168   && install -p -m 644 %{_tizenfx_bin_path}/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
169 [ -d %{_tizenfx_bin_path}/bin/internal/res ] \
170   && install -p -m 644 %{_tizenfx_bin_path}/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
171
172 # Install Dummy Assemblies
173 install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
174
175 # Install NuGet Packages
176 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
177 install -p -m 644 packaging/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
178
179 # Install Tools
180 install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
181
182 %post
183 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
184 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
185
186 %files
187 %license LICENSE
188
189 %files nuget
190 %{DOTNET_NUGET_SOURCE}/*.nupkg
191
192 %files tools
193 %manifest %{name}.manifest
194 %{DOTNET_TOOLS_PATH}/*
195
196 %files dummy
197
198 %files full
199 %manifest %{name}.manifest
200 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
201 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
202 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
203
204 %files debug
205 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
206
207 %files common -f common.filelist
208 %manifest %{name}.manifest
209
210 %files mobile -f mobile.filelist
211 %manifest %{name}.manifest
212
213 %files mobile-emul -f mobile-emul.filelist
214 %manifest %{name}.manifest
215
216 %files tv -f tv.filelist
217 %manifest %{name}.manifest
218
219 %files wearable -f wearable.filelist
220 %manifest %{name}.manifest