ddf3d6dcd34a170e454831536c895da1ec4765ec
[iotivity.git] / resource / csdk / stack / samples / tizen / build / packaging / com.oic.ri.spec
1 %define PREFIX /usr/apps/com.oic.ri
2 %define DEST_INC_DIR  %{buildroot}/%{_includedir}/OICHeaders
3 %define DEST_LIB_DIR  %{buildroot}/%{_libdir}
4
5 Name: com-oic-ri
6 Version:    2.0.0
7 Release:    0
8 Summary: Tizen oicri application
9 Group: Network & Connectivity / IoT Connectivity
10 License: Apache-2.0
11 URL: https://www.iotivity.org/
12 Source0: http://mirrors.kernel.org/%{name}/%{version}/%{name}-%{version}.tar.gz
13
14 %define JOB "-j4"
15 %if 0%{?speedpython}
16 %define JOB %{?_smp_mflags}
17 %endif
18 %if 0%{?speedpython:1} && 0%{?en_speedpython:1}
19 %en_speedpython
20 %endif
21
22 %ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
23 %define TARGET_ARCH "armeabi-v7a"
24 %endif
25 %ifarch aarch64
26 %define TARGET_ARCH "arm64"
27 %endif
28 %ifarch x86_64
29 %define TARGET_ARCH "x86_64"
30 %endif
31 %ifarch %{ix86}
32 %define TARGET_ARCH "x86"
33 %endif
34 # Default values to be eventually overiden BEFORE or as gbs params:
35 %{!?LOGGING: %define LOGGING 1}
36 %{!?RELEASE: %define RELEASE True}
37 %{!?SECURED: %define SECURED 0}
38 %{!?TARGET_OS: %define TARGET_OS tizen}
39 %{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP}
40 %{!?VERBOSE: %define VERBOSE 1}
41 %{!?WITH_MQ: %define WITH_MQ OFF}
42 %{!?WITH_PROXY: %define WITH_PROXY 0}
43 %{!?WITH_TCP: %define WITH_TCP 0}
44 %{!?TARGET_ARCH: %define TARGET_ARCH %{_arch}}
45 %if "True" == "%{RELEASE}"
46 %define build_mode release
47 %else
48 %define build_mode debug
49 %endif
50
51 %define BUILD_DIR out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/
52
53 BuildRequires: pkgconfig(dlog)
54 BuildRequires: pkgconfig(ttrace)
55 BuildRequires: pkgconfig(glib-2.0)
56 BuildRequires: pkgconfig(capi-network-connection)
57 BuildRequires: pkgconfig(capi-network-bluetooth)
58 BuildRequires: pkgconfig(uuid)
59 BuildRequires: pkgconfig(sqlite3)
60 BuildRequires: boost-devel
61 BuildRequires: boost-thread
62 BuildRequires: boost-system
63 BuildRequires: boost-filesystem
64 BuildRequires: scons
65
66
67 %description
68 SLP oicri application
69
70 %prep
71 %setup -q
72
73 %build
74 scons %{JOB} --prefix=%{_prefix} \
75     LOGGING=%{LOGGING} \
76     RELEASE=%{RELEASE} \
77     SECURED=%{SECURED} \
78     TARGET_OS=%{TARGET_OS} \
79     TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
80     VERBOSE=%{VERBOSE} \
81     WITH_MQ=%{WITH_MQ} \
82     WITH_PROXY=%{WITH_PROXY} \
83     WITH_TCP=%{WITH_TCP} \
84     TARGET_ARCH=%{TARGET_ARCH} \
85     #eol
86
87 %install
88 mkdir -p %{DEST_INC_DIR}
89 mkdir -p %{DEST_LIB_DIR}/pkgconfig
90
91 install %{BUILD_DIR}/liboctbstack.so %{buildroot}/%{_libdir}
92 install %{BUILD_DIR}/libc_common.a %{buildroot}/%{_libdir}
93 install %{BUILD_DIR}/libocsrm.a %{buildroot}/%{_libdir}
94 install %{BUILD_DIR}/libconnectivity_abstraction.so %{buildroot}/%{_libdir}
95 install %{BUILD_DIR}/libcoap.a %{buildroot}/%{_libdir}
96 # Renamed to avoid colision with system package
97 # I suppose it was added to be used along Tizen SDK which does not ship it
98 cp -av /usr/lib*/libuuid.so.1 %{buildroot}%{_libdir}/libuuid1.so ||:
99
100 %if 0%{?SECURED} == 1
101 cp -f %{BUILD_DIR}/libmbedcrypto.a %{buildroot}/%{_libdir}
102 cp -f %{BUILD_DIR}/libmbedtls.a %{buildroot}/%{_libdir}
103 cp -f %{BUILD_DIR}/libmbedx509.a %{buildroot}/%{_libdir}
104 %endif
105
106 install -d  %{DEST_INC_DIR}/experimental
107 cp -rf resource/csdk/stack/include/ocstack.h* %{DEST_INC_DIR}/
108 cp resource/csdk/security/include/experimental/*.h* %{DEST_INC_DIR}/experimental/
109 cp -rf resource/csdk/stack/include/ocstackconfig.h* %{DEST_INC_DIR}/
110 cp -rf resource/csdk/include/octypes.h* %{DEST_INC_DIR}/
111 cp resource/csdk/logger/include/experimental/*.h* %{DEST_INC_DIR}/experimental/
112 cp resource/oc_logger/include/oc_logger.hpp %{DEST_INC_DIR}/
113 cp resource/oc_logger/include/oc_log_stream.hpp %{DEST_INC_DIR}/
114 cp resource/oc_logger/include/oc_logger.h %{DEST_INC_DIR}/
115 cp resource/oc_logger/include/oc_logger_types.h %{DEST_INC_DIR}/
116 cp resource/oc_logger/include/targets/oc_console_logger.h %{DEST_INC_DIR}
117 cp resource/oc_logger/include/targets/oc_ostream_logger.h %{DEST_INC_DIR}
118 cp resource/csdk/stack/include/ocpresence.h %{DEST_INC_DIR}
119 cp resource/csdk/stack/include/ocpayload.h %{DEST_INC_DIR}
120 cp resource/c_common/platform_features.h %{DEST_INC_DIR}
121 cp %{BUILD_DIR}/resource/c_common/iotivity_config.h %{DEST_INC_DIR}
122 cp resource/c_common/*/include/*.h %{DEST_INC_DIR}
123 cp resource/c_common/experimental/*.h* %{DEST_INC_DIR}/experimental/
124 cp resource/csdk/stack/include/experimental/payload_logging.h %{DEST_INC_DIR}/experimental/
125 cp extlibs/tinycbor/tinycbor/src/cbor.h %{DEST_INC_DIR}
126 cp -f com.oic.ri.pc %{DEST_LIB_DIR}/pkgconfig/
127
128 %files
129 %manifest com.oic.ri.manifest
130 %defattr(-,root,root,-)
131 %{_libdir}/lib*.so*
132 %{_libdir}/lib*.a*
133 %{_includedir}/OICHeaders/*
134 %{_libdir}/pkgconfig/*.pc