Fix for tizen build failure issue.
[iotivity.git] / tools / tizen / iotivity.spec
1 Name: iotivity
2 Version: 0.9.0
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
10 BuildRequires:  gettext, expat-devel
11 BuildRequires:  python, libcurl-devel
12 BuildRequires:  scons
13 BuildRequires:  openssl-devel
14 BuildRequires:  boost-devel
15 BuildRequires:  boost-thread
16 BuildRequires:  boost-system
17 BuildRequires:  boost-filesystem
18 BuildRequires:  pkgconfig(dlog)
19 BuildRequires:  pkgconfig(uuid)
20 BuildRequires:  pkgconfig(capi-network-wifi)
21 BuildRequires:  pkgconfig(capi-network-bluetooth)
22 Requires(postun): /sbin/ldconfig
23 Requires(post): /sbin/ldconfig
24
25 %description
26 IoTivity Base (RICH & LITE) Stack & IoTivity Services
27
28 %package devel
29 Summary: Development files for %{name}
30 Group: Development/Libraries
31 Requires: %{name} = %{version}-%{release}
32 Requires: pkgconfig
33
34 %description devel
35 The %{name}-devel package contains libraries and header files for
36 developing applications that use %{name}.
37
38 %prep
39 %setup -q -n %{name}-%{version}
40
41 %build
42 %ifarch armv7l
43 export RPM_ARCH=armeabi-v7a
44 %else
45 %ifarch %arm
46 export RPM_ARCH=arm
47 %else
48 %ifarch aarch64
49 export RPM_ARCH=arm64
50 %else
51 %ifarch i586 i686 %{ix86}
52 export RPM_ARCH=x86
53 %else
54 export RPM_ARCH=%{_arch}
55 %endif
56 %endif
57 %endif
58 %endif
59
60
61 scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH TARGET_TRANSPORT=IP
62
63 %install
64 rm -rf %{buildroot}
65 mkdir -p %{buildroot}%{_includedir}
66 mkdir -p %{buildroot}%{_includedir}/targets
67 mkdir -p %{buildroot}%{_libdir}
68 mkdir -p %{buildroot}%{_sbindir}
69
70 cp out/tizen/*/release/lib*.so %{buildroot}%{_libdir}
71 cp out/tizen/*/release/lib*.a %{buildroot}%{_libdir}
72 cp out/tizen/*/release/service/protocol-plugin/plugins/mqtt-fan/*.so %{buildroot}%{_libdir}
73 cp out/tizen/*/release/service/protocol-plugin/plugins/mqtt-light/*.so %{buildroot}%{_libdir}
74
75 cp resource/csdk/stack/include/ocstack.h %{buildroot}%{_includedir}
76 cp resource/csdk/stack/include/ocstackconfig.h %{buildroot}%{_includedir}
77 cp resource/oc_logger/include/oc_logger.hpp %{buildroot}%{_includedir}
78 cp resource/oc_logger/include/oc_log_stream.hpp %{buildroot}%{_includedir}
79 cp resource/oc_logger/include/oc_logger.h %{buildroot}%{_includedir}
80 cp resource/oc_logger/include/oc_logger_types.h %{buildroot}%{_includedir}
81 cp resource/oc_logger/include/targets/oc_console_logger.h %{buildroot}%{_includedir}/targets
82 cp resource/oc_logger/include/targets/oc_ostream_logger.h %{buildroot}%{_includedir}/targets
83 cp resource/include/*.h %{buildroot}%{_includedir}
84
85 cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
86 cp service/soft-sensor-manager/SDK/cpp/include/*.h %{buildroot}%{_includedir}
87
88
89 %clean
90 rm -rf %{buildroot}
91
92 %post -p /sbin/ldconfig
93
94 %postun -p /sbin/ldconfig
95
96 %files
97 %defattr(-,root,root,-)
98 %{_libdir}/lib*.so
99 %{_libdir}/lib*.a
100 %{_libdir}/fanserver*.so
101 %{_libdir}/lightserver*.so
102
103 %files devel
104 %defattr(-,root,root,-)
105 %{_includedir}/*