d823452f9f9412b34470ee0e8e10515b6bd04ca4
[platform/upstream/iotivity.git] / packaging / 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:  boost-devel
15 BuildRequires:  pkgconfig(dlog)
16 BuildRequires:  pkgconfig(uuid)
17 BuildRequires:  pkgconfig(capi-network-wifi)
18 BuildRequires:  pkgconfig(capi-network-bluetooth)
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(sqlite3)
21 Requires(postun): /sbin/ldconfig
22 Requires(post): /sbin/ldconfig
23 %if 0%{?speedpython:1} && 0%{?en_speedpython:1}
24 %en_speedpython
25 %endif
26
27 # default is RELEASE mode.
28 # If DEBUG mode is needed, please use tizen_build_devel_mode
29 %define RELEASE True
30
31 %{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP}
32 %{!?LOGGING: %define LOGGING True}
33 %{!?ROUTING: %define ROUTING GW}
34 %{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen}
35 %{!?ES_ROLE: %define ES_ROLE enrollee}
36 %{!?ES_SOFTAP_MODE: %define ES_SOFTAP_MODE MEDIATOR_SOFTAP}
37 %{!?VERBOSE: %define VERBOSE 0}
38
39 %description
40 An open source reference implementation of the OIC standard specifications
41 IoTivity Base Libraries are included.
42
43
44 %package service
45 Summary: Development files for %{name}
46 Group: Network & Connectivity/Service
47 Requires: %{name} = %{version}-%{release}
48
49 %description service
50 The %{name}-service package contains service libraries files for
51 developing applications that use %{name}-service.
52
53 %package test
54 Summary: Development files for %{name}
55 Group: Network & Connectivity/Testing
56 Requires: %{name} = %{version}-%{release}
57
58 %description test
59 The %{name}-test package contains example files to show
60 how the iotivity works using %{name}-test
61
62 %package devel
63 Summary: Development files for %{name}
64 Group: Network & Connectivity/Development
65 Requires: %{name} = %{version}-%{release}
66 Requires: pkgconfig
67
68 %description devel
69 The %{name}-devel package contains libraries and header files for
70 developing applications that use %{name}.
71
72 %prep
73 %setup -q
74 chmod g-w %_sourcedir/*
75
76 cp LICENSE.md LICENSE.APLv2
77 cp %{SOURCE1001} .
78 %if 0%{?tizen_version_major} < 3
79 cp %{SOURCE1002} .
80 %else
81 cp %{SOURCE1001} ./%{name}-test.manifest
82 %endif
83
84 %build
85 %define RPM_ARCH %{_arch}
86
87 %ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
88 %define RPM_ARCH "armeabi-v7a"
89 %endif
90
91 %ifarch aarch64
92 %define RPM_ARCH "arm64"
93 %endif
94
95 %ifarch x86_64
96 %define RPM_ARCH "x86_64"
97 %endif
98
99 %ifarch %{ix86}
100 %define RPM_ARCH "x86"
101 %endif
102
103 %define JOB "-j4"
104
105 %if 0%{?speedpython}
106 %define JOB %{?_smp_mflags}
107 %endif
108
109 scons %{JOB} --prefix=%{_prefix} \
110         VERBOSE=%{VERBOSE} \
111         TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
112         RELEASE=%{RELEASE} SECURED=1 LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
113         ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
114         LIB_INSTALL_DIR=%{_libdir}
115
116
117 %install
118 rm -rf %{buildroot}
119 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
120 scons install --install-sandbox=%{buildroot} --prefix=%{_prefix} \
121         TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
122         RELEASE=%{RELEASE} SECURED=1 LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
123         ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
124         LIB_INSTALL_DIR=%{_libdir}
125
126
127 # For Example
128 %if %{RELEASE} == "True"
129 %define build_mode release
130 %else
131 %define build_mode debug
132 %endif
133 %define ex_install_dir %{buildroot}%{_bindir}
134 mkdir -p %{ex_install_dir}
135 cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir}
136 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir}
137 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir}
138 cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{ex_install_dir}
139 cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{ex_install_dir}
140 cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{ex_install_dir}
141 cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{ex_install_dir}
142 cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{ex_install_dir}
143 cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{ex_install_dir}
144 cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{ex_install_dir}
145 cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{ex_install_dir}
146 cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{ex_install_dir}
147 cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{ex_install_dir}
148 cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{ex_install_dir}
149 cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{ex_install_dir}
150 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{ex_install_dir}
151 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{ex_install_dir}
152 cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{ex_install_dir}
153 cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{ex_install_dir}
154 cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
155 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.dat %{ex_install_dir}
156 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.dat %{ex_install_dir}
157 mkdir -p %{ex_install_dir}/provisioning
158 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/provisioningclient %{ex_install_dir}/provisioning/
159 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat %{ex_install_dir}/provisioning/
160 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_justworks %{ex_install_dir}/provisioning/
161 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{ex_install_dir}/provisioning/
162 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_randompin %{ex_install_dir}/provisioning/
163 cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %{ex_install_dir}/provisioning/
164
165 cp ./resource/csdk/security/include/pinoxmcommon.h %{buildroot}%{_includedir}
166 cp ./resource/csdk/security/include/securevirtualresourcetypes.h %{buildroot}%{_includedir}
167 cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir}
168 cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir}
169 cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir}
170 cp ./resource/csdk/connectivity/api/casecurityinterface.h %{buildroot}%{_includedir}
171 cp ./resource/csdk/connectivity/api/cacommon.h %{buildroot}%{_includedir}
172
173 # For IoTCon
174 cp ./resource/csdk/security/include/internal/doxmresource.h %{buildroot}%{_includedir}
175 cp ./resource/csdk/security/include/internal/verresource.h %{buildroot}%{_includedir}
176
177 %if 0%{?tizen_version_major} < 3
178 mkdir -p %{buildroot}/%{_datadir}/license
179 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}
180 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-service
181 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test
182 %endif
183
184 cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
185 cp service/easy-setup/inc/*.h %{buildroot}%{_includedir}
186 cp service/easy-setup/enrollee/inc/*.h %{buildroot}%{_includedir}
187
188
189 %post -p /sbin/ldconfig
190
191 %postun -p /sbin/ldconfig
192
193 %files
194 %manifest %{name}.manifest
195 %defattr(-,root,root,-)
196 %{_libdir}/liboc.so
197 %{_libdir}/liboc_logger.so
198 %{_libdir}/liboc_logger_core.so
199 %{_libdir}/liboctbstack.so
200 %{_libdir}/libconnectivity_abstraction.so
201 %{_libdir}/libocpmapi.so
202 %{_libdir}/libocprovision.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%{?tizen_version_major} < 3
223 %{_datadir}/license/%{name}-service
224 %else
225 %license LICENSE.APLv2
226 %endif
227
228 %files test
229 %manifest %{name}-test.manifest
230 %defattr(-,root,root,-)
231 %{_bindir}/*
232 %if 0%{?tizen_version_major} < 3
233 %{_datadir}/license/%{name}-test
234 %else
235 %license LICENSE.APLv2
236 %endif
237
238 %files devel
239 %defattr(-,root,root,-)
240 %{_libdir}/lib*.a
241 %{_libdir}/pkgconfig/%{name}.pc
242 %{_includedir}/*