Release 4.0.0-preview1-00099
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizenfx.spec
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 # If tizenfx_use_prebuilt is 1, use prebuilt binaries instead of building source at gbs build.
7 # Default value is 1, if want to build source at gbs build, set tizenfx_use_prebuilt to 0.
8 %define _tizenfx_use_prebuilt %{?tizenfx_use_prebuilt:%{tizenfx_use_prebuilt}}%{!?tizenfx_use_prebuilt:1}
9 %define _tizenfx_bin_path Artifacts
10
11 Name:       csapi-tizenfx
12 Summary:    Assemblies of Tizen .NET
13 Version:    4.0.0.99
14 Release:    1
15 Group:      Development/Libraries
16 License:    Apache-2.0
17 URL:        https://www.tizen.org
18 Source0:    %{name}-%{version}.tar.gz
19 Source1:    %{name}.manifest
20
21 BuildRequires: dotnet-build-tools
22
23 BuildArch: noarch
24 AutoReqProv: no
25
26 %description
27 %{summary}
28
29 %package nuget
30 Summary:   NuGet package for %{name}
31 Group:     Development/Libraries
32 AutoReqProv: no
33
34 %description nuget
35 NuGet package for %{name}
36
37 %package dummy
38 Summary:   Dummy assemblies of Tizen .NET
39 Group:     Development/Libraries
40 AutoReqProv: no
41
42 %description dummy
43 Dummy assemblies of Tizen .NET
44
45 %package full
46 Summary:   All Tizen .NET assemblies
47 Group:     Development/Libraries
48 AutoReqProv: no
49
50 %description full
51 All Tizen .NET assemblies
52
53 %package debug
54 Summary:   All .pdb files of Tizen .NET
55 Group:     Development/Libraries
56 AutoReqProv: no
57
58 %description debug
59 All .pdb files of Tizen .NET
60
61 %package common
62 Summary:   Tizen .NET assemblies for Common profile
63 Group:     Development/Libraries
64 Requires:  csapi-tizenfx-dummy
65 AutoReqProv: no
66
67 %description common
68 Tizen .NET assemblies for Common profile
69
70 %package mobile
71 Summary:   Tizen .NET assemblies for Mobile profile
72 Group:     Development/Libraries
73 Requires:  csapi-tizenfx-dummy
74 AutoReqProv: no
75
76 %description mobile
77 Tizen .NET assemblies for Mobile profile
78
79 %package mobile-emul
80 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
81 Group:     Development/Libraries
82 Requires:  csapi-tizenfx-dummy
83 AutoReqProv: no
84
85 %description mobile-emul
86 Tizen .NET assemblies for Emulator of Mobile profile
87
88 %package tv
89 Summary:   Tizen .NET assemblies for TV profile
90 Group:     Development/Libraries
91 Requires:  csapi-tizenfx-dummy
92 AutoReqProv: no
93
94 %description tv
95 Tizen .NET assemblies for TV profile
96
97 %package ivi
98 Summary:   Tizen .NET assemblies for IVI profile
99 Group:     Development/Libraries
100 Requires:  csapi-tizenfx-dummy
101 AutoReqProv: no
102
103 %description ivi
104 Tizen .NET assemblies for IVI profile
105
106 %package wearable
107 Summary:   Tizen .NET assemblies for Wearable profile
108 Group:     Development/Libraries
109 Requires:  csapi-tizenfx-dummy
110 AutoReqProv: no
111
112 %description wearable
113 Tizen .NET assemblies for Wearable profile
114
115 %prep
116 %setup -q
117 cp %{SOURCE1} .
118
119 %build
120
121 GetFileList() {
122   PROFILE=$1
123   cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
124 }
125
126 GetFileList common > common.filelist
127 GetFileList mobile > mobile.filelist
128 GetFileList mobile-emul > mobile-emul.filelist
129 GetFileList tv > tv.filelist
130 GetFileList ivi > ivi.filelist
131 GetFileList wearable > wearable.filelist
132
133 %if ! %{_tizenfx_use_prebuilt}
134   rm -fr %{_tizenfx_bin_path}/bin
135   rm -f %{_tizenfx_bin_path}/*.nupkg
136   export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
137   ./build.sh --full
138   ./build.sh --pack
139 %endif
140
141 %install
142 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
143 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
144 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
145 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
146
147 install -p -m 644 %{_tizenfx_bin_path}/bin/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
148 install -p -m 644 %{_tizenfx_bin_path}/bin/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
149 install -p -m 644 %{_tizenfx_bin_path}/bin/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
150 install -p -m 644 %{_tizenfx_bin_path}/bin_dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
151 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
152
153 %files nuget
154 %{DOTNET_NUGET_SOURCE}/*.nupkg
155
156 %files dummy
157 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
158
159 %files full
160 %manifest %{name}.manifest
161 %license LICENSE
162 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
163 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
164
165 %files debug
166 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
167
168 %files common -f common.filelist
169 %manifest %{name}.manifest
170 %license LICENSE
171
172 %files mobile -f mobile.filelist
173 %manifest %{name}.manifest
174 %license LICENSE
175
176 %files mobile-emul -f mobile-emul.filelist
177 %manifest %{name}.manifest
178 %license LICENSE
179
180 %files tv -f tv.filelist
181 %manifest %{name}.manifest
182 %license LICENSE
183
184 %files ivi -f ivi.filelist
185 %manifest %{name}.manifest
186 %license LICENSE
187
188 %files wearable -f wearable.filelist
189 %manifest %{name}.manifest
190 %license LICENSE