Merge remote-tracking branch 'origin/master' into notification-service
[platform/upstream/iotivity.git] / tools / tizen / iotivity.spec
1 Name: iotivity
2 Version: 1.1.1
3 Release: 0
4 Summary: IoT Connectivity sponsored by the OIC
5 Group: Network & Connectivity/Other
6 License: Apache-2.0
7 URL: https://www.iotivity.org/
8 Source0: %{name}-%{version}.tar.bz2
9 Source1001: %{name}.manifest
10 Source1002: %{name}-test.manifest
11 BuildRequires:  gettext-tools, expat-devel
12 BuildRequires:  python, libcurl-devel
13 BuildRequires:  scons
14 BuildRequires:  openssl-devel
15 BuildRequires:  boost-devel
16 BuildRequires:  boost-thread
17 BuildRequires:  boost-system
18 BuildRequires:  boost-filesystem
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(uuid)
21 BuildRequires:  pkgconfig(capi-network-wifi)
22 BuildRequires:  pkgconfig(capi-network-bluetooth)
23 BuildRequires:  pkgconfig(glib-2.0)
24 BuildRequires:  pkgconfig(sqlite3)
25 Requires(postun): /sbin/ldconfig
26 Requires(post): /sbin/ldconfig
27
28
29 ## If tizen 2.x, RELEASE follows tizen_build_binary_release_type_eng. ##
30 ## and if tizen 3.0, RELEASE follows tizen_build_devel_mode. ##
31 %if 0%{?tizen_build_devel_mode} == 1 || 0%{?tizen_build_binary_release_type_eng} == 1
32 %define RELEASE False
33 %else
34 %define RELEASE True
35 %endif
36
37 %{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP}
38 %{!?SECURED: %define SECURED 1}
39 %{!?LOGGING: %define LOGGING True}
40 %{!?ROUTING: %define ROUTING GW}
41 %{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen}
42 %{!?ES_ROLE: %define ES_ROLE enrollee}
43 %{!?ES_SOFTAP_MODE: %define ES_SOFTAP_MODE MEDIATOR_SOFTAP}
44 %{!?VERBOSE: %define VERBOSE 1}
45
46 %description
47 An open source reference implementation of the OIC standard specifications
48 IoTivity Base Libraries are included.
49
50
51 %package service
52 Summary: Development files for %{name}
53 Group: Network & Connectivity/Service
54 Requires: %{name} = %{version}-%{release}
55
56 %description service
57 The %{name}-service package contains service libraries files for
58 developing applications that use %{name}-service.
59
60 %package test
61 Summary: Development files for %{name}
62 Group: Network & Connectivity/Testing
63 Requires: %{name} = %{version}-%{release}
64
65 %description test
66 The %{name}-test package contains example files to show
67 how the iotivity works using %{name}-test
68
69 %package devel
70 Summary: Development files for %{name}
71 Group: Network & Connectivity/Development
72 Requires: %{name} = %{version}-%{release}
73 Requires: pkgconfig
74
75 %description devel
76 The %{name}-devel package contains libraries and header files for
77 developing applications that use %{name}.
78
79 %prep
80 %setup -q
81 chmod g-w %_sourcedir/*
82
83 cp LICENSE.md LICENSE.APLv2
84 cp %{SOURCE1001} .
85 %if 0%{?tizen_version_major} < 3
86 cp %{SOURCE1002} .
87 %else
88 cp %{SOURCE1001} ./%{name}-test.manifest
89 %endif
90
91 %build
92 %define RPM_ARCH %{_arch}
93
94 %ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
95 %define RPM_ARCH "armeabi-v7a"
96 %endif
97
98 %ifarch aarch64
99 %define RPM_ARCH "arm64"
100 %endif
101
102 %ifarch x86_64
103 %define RPM_ARCH "x86_64"
104 %endif
105
106 %ifarch %{ix86}
107 %define RPM_ARCH "x86"
108 %endif
109
110 scons -j2 --prefix=%{_prefix} \
111         VERBOSE=%{VERBOSE} \
112         TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
113         RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
114         ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
115         LIB_INSTALL_DIR=%{_libdir}
116
117
118 %install
119 rm -rf %{buildroot}
120 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
121 scons install --install-sandbox=%{buildroot} --prefix=%{_prefix} \
122         TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
123         RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
124         ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
125         LIB_INSTALL_DIR=%{_libdir}
126
127
128 # For Example
129 %if %{RELEASE} == "True"
130 %define build_mode release
131 %else
132 %define build_mode debug
133 %endif
134 %define ex_install_dir %{buildroot}%{_bindir}
135 mkdir -p %{ex_install_dir}
136 cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir}
137 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir}
138 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir}
139 cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{ex_install_dir}
140 cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{ex_install_dir}
141 cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{ex_install_dir}
142 cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{ex_install_dir}
143 cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{ex_install_dir}
144 cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{ex_install_dir}
145 cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{ex_install_dir}
146 cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{ex_install_dir}
147 cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{ex_install_dir}
148 cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{ex_install_dir}
149 cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{ex_install_dir}
150 cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{ex_install_dir}
151 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{ex_install_dir}
152 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{ex_install_dir}
153 cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{ex_install_dir}
154 cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{ex_install_dir}
155 cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
156 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.dat %{ex_install_dir}
157 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.dat %{ex_install_dir}
158 cp out/tizen/*/%{build_mode}/libcoap.a %{buildroot}%{_libdir}
159 %if 0%{?SECURED} == 1
160 mkdir -p %{ex_install_dir}/provisioning
161 mkdir -p %{ex_install_dir}/provision-sample
162
163 cp ./resource/csdk/security/include/pinoxmcommon.h %{buildroot}%{_includedir}
164 cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir}
165 cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir}
166 cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir}
167 cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{buildroot}%{_libdir}/oic_svr_db_server.dat
168 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_justworks %{ex_install_dir}/provision-sample/
169 cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{ex_install_dir}/provision-sample/
170 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_randompin %{ex_install_dir}/provision-sample/
171 cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %{ex_install_dir}/provision-sample/
172
173 %endif
174
175
176 %if 0%{?tizen_version_major} < 3
177 mkdir -p %{buildroot}/%{_datadir}/license
178 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}
179 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-service
180 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test
181 %endif
182 cp resource/c_common/*.h %{buildroot}%{_includedir}
183 cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}
184 cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir}
185
186 cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
187 cp service/easy-setup/inc/*.h %{buildroot}%{_includedir}
188 cp service/easy-setup/enrollee/inc/*.h %{buildroot}%{_includedir}
189
190
191 %post -p /sbin/ldconfig
192
193 %postun -p /sbin/ldconfig
194
195 %files
196 %manifest %{name}.manifest
197 %defattr(-,root,root,-)
198 %{_libdir}/liboc.so
199 %{_libdir}/liboc_logger.so
200 %{_libdir}/liboc_logger_core.so
201 %{_libdir}/liboctbstack.so
202 %{_libdir}/libconnectivity_abstraction.so
203 %if 0%{?tizen_version_major} < 3
204 %{_datadir}/license/%{name}
205 %else
206 %license LICENSE.APLv2
207 %endif
208
209 %files service
210 %manifest %{name}.manifest
211 %defattr(-,root,root,-)
212 %{_libdir}/libBMISensorBundle.so
213 %{_libdir}/libDISensorBundle.so
214 %{_libdir}/libresource_hosting.so
215 %{_libdir}/libTGMSDKLibrary.so
216 %{_libdir}/libHueBundle.so
217 %{_libdir}/librcs_client.so
218 %{_libdir}/librcs_common.so
219 %{_libdir}/librcs_container.so
220 %{_libdir}/librcs_server.so
221 %{_libdir}/libESEnrolleeSDK.so
222 %if 0%{?SECURED} == 1
223 %{_libdir}/libocpmapi.so
224 %{_libdir}/libocprovision.so
225 %{_libdir}/oic_svr_db_server.dat
226 %endif
227 %if 0%{?tizen_version_major} < 3
228 %{_datadir}/license/%{name}-service
229 %else
230 %license LICENSE.APLv2
231 %endif
232
233 %files test
234 %manifest %{name}-test.manifest
235 %defattr(-,root,root,-)
236 %{_bindir}/*
237 %if 0%{?tizen_version_major} < 3
238 %{_datadir}/license/%{name}-test
239 %else
240 %license LICENSE.APLv2
241 %endif
242
243 %files devel
244 %defattr(-,root,root,-)
245 %{_libdir}/lib*.a
246 %{_libdir}/pkgconfig/%{name}.pc
247 %{_includedir}/*