ad60de0a929390d7acd6d3578b79a42d52560f7c
[platform/upstream/iotivity.git] / packaging / iotivity.spec
1 Name: iotivity
2 Version: 1.0.0
3 Release: 0
4 Summary: IoTivity Base Stack & IoTivity Services
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, 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(capi-appfw-app-common)
24 BuildRequires:  pkgconfig(glib-2.0)
25 BuildRequires:  pkgconfig(sqlite3)
26 Requires(postun): /sbin/ldconfig
27 Requires(post): /sbin/ldconfig
28
29
30 ## If tizen 2.x, RELEASE follows tizen_build_binary_release_type_eng. ##
31 ## and if tizen 3.0, RELEASE follows tizen_build_devel_mode. ##
32 %if 0%{?tizen_build_devel_mode} == 1 || 0%{?tizen_build_binary_release_type_eng} == 1
33 %define RELEASE False
34 %else
35 %define RELEASE True
36 %endif
37
38 %{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP,BT}
39 %{!?SECURED: %define SECURED 0}
40 %{!?LOGGING: %define LOGGING True}
41 %{!?ROUTING: %define ROUTING GW}
42
43 %description
44 IoTivity Base (RICH & LITE) Stack & IoTivity Services
45
46 %package service
47 Summary: Development files for %{name}
48 Group: Network & Connectivity/Service
49 Requires: %{name} = %{version}-%{release}
50
51 %description service
52 The %{name}-service package contains service libraries files for
53 developing applications that use %{name}-service.
54
55 %package test
56 Summary: Development files for %{name}
57 Group: Network & Connectivity/Testing
58 Requires: %{name} = %{version}-%{release}
59
60 %description test
61 The %{name}-test package contains example files to show
62 how the iotivity works using %{name}-test
63
64 %package devel
65 Summary: Development files for %{name}
66 Group: Network & Connectivity/Development
67 Requires: %{name} = %{version}-%{release}
68 Requires: pkgconfig
69
70 %description devel
71 The %{name}-devel package contains libraries and header files for
72 developing applications that use %{name}.
73
74 %prep
75 %setup -q -n %{name}-%{version}
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 scons --prefix=%{_prefix} \
104                 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
105                 RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
106                 INSTALL_ROOT=%{buildroot} LIB_INSTALL_DIR=%{_libdir}
107
108
109 %install
110 rm -rf %{buildroot}
111 scons install --prefix=%{_prefix} \
112                 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
113                 RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
114                 INSTALL_ROOT=%{buildroot} LIB_INSTALL_DIR=%{_libdir}
115
116 %if %{RELEASE} == "True"
117 %define build_mode release
118 %else
119 %define build_mode debug
120 %endif
121
122 # For Example
123 mkdir -p %{buildroot}%{_bindir}
124 cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{buildroot}%{_bindir}
125 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
126 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
127 cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{buildroot}%{_bindir}
128 cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{buildroot}%{_bindir}
129 cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{buildroot}%{_bindir}
130 cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{buildroot}%{_bindir}
131 cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{buildroot}%{_bindir}
132 cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{buildroot}%{_bindir}
133 cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{buildroot}%{_bindir}
134 cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{buildroot}%{_bindir}
135 cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{buildroot}%{_bindir}
136 cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{buildroot}%{_bindir}
137 cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{buildroot}%{_bindir}
138 cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{buildroot}%{_bindir}
139 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
140 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{buildroot}%{_bindir}
141 cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{buildroot}%{_bindir}
142 cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{buildroot}%{_bindir}
143 cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{buildroot}%{_bindir}
144 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.json %{buildroot}%{_bindir}
145 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.json %{buildroot}%{_bindir}
146
147 # For iotcon
148 cp resource/csdk/stack/include/ocpayload.h %{buildroot}%{_includedir}/resource
149 cp resource/csdk/ocrandom/include/ocrandom.h %{buildroot}%{_includedir}/resource
150
151 %if 0%{?tizen_version_major} < 3
152 mkdir -p %{buildroot}/%{_datadir}/license
153 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}
154 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-service
155 cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test
156 %endif
157
158 %post -p /sbin/ldconfig
159
160 %postun -p /sbin/ldconfig
161
162 %files
163 %manifest %{name}.manifest
164 %defattr(-,root,root,-)
165 %{_libdir}/liboc.so
166 %{_libdir}/liboc_logger.so
167 %{_libdir}/liboc_logger_core.so
168 %{_libdir}/liboctbstack.so
169 %{_libdir}/libconnectivity_abstraction.so
170 %if 0%{?tizen_version_major} < 3
171 %{_datadir}/license/%{name}
172 %else
173 %license LICENSE.APLv2
174 %endif
175
176 %files service
177 %manifest %{name}.manifest
178 %defattr(-,root,root,-)
179 %{_libdir}/libBMISensorBundle.so
180 %{_libdir}/libDISensorBundle.so
181 %{_libdir}/libresource_hosting.so
182 %{_libdir}/libTGMSDKLibrary.so
183 %{_libdir}/libHueBundle.so
184 %{_libdir}/librcs_client.so
185 %{_libdir}/librcs_common.so
186 %{_libdir}/librcs_container.so
187 %{_libdir}/librcs_server.so
188 %if 0%{?tizen_version_major} < 3
189 %{_datadir}/license/%{name}-service
190 %else
191 %license LICENSE.APLv2
192 %endif
193
194 %files test
195 %manifest %{name}-test.manifest
196 %defattr(-,root,root,-)
197 %{_bindir}/OICMiddle
198 %{_bindir}/devicediscoveryclient
199 %{_bindir}/devicediscoveryserver
200 %{_bindir}/fridgeclient
201 %{_bindir}/fridgeserver
202 %{_bindir}/garageclient
203 %{_bindir}/garageserver
204 %{_bindir}/groupclient
205 %{_bindir}/groupserver
206 %{_bindir}/lightserver
207 %{_bindir}/presenceclient
208 %{_bindir}/presenceserver
209 %{_bindir}/roomclient
210 %{_bindir}/roomserver
211 %{_bindir}/simpleclient
212 %{_bindir}/simpleclientHQ
213 %{_bindir}/simpleclientserver
214 %{_bindir}/simpleserver
215 %{_bindir}/simpleserverHQ
216 %{_bindir}/threadingsample
217 %{_bindir}/oic_svr_db_server.json
218 %{_bindir}/oic_svr_db_client.json
219 %if 0%{?tizen_version_major} < 3
220 %{_datadir}/license/%{name}-test
221 %else
222 %license LICENSE.APLv2
223 %endif
224
225 %files devel
226 %defattr(-,root,root,-)
227 %{_libdir}/lib*.a
228 %{_libdir}/pkgconfig/%{name}.pc
229 %{_includedir}/*