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