fix errata and revise build script submit/tizen/20151109.101257
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 6 Nov 2015 03:14:59 +0000 (12:14 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 9 Nov 2015 02:54:39 +0000 (11:54 +0900)
Change-Id: Ic011219501dea82072c90005d3a1298a1b94b548

build_common/SConscript
iotivity.pc.in
packaging/iotivity.spec
resource/c_common/SConscript
resource/csdk/SConscript
service/resource-container/SConscript
service/resource-encapsulation/SConscript
service/resource-encapsulation/src/common/SConscript
service/resource-encapsulation/src/serverBuilder/SConscript
service/resource-hosting/SConscript

index e766d1a..39991e2 100644 (file)
@@ -126,8 +126,7 @@ if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compil
                        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 = '''
@@ -210,7 +209,7 @@ def __install(ienv, targets, name):
 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)
@@ -218,7 +217,7 @@ def __installlib(ienv, targets, name):
 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)
@@ -226,7 +225,7 @@ def __installbin(ienv, targets, name):
 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)
@@ -234,7 +233,7 @@ def __installheader(ienv, targets, dir, name):
 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)
index c825fdf..ba40f04 100644 (file)
@@ -1,9 +1,9 @@
 # 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.
@@ -11,4 +11,4 @@ Version: @VERSION@
 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@
index 15001aa..82978b7 100644 (file)
@@ -26,12 +26,13 @@ BuildRequires:  pkgconfig(sqlite3)
 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}
@@ -100,11 +101,19 @@ cp %{SOURCE1001} ./%{name}-test.manifest
 %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
@@ -117,6 +126,8 @@ mkdir -p %{buildroot}%{_bindir}
 %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}
@@ -138,21 +149,10 @@ cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{buildroot}%{_bin
 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
@@ -200,6 +200,7 @@ cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test
 %files test
 %manifest %{name}-test.manifest
 %defattr(-,root,root,-)
+%{_bindir}/OICMiddle
 %{_bindir}/devicediscoveryclient
 %{_bindir}/devicediscoveryserver
 %{_bindir}/fridgeclient
index d018d88..775a0b6 100644 (file)
@@ -52,3 +52,4 @@ common_src = [
 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
index df647b8..58ec2b4 100644 (file)
@@ -148,4 +148,5 @@ else:
        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')
 
index 45382d4..16307e3 100644 (file)
@@ -124,9 +124,10 @@ res_container_static = resource_container_env.StaticLibrary('rcs_container', res
 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
@@ -144,6 +145,7 @@ if target_os in ['linux', 'tizen', 'android']:
 
     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')
@@ -166,6 +168,7 @@ if target_os in ['linux', 'tizen', 'android']:
 
     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')
@@ -204,6 +207,7 @@ else:
 
     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()
 
 ######################################################################
@@ -244,4 +248,4 @@ env.AppendTarget('containersampleclient')
 # Build Container Java SDK
 ######################################################################
 if target_os == 'android':
-    SConscript('android/SConscript')
\ No newline at end of file
+    SConscript('android/SConscript')
index d82b5f5..3357021 100644 (file)
@@ -95,14 +95,14 @@ ResourceClientsdk_shared = resourceClient_env.SharedLibrary('rcs_client', client
 
 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
@@ -110,7 +110,7 @@ resourceClient_env.UserInstallTargetHeader('include/RCSResponse.h', 'service/res
 SConscript('examples/SConscript')
 
 ######################################################################
-# Build UnitTests Resource Client , resourceCache and resourceBroker and 
+# Build UnitTests Resource Client , resourceCache and resourceBroker and
 # DiscoveryManager
 ################################################ ######################
 if target_os == 'linux':
@@ -119,4 +119,4 @@ 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')
index e0d38be..6d0ff9d 100644 (file)
@@ -89,6 +89,7 @@ rcs_common_src = [
 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
index 1ec21b7..563d1d6 100644 (file)
@@ -80,6 +80,7 @@ server_builder_static = server_builder_env.StaticLibrary('rcs_server', server_bu
 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
index 68ddd51..13e68c2 100644 (file)
@@ -90,8 +90,7 @@ else :
 
 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':