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