remove_dir ${DIR_TMP} ${DIR_TARGET}
callRootstrapGen target ${RPM_PKG_SVR_TARGET} ${BASE_PKG_SVR_TARGET}
- log "[INFO] Postscript ${DIR_TARGET}";
+ log "[INFO] Postscript ${GBS_BUILDROOT}";
- mv ${DIR_TARGET}/usr/include/asm-arm ${DIR_TARGET}/usr/include/asm
- mv ${DIR_TARGET}/usr/include/base/deprecated/* ${DIR_TARGET}/usr/include/base/
+ mv ${GBS_BUILDROOT}/usr/include/asm-arm ${GBS_BUILDROOT}/usr/include/asm
+ mv ${GBS_BUILDROOT}/usr/include/base/deprecated/* ${GBS_BUILDROOT}/usr/include/base/
if [ "$INTERNAL" = false ]; then
echo "remove Non-Public EFL API"
if [ "$INTERNAL" = true ]; then
log "[INFO] Skip .. removing dlog-internal.h"
- find ${DIR_TARGET} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
else
- find ${DIR_TARGET} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
fi
- if [ ! -d "${DIR_TARGET}/usr/lib" ]; then
- mkdir -p ${DIR_TARGET}/usr/lib
+ if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
+ mkdir -p ${GBS_BUILDROOT}/usr/lib
fi
- for FILE in $(find ${DIR_TARGET} -name "*.so.*mobile");
+ for FILE in $(find ${GBS_BUILDROOT} -name "*.so.*mobile");
do
mv ${FILE} ${FILE%.mobile};
done;
--- /dev/null
+#!/usr/bin/python3
+
+from sys import argv
+from os import listdir
+from re import compile as regex_compile
+
+include_dir_root_path = "hal_rootstrap_dir"
+
+regex_assignment = regex_compile("\s*([-_a-zA-Z0-9]+)\s*=\s*([^\s]*)")
+regex_declaration = regex_compile("\s*([-_a-zA-Z0-9]+)\s*:\s*(.+)\s*")
+regex_substitution = regex_compile("\${([-_a-zA-Z0-9]+)}")
+
+libs = { "-L${" + include_dir_root_path + "}" }
+cflags = { "-I${" + include_dir_root_path + "}" }
+cxxflags = { "-I${" + include_dir_root_path + "}" }
+
+def parse_pc(fname):
+ variables = dict()
+
+ f = open(fname, "r")
+ for line in f:
+ if matches := regex_assignment.findall(line):
+ symbol, value = matches[0][0], matches[0][1]
+ matched_symbols = regex_substitution.findall(value)
+ for matched_symbol in matched_symbols:
+ value = value.replace("${{{}}}".format(matched_symbol), "{}".format(variables[matched_symbol]))
+ variables[symbol] = value
+ continue
+ if matches := regex_declaration.findall(line):
+ symbol, value = matches[0][0], matches[0][1]
+ matched_symbols = regex_substitution.findall(value)
+ for matched_symbol in matched_symbols:
+ value = value.replace("${{{}}}".format(matched_symbol), "{}".format(variables[matched_symbol]))
+ if symbol == "Libs":
+ libs.update(set(map(lambda value: value[:2] + "${" + include_dir_root_path + "}" + value[2:] if value[2] == '/' else value, value.split())))
+ continue
+ if symbol == "Cflags":
+ cflags.update((map(lambda value: value[:2] + "${" + include_dir_root_path + "}" + value[2:] if value[2] == '/' else value, value.split())))
+ continue
+ if symbol == "CXXflags":
+ cxxflags.update(list(map(lambda value: value[:2] + "${" + include_dir_root_path + "}" + value[2:] if value[2] == '/' else value, value.split())))
+ continue
+
+ f.close()
+
+def write_to_pc(fname):
+ f = open(fname, "a")
+ f.write("\n")
+ f.write("Libs: {}\n".format(' '.join(libs)))
+ f.write("Cflags: {}\n".format(' '.join(cflags)))
+ f.write("CXXflags: {}\n".format(' '.join(cxxflags)))
+ f.close()
+
+hal_rootstrap_pc_path = argv[1]
+pc_dir = argv[2]
+pc_files = listdir(pc_dir)
+
+for pc_file in pc_files:
+ parse_pc("{}/{}".format(pc_dir, pc_file))
+
+write_to_pc(hal_rootstrap_pc_path)
package_name=hal-rootstrap
prefix=/opt/data/hal-rootstrap@PREFIX@
exec_prefix=/opt/data/hal-rootstrap@EXEC_PREFIX@
-hal_rootstrap_libdir=/opt/data/hal-rootstrap@LIBDIR@
-hal_rootstrap_include_dir=/opt/data/hal-rootstrap@INCLUDEDIR@
+hal_rootstrap_dir=/opt/data/hal-rootstrap
+hal_rootstrap_libdir=${hal_rootstrap_dir}@LIBDIR@
+hal_rootstrap_include_dir=${hal_rootstrap_dir}@INCLUDEDIR@
Name: ${package_name}
Description: ${package_name} interface
Version: @VERSION@
Requires:
-Libs: -L${hal_rootstrap_libdir}
-Cflags: -I${hal_rootstrap_include_dir}
-CXXflags: -I${hal_rootstrap_include_dir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
+./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap.pc" "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig"
%files
%{hal_rootstrap_install_path}/lib/*