Merge "Merge branch 'master' into resource-encapsulation" into resource-encapsulation
[platform/upstream/iotivity.git] / tools / tizen / iotivity.spec
1 Name: iotivity
2 Version: 0.9.2
3 Release: 0
4 Summary: IoTivity Base Stack & IoTivity Services
5 Group: System Environment/Libraries
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 Requires(postun): /sbin/ldconfig
25 Requires(post): /sbin/ldconfig
26
27 %define release_mode false
28 %define secure_mode 0
29
30 %description
31 IoTivity Base (RICH & LITE) Stack & IoTivity Services
32
33 %package service
34 Summary: Development files for %{name}
35 Group: Development/Libraries
36 Requires: %{name} = %{version}-%{release}
37
38 %description service
39 The %{name}-service package contains service libraries files for
40 developing applications that use %{name}-service.
41
42 %package test
43 Summary: Development files for %{name}
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
46
47 %description test
48 The %{name}-test package contains example files to show
49 how the iotivity works using %{name}-test
50
51 %package devel
52 Summary: Development files for %{name}
53 Group: Development/Libraries
54 Requires: %{name} = %{version}-%{release}
55 Requires: pkgconfig
56
57 %description devel
58 The %{name}-devel package contains libraries and header files for
59 developing applications that use %{name}.
60
61 %prep
62 %setup -q -n %{name}-%{version}
63 cp %{SOURCE1001} .
64 %if 0%{?tizen_version_major} < 3
65 cp %{SOURCE1002} .
66 %else
67 cp %{SOURCE1001} ./%{name}-test.manifest
68 %endif
69
70 %build
71 %define RPM_ARCH %{_arch}
72
73 %ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
74 %define RPM_ARCH "armeabi-v7a"
75 %endif
76
77 %ifarch aarch64
78 %define RPM_ARCH "arm64"
79 %endif
80
81 %ifarch x86_64
82 %define RPM_ARCH "x86_64"
83 %endif
84
85 %ifarch %{ix86}
86 %define RPM_ARCH "x86"
87 %endif
88
89
90 scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=IP RELEASE=%{release_mode} SECURED=%{secure_mode}
91
92 %install
93 rm -rf %{buildroot}
94 mkdir -p %{buildroot}%{_includedir}
95 mkdir -p %{buildroot}%{_libdir}
96 mkdir -p %{buildroot}%{_bindir}
97
98
99 %if %{release_mode} == "true"
100 %define build_mode release
101 %else
102 %define build_mode debug
103 %endif
104
105 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
106 cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
107 cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{buildroot}%{_bindir}
108 cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{buildroot}%{_bindir}
109 cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{buildroot}%{_bindir}
110 cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{buildroot}%{_bindir}
111 cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{buildroot}%{_bindir}
112 cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{buildroot}%{_bindir}
113 cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{buildroot}%{_bindir}
114 cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{buildroot}%{_bindir}
115 cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{buildroot}%{_bindir}
116 cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{buildroot}%{_bindir}
117 cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{buildroot}%{_bindir}
118 cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{buildroot}%{_bindir}
119 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
120 cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{buildroot}%{_bindir}
121 cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{buildroot}%{_bindir}
122 cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{buildroot}%{_bindir}
123 cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{buildroot}%{_bindir}
124
125 cp out/tizen/*/%{build_mode}/lib*.so %{buildroot}%{_libdir}
126 cp out/tizen/*/%{build_mode}/libSSMSDK.a %{buildroot}%{_libdir}
127 cp out/tizen/*/%{build_mode}/libppm.a %{buildroot}%{_libdir}
128
129 cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}
130 cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir}
131 cp resource/csdk/ocrandom/include/*.h %{buildroot}%{_includedir}
132 cp -r resource/oc_logger/include/* %{buildroot}%{_includedir}
133 cp resource/include/*.h %{buildroot}%{_includedir}
134
135 cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
136 cp service/soft-sensor-manager/SDK/cpp/include/*.h %{buildroot}%{_includedir}
137 cp service/protocol-plugin/plugin-manager/src/*.h %{buildroot}%{_includedir}
138
139
140 %post -p /sbin/ldconfig
141
142 %postun -p /sbin/ldconfig
143
144 %files
145 %manifest %{name}.manifest
146 %defattr(-,root,root,-)
147 %{_libdir}/liboc.so
148 %{_libdir}/liboc_logger.so
149 %{_libdir}/liboc_logger_core.so
150 %{_libdir}/liboctbstack.so
151 %{_libdir}/libconnectivity_abstraction.so
152
153 %files service
154 %manifest %{name}.manifest
155 %defattr(-,root,root,-)
156 %{_libdir}/libBMISensor.so
157 %{_libdir}/libDiscomfortIndexSensor.so
158 %{_libdir}/libmosquittopp.so
159 %{_libdir}/libpmimpl.so
160 %{_libdir}/libSSMCore.so
161 %{_libdir}/libNotificationManager.so
162 %{_libdir}/libHueBundle.so
163 %{_libdir}/librcs_client.so
164 %{_libdir}/librcs_common.so
165 %{_libdir}/librcs_container.so
166 %{_libdir}/librcs_server.so
167
168 %files test
169 %manifest %{name}-test.manifest
170 %defattr(-,root,root,-)
171 %{_bindir}/devicediscoveryclient
172 %{_bindir}/devicediscoveryserver
173 %{_bindir}/fridgeclient
174 %{_bindir}/fridgeserver
175 %{_bindir}/garageclient
176 %{_bindir}/garageserver
177 %{_bindir}/groupclient
178 %{_bindir}/groupserver
179 %{_bindir}/lightserver
180 %{_bindir}/presenceclient
181 %{_bindir}/presenceserver
182 %{_bindir}/roomclient
183 %{_bindir}/roomserver
184 %{_bindir}/simpleclient
185 %{_bindir}/simpleclientHQ
186 %{_bindir}/simpleclientserver
187 %{_bindir}/simpleserver
188 %{_bindir}/simpleserverHQ
189 %{_bindir}/threadingsample
190
191 %files devel
192 %defattr(-,root,root,-)
193 %{_libdir}/lib*.a
194 %{_includedir}/*