else:
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),
- LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR', GetOption('prefix')+'/lib')
+ PREFIX = GetOption('prefix'),
+ LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR', '/usr/lib')
)
Help(help_vars.GenerateHelpText(env))
def __installlib(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(env.get('INSTALL_ROOT') + env.get('LIB_INSTALL_DIR'), targets)
+ i_n = ienv.Install(env.get('LIB_INSTALL_DIR'), 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(env.get('INSTALL_ROOT') + user_prefix + '/bin', targets)
+ i_n = ienv.Install(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(env.get('INSTALL_ROOT') + user_prefix + '/include/' + dir ,targets)
+ i_n = ienv.Install(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(env.get('INSTALL_ROOT') + env.get('LIB_INSTALL_DIR') + '/pkgconfig', targets)
+ i_n = ienv.Install(env.get('LIB_INSTALL_DIR') + '/pkgconfig', targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
# This script set linux specific flags (GNU GCC)
#
##
+import os
+import SCons.Util
+
Import('env')
print "Reading linux configuration script"
# Set release/debug flags
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
env.AppendUnique(CPPDEFINES = ['NDEBUG'])
- env.AppendUnique(CCFLAGS = ['-g'])
-else:
- env.AppendUnique(CCFLAGS = ['-g'])
if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+env['CCFLAGS'] = SCons.Util.CLVar(os.environ.get('CFLAGS', ""))
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
env.AppendUnique(CFLAGS = ['-std=gnu99'])
-env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
+env.AppendUnique(CCFLAGS = ['-Wextra', '-fPIC'])
env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
-if env.get('TARGET_OS') == 'tizen':
- env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-DSLP_SDK_LOG', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
- env.ParseConfig("pkg-config dlog --cflags --libs")
+env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
+env.ParseConfig("pkg-config dlog --cflags --libs")
-# Set arch flags
-target_arch = env.get('TARGET_ARCH')
-if target_arch in ['x86']:
- env.AppendUnique(CCFLAGS = ['-m32'])
- env.AppendUnique(LINKFLAGS = ['-m32'])
-elif target_arch in ['x86_64']:
- env.AppendUnique(CCFLAGS = ['-m64'])
- env.AppendUnique(LINKFLAGS = ['-m64'])
-elif target_arch.find('v7a-hard') > 0:
- env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
- env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
- env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
- env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
-elif target_arch.find('v7a') > 0:
- env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
-elif target_arch.find('arm64') >= 0:
- env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
-else:
- env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+# Set arch flags : It will be handled by Tizen build system.
Name: iotivity
Version: 1.0.0
Release: 0
-Summary: IoTivity Base Stack & IoTivity Services
+Summary: IoT Connectivity sponsored by the OIC
Group: Network & Connectivity/Other
License: Apache-2.0
URL: https://www.iotivity.org/
Source0: %{name}-%{version}.tar.bz2
Source1001: %{name}.manifest
Source1002: %{name}-test.manifest
-BuildRequires: gettext, expat-devel
+BuildRequires: gettext-tools, expat-devel
BuildRequires: python, libcurl-devel
BuildRequires: scons
BuildRequires: openssl-devel
%{!?ROUTING: %define ROUTING GW}
%description
-IoTivity Base (RICH & LITE) Stack & IoTivity Services
+An open source reference implementation of the OIC standard specifications
+IoTivity Base Libraries are included.
+
%package service
Summary: Development files for %{name}
developing applications that use %{name}.
%prep
-%setup -q -n %{name}-%{version}
+%setup -q
+chmod g-w %_sourcedir/*
+
cp LICENSE.md LICENSE.APLv2
cp %{SOURCE1001} .
%if 0%{?tizen_version_major} < 3
%define RPM_ARCH "x86"
%endif
-scons --prefix=%{_prefix} \
- TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
- RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
- INSTALL_ROOT=%{buildroot} LIB_INSTALL_DIR=%{_libdir}
+#VERBOSE=1
+scons -j2 --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ LIB_INSTALL_DIR=%{_libdir}
%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} LIB_INSTALL_DIR=%{_libdir}
+CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
+scons install --install-sandbox=%{buildroot} --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ LIB_INSTALL_DIR=%{_libdir}
+
+# For Example
%if %{RELEASE} == "True"
%define build_mode release
%else
%define build_mode debug
%endif
-
-# For Example
-mkdir -p %{buildroot}%{_bindir}
-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/fridgeserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{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}
+%define ex_install_dir %{buildroot}%{_bindir}
+mkdir -p %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.json %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.json %{ex_install_dir}
# For iotcon
cp resource/csdk/stack/include/ocpayload.h %{buildroot}%{_includedir}/resource
%files test
%manifest %{name}-test.manifest
%defattr(-,root,root,-)
-%{_bindir}/OICMiddle
-%{_bindir}/devicediscoveryclient
-%{_bindir}/devicediscoveryserver
-%{_bindir}/fridgeclient
-%{_bindir}/fridgeserver
-%{_bindir}/garageclient
-%{_bindir}/garageserver
-%{_bindir}/groupclient
-%{_bindir}/groupserver
-%{_bindir}/lightserver
-%{_bindir}/presenceclient
-%{_bindir}/presenceserver
-%{_bindir}/roomclient
-%{_bindir}/roomserver
-%{_bindir}/simpleclient
-%{_bindir}/simpleclientHQ
-%{_bindir}/simpleclientserver
-%{_bindir}/simpleserver
-%{_bindir}/simpleserverHQ
-%{_bindir}/threadingsample
-%{_bindir}/oic_svr_db_server.json
-%{_bindir}/oic_svr_db_client.json
+%{_bindir}/*
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-test
%else
devicediscoveryclient = examples_env.Program('devicediscoveryclient', 'devicediscoveryclient.cpp')
threadingsample = examples_env.Program('threadingsample', 'threadingsample.cpp')
+serverjson = examples_env.Install(env.get('BUILD_DIR') + '/resource/examples/',
+ env.get('SRC_DIR') + '/resource/examples/' + 'oic_svr_db_client.json')
+clientjson = examples_env.Install(env.get('BUILD_DIR') + '/resource/examples/',
+ env.get('SRC_DIR') + '/resource/examples/' + 'oic_svr_db_server.json')
Alias("examples", [simpleserver, simpleclient,
simpleserverHQ, simpleclientHQ,
fridgeserver, fridgeclient,
groupserver, groupclient,
lightserver,
devicediscoveryserver, devicediscoveryclient,
- threadingsample
+ threadingsample,
+ serverjson, clientjson
])
-env.AppendTarget('examples')
-
-src_dir = examples_env.get('SRC_DIR')
-svr_db_src_dir = src_dir + '/resource/examples/'
-svr_db_build_dir = env.get('BUILD_DIR') +'/resource/examples/'
-examples_env.Alias("install", examples_env.Install( svr_db_build_dir,
- svr_db_src_dir + 'oic_svr_db_client.json'))
-examples_env.Alias("install", examples_env.Install( svr_db_build_dir,
- svr_db_src_dir + 'oic_svr_db_server.json'))
+env.AppendTarget('examples')
\ No newline at end of file