packaging: Dependency packages build integration
authorVyacheslav Barinov <v.barinov@samsung.com>
Thu, 14 Jan 2016 07:35:33 +0000 (10:35 +0300)
committerDongkyun, Son <dongkyun.s@samsung.com>
Sun, 22 May 2016 11:05:59 +0000 (20:05 +0900)
Now gmp, mpfr, mpc, isl and cloog-isl are built inside GCC build and do
not require packages in OBS.

This is done due to license issues with LGPLv3 version of GNU GMP
library, we must ensure there is no way to link Tizen apps with this
library and to install it on device.

Change-Id: I9d744c4a554cfbe46a623841cc11f50084aa31c5
Signed-off-by: Vyacheslav Barinov <v.barinov@samsung.com>
packaging/gcc-aarch64.spec
packaging/gcc-armv7l.spec
packaging/gcc.spec

index fa1044e..9a754bf 100644 (file)
@@ -67,6 +67,7 @@ BuildRequires: zlib-devel
 BuildRequires: glibc-devel-32bit
 %endif
 BuildRequires: perl
+BuildRequires: sudo-rpm
 %{?cross:BuildRequires: binutils-%{cross}}
 # here we use %%if because OBS spec parser cannot expand
 # %%{?macro:...} correctly
@@ -618,6 +619,26 @@ A foreign function interface is the popular name for the interface that allows c
 %setup -q -n gcc-%{version}
 
 %build
+#################
+# This section is done due to license issues with LGPLv3 version of GNU GMP library.
+# To ensure there is no way to set up LGPLv3 GMP to device and to link any Tizen application with it we build all dependencies right in GCC buildroot.
+# The right way is to manage dependencies with OBS but we are forced to remove packages and make external usage impossible they will be built here.
+# Using rpmbuild lets us to keep dependencies in git repositories and debug them in other OBS projects.
+#
+# Prepare dependencies
+RPMBUILD_CMDLINE=$(cat /proc/$PPID/cmdline | tr '\000' ' ' | sed -e 's|^rpmbuild||;s|[[:space:]]/.*rpmbuild/.*$||;s/--define[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\)/--define "\1 \2"/g')
+
+pushd ${HOME}
+for pkg in gmp mpfr mpc isl cloog-isl; do
+    sh -c "rpmbuild ${RPMBUILD_CMDLINE} /home/abuild/rpmbuild/SOURCES/${pkg}.spec"
+    RPM_NAME=$(find '/home/abuild/rpmbuild/RPMS' -name "${pkg}-*.rpm" -not -name '*.src.rpm' -not -name '*debug*')
+    sudo rpm -i ${RPM_NAME}
+    find '/home/abuild/rpmbuild/' -name "${pkg}*.rpm" -delete
+done
+popd
+# End of dependencies preparation
+#################
+
 rm -rf obj
 mkdir obj
 cd obj
index c85c478..4763720 100644 (file)
@@ -67,6 +67,7 @@ BuildRequires: zlib-devel
 BuildRequires: glibc-devel-32bit
 %endif
 BuildRequires: perl
+BuildRequires: sudo-rpm
 %{?cross:BuildRequires: binutils-%{cross}}
 # here we use %%if because OBS spec parser cannot expand
 # %%{?macro:...} correctly
@@ -618,6 +619,26 @@ A foreign function interface is the popular name for the interface that allows c
 %setup -q -n gcc-%{version}
 
 %build
+#################
+# This section is done due to license issues with LGPLv3 version of GNU GMP library.
+# To ensure there is no way to set up LGPLv3 GMP to device and to link any Tizen application with it we build all dependencies right in GCC buildroot.
+# The right way is to manage dependencies with OBS but we are forced to remove packages and make external usage impossible they will be built here.
+# Using rpmbuild lets us to keep dependencies in git repositories and debug them in other OBS projects.
+#
+# Prepare dependencies
+RPMBUILD_CMDLINE=$(cat /proc/$PPID/cmdline | tr '\000' ' ' | sed -e 's|^rpmbuild||;s|[[:space:]]/.*rpmbuild/.*$||;s/--define[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\)/--define "\1 \2"/g')
+
+pushd ${HOME}
+for pkg in gmp mpfr mpc isl cloog-isl; do
+    sh -c "rpmbuild ${RPMBUILD_CMDLINE} /home/abuild/rpmbuild/SOURCES/${pkg}.spec"
+    RPM_NAME=$(find '/home/abuild/rpmbuild/RPMS' -name "${pkg}-*.rpm" -not -name '*.src.rpm' -not -name '*debug*')
+    sudo rpm -i ${RPM_NAME}
+    find '/home/abuild/rpmbuild/' -name "${pkg}*.rpm" -delete
+done
+popd
+# End of dependencies preparation
+#################
+
 rm -rf obj
 mkdir obj
 cd obj
index 1088e56..d067a3c 100644 (file)
@@ -64,6 +64,7 @@ BuildRequires: zlib-devel
 BuildRequires: glibc-devel-32bit
 %endif
 BuildRequires: perl
+BuildRequires: sudo-rpm
 %{?cross:BuildRequires: binutils-%{cross}}
 # here we use %%if because OBS spec parser cannot expand
 # %%{?macro:...} correctly
@@ -615,6 +616,26 @@ A foreign function interface is the popular name for the interface that allows c
 %setup -q -n gcc-%{version}
 
 %build
+#################
+# This section is done due to license issues with LGPLv3 version of GNU GMP library.
+# To ensure there is no way to set up LGPLv3 GMP to device and to link any Tizen application with it we build all dependencies right in GCC buildroot.
+# The right way is to manage dependencies with OBS but we are forced to remove packages and make external usage impossible they will be built here.
+# Using rpmbuild lets us to keep dependencies in git repositories and debug them in other OBS projects.
+#
+# Prepare dependencies
+RPMBUILD_CMDLINE=$(cat /proc/$PPID/cmdline | tr '\000' ' ' | sed -e 's|^rpmbuild||;s|[[:space:]]/.*rpmbuild/.*$||;s/--define[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\)/--define "\1 \2"/g')
+
+pushd ${HOME}
+for pkg in gmp mpfr mpc isl cloog-isl; do
+    sh -c "rpmbuild ${RPMBUILD_CMDLINE} /home/abuild/rpmbuild/SOURCES/${pkg}.spec"
+    RPM_NAME=$(find '/home/abuild/rpmbuild/RPMS' -name "${pkg}-*.rpm" -not -name '*.src.rpm' -not -name '*debug*')
+    sudo rpm -i ${RPM_NAME}
+    find '/home/abuild/rpmbuild/' -name "${pkg}*.rpm" -delete
+done
+popd
+# End of dependencies preparation
+#################
+
 rm -rf obj
 mkdir obj
 cd obj