tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile']
)
else:
- env = Environment(variables = help_vars, tools = ['default', 'textfile'], TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'))
-
+ env = Environment(variables = help_vars, tools = ['default', 'textfile'], TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'), INSTALL_ROOT = ARGUMENTS.get('INSTALL_ROOT', dir))
Help(help_vars.GenerateHelpText(env))
tc_set_msg = '''
def __installlib(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/lib', targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/lib', targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
def __installbin(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/bin', targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/bin', targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
def __installheader(ienv, targets, dir, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/include/' + dir ,targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/include/' + dir ,targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
def __installpcfile(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/lib/pkgconfig', targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/lib/pkgconfig', targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
# Package Information for pkg-config
-prefix=/usr
+prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
-includedir=${prefix}/include/
+includedir=${prefix}/include
Name: iotivity
Description: IoTivity is an open source reference implementation of the OIC standard specifications.
URL: https://www.iotivity.org
Requires:
Libs: -loc -loc_logger -loc_logger_core -loctbstack -lconnectivity_abstraction
-Cflags: -I${includedir} -D@ROUTING_DEFINE@
+Cflags: -I${includedir}/resource -I${includedir}/iotivity-service -D@ROUTING_DEFINE@
Requires(postun): /sbin/ldconfig
Requires(post): /sbin/ldconfig
-%define RELEASE True
## If tizen 2.x, RELEASE follows tizen_build_binary_release_type_eng. ##
## and if tizen 3.0, RELEASE follows tizen_build_devel_mode. ##
%if 0%{?tizen_build_devel_mode} == 1 || 0%{?tizen_build_binary_release_type_eng} == 1
%define RELEASE False
+%else
+%define RELEASE True
%endif
%{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP,BT}
%endif
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
- RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING}
+scons -j 4 --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ INSTALL_ROOT=%{buildroot}
%install
rm -rf %{buildroot}
+scons install --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ INSTALL_ROOT=%{buildroot}
+
+
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig
%define build_mode debug
%endif
+# For Example
+cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.json %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.json %{buildroot}%{_bindir}
-if echo %{SECURED}|grep -qi '1'; then
- cp out/tizen/*/%{build_mode}/libocpmapi.a %{buildroot}%{_libdir}
-fi
-cp out/tizen/*/%{build_mode}/libcoap.a %{buildroot}%{_libdir}
-cp out/tizen/*/%{build_mode}/lib*.so %{buildroot}%{_libdir}
-cp out/tizen/*/%{build_mode}/%{name}.pc %{buildroot}%{_libdir}/pkgconfig
-
-cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}
-cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir}
-cp resource/csdk/ocrandom/include/*.h %{buildroot}%{_includedir}
-cp resource/c_common/platform_features.h %{buildroot}%{_includedir}
-cp -r resource/oc_logger/include/* %{buildroot}%{_includedir}
-cp resource/include/*.h %{buildroot}%{_includedir}
-
-cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
+
+# For iotcon
+cp resource/csdk/stack/include/ocpayload.h %{buildroot}%{_includedir}/resource
+cp resource/csdk/ocrandom/include/ocrandom.h %{buildroot}%{_includedir}/resource
%if 0%{?tizen_version_major} < 3
mkdir -p %{buildroot}/%{_datadir}/license
%files test
%manifest %{name}-test.manifest
%defattr(-,root,root,-)
+%{_bindir}/OICMiddle
%{_bindir}/devicediscoveryclient
%{_bindir}/devicediscoveryserver
%{_bindir}/fridgeclient
commonlib = common_env.StaticLibrary('c_common', common_src)
common_env.InstallTarget(commonlib, 'c_common')
common_env.UserInstallTargetLib(commonlib, 'c_common')
+common_env.UserInstallTargetHeader('platform_features.h', 'resource', 'platform_features.h')
\ No newline at end of file
liboctbstack_env.UserInstallTargetHeader('stack/include/ocstackconfig.h', 'resource', 'ocstackconfig.h')
liboctbstack_env.UserInstallTargetHeader('stack/include/octypes.h', 'resource', 'octypes.h')
liboctbstack_env.UserInstallTargetHeader('stack/include/ocstack.h', 'resource', 'ocstack.h')
+ liboctbstack_env.UserInstallTargetHeader('stack/include/ocpresence.h', 'resource', 'ocpresence.h')
res_container_shared = resource_container_env.SharedLibrary('rcs_container', res_container_src)
resource_container_env.InstallTarget([res_container_static,res_container_shared], 'libResContainer')
+resource_container_env.UserInstallTargetLib([res_container_static,res_container_shared], 'libResContainer')
-resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
-resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
+resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'iotivity-service', 'RCSBundleInfo.h')
+resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'iotivity-service', 'RCSResourceContainer.h')
######################################################################
# build discomfort index sensor sample bundle
DISensorBundle = DI_sensor_bundle_env.SharedLibrary('DISensorBundle', DI_sensor_bundle_src)
DI_sensor_bundle_env.InstallTarget(DISensorBundle, 'libDISensorBundle')
+ DI_sensor_bundle_env.UserInstallTargetLib(DISensorBundle, 'libDISensorBundle')
if target_os == 'linux' :
SConscript(DI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
BMISensorBundle = BMI_sensor_bundle_env.SharedLibrary('BMISensorBundle', BMI_sensor_bundle_src)
BMI_sensor_bundle_env.InstallTarget(BMISensorBundle, 'libBMISensorBundle')
+ BMI_sensor_bundle_env.UserInstallTargetLib(BMISensorBundle, 'libBMISensorBundle')
if target_os == 'linux' :
SConscript(BMI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
+ hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
lib_env = conf2.Finish()
######################################################################
# Build Container Java SDK
######################################################################
if target_os == 'android':
- SConscript('android/SConscript')
\ No newline at end of file
+ SConscript('android/SConscript')
resourceClient_env.InstallTarget([ResourceClientsdk_static,ResourceClientsdk_shared], 'librcs_client')
resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static,ResourceClientsdk_shared], 'librcs_client')
-resourceClient_env.UserInstallTargetHeader('include/RCSAddress.h', 'service/resource-encapsulation', 'RCSAddress.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSDiscoveryManager.h', 'service/resource-encapsulation', 'RCSDiscoveryManager.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSRemoteResourceObject.h', 'service/resource-encapsulation', 'RCSRemoteResourceObject.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResourceAttributes.h', 'service/resource-encapsulation', 'RCSResourceAttributes.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResourceObject.h', 'service/resource-encapsulation', 'RCSResourceObject.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSException.h', 'service/resource-encapsulation', 'RCSException.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSRequest.h', 'service/resource-encapsulation', 'RCSRequest.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResponse.h', 'service/resource-encapsulation', 'RCSResponse.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSAddress.h', 'iotivity-service', 'RCSAddress.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSDiscoveryManager.h', 'iotivity-service', 'RCSDiscoveryManager.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSRemoteResourceObject.h', 'iotivity-service', 'RCSRemoteResourceObject.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSResourceAttributes.h', 'iotivity-service', 'RCSResourceAttributes.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSResourceObject.h', 'iotivity-service', 'RCSResourceObject.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSException.h', 'iotivity-service', 'RCSException.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSRequest.h', 'iotivity-service', 'RCSRequest.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSResponse.h', 'iotivity-service', 'RCSResponse.h')
######################################################################
# Build Sample App: SampleResourceClient & SampleResourceServer
SConscript('examples/SConscript')
######################################################################
-# Build UnitTests Resource Client , resourceCache and resourceBroker and
+# Build UnitTests Resource Client , resourceCache and resourceBroker and
# DiscoveryManager
################################################ ######################
if target_os == 'linux':
SConscript('src/resourceBroker/unittest/SConscript')
if target_os == 'android':
- SConscript('android/SConscript')
\ No newline at end of file
+ SConscript('android/SConscript')
rcs_common_static = rcs_common_env.StaticLibrary('rcs_common', rcs_common_src)
rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common', rcs_common_src)
rcs_common_env.InstallTarget([rcs_common_static,rcs_common_shared], 'rcs_common')
+rcs_common_env.UserInstallTargetLib([rcs_common_static,rcs_common_shared], 'rcs_common')
######################################################################
# Build Test Expiry Timer and primitive Resource
server_builder_shared = server_builder_env.SharedLibrary('rcs_server', server_builder_src)
server_builder_env.InstallTarget([server_builder_static, server_builder_shared], 'rcs_server')
+server_builder_env.UserInstallTargetLib([server_builder_static, server_builder_shared], 'rcs_server')
######################################################################
# Build Test
resourcehosting_env.InstallTarget(resourcehostingsdk, 'libresource_hosting')
resourcehosting_env.UserInstallTargetLib(resourcehostingsdk, 'libresource_hosting')
-resourcehosting_env.UserInstallTargetHeader('include/Hosting.h',\
- 'service/resource-hosting', 'Hosting.h')
+resourcehosting_env.UserInstallTargetHeader('include/Hosting.h', 'iotivity-service', 'Hosting.h')
# Go to build Unit test
if target_os == 'linux':