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