tizen: packaging: build on x86_64 arm64 and others too 65/37465/4
authorPhilippe Coval <philippe.coval@open.eurogiciel.org>
Mon, 19 Jan 2015 18:09:28 +0000 (19:09 +0100)
committerMinchul Lee <slotus.lee@samsung.com>
Mon, 30 Mar 2015 04:45:30 +0000 (13:45 +0900)
Without this change only 2 arch were possible to build :
arm and x86 (32bits)

Since some scon's variables are not aligned with Tizen's infra name,
mapping is needed for x86 amd arm64.

While for x86_64 it can use the generic RPM macro %{_arch} value
which is same, it prevents writing an extra "if endif block".

Other unsuported arch were not tested (ie: mips, ppc ...)
and would  probably need more sources or make/scon/files adaptations.

With a couple of other fixes (to come later),
rpmbuild was successful using Tizen:Common's repos
with those archs : x86, x86_64, armv7l, aarch64.

Feel free to me ask support upstream or on tizen trackers

Change-Id: I1034d66ac29bee1667a7e12d6ceb9e08806c3a15
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Reviewed-on: https://gerrit.iotivity.org/gerrit/157
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caiwen Zhang <caiwen.zhang@intel.com>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
packaging/iotivity.spec

index a696fd1..b7c1b04 100644 (file)
@@ -36,14 +36,28 @@ developing applications that use %{name}.
 %prep
 %setup -q -n %{name}-%{version}
 
-%build
-%ifarch %arm
-export RPM_ARCH=armeabi-v7a
-%else
-export RPM_ARCH=x86
+%define RPM_ARCH %{_arch}
+
+%ifarch armv7l armv7l armv7hl armv7nhl armv7tnhl armv7thl
+%define RPM_ARCH "armeabi-v7a"
+%endif
+
+%ifarch aarch64
+%define RPM_ARCH "arm64"
+%endif
+
+%ifarch x86_64
+%define RPM_ARCH "x86_64"
+%endif
+
+%ifarch %{ix86}
+%define RPM_ARCH "x86"
 %endif
 
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH RELEASE=%{release_mode}
+
+%build
+
+scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} RELEASE=%{release_mode}
 
 %install
 rm -rf %{buildroot}