PROJECT(hal-rootstrap)
+SET(HAL_ROOTSTRAP "${PROJECT_NAME}")
+SET(HAL_ROOTSTRAP_HEADED "${PROJECT_NAME}-headed")
+
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "${PREFIX}/bin")
SET(INCLUDEDIR "${PREFIX}/include")
SET(LIBDIR ${CMAKE_LIBDIR_PREFIX})
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc
+CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP}.pc
+ @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP}.pc
+ DESTINATION ${LIBDIR}/pkgconfig)
+
+CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP_HEADED}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP_HEADED}.pc
@ONLY)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${HAL_ROOTSTRAP_HEADED}.pc
DESTINATION ${LIBDIR}/pkgconfig)
ADD_SUBDIRECTORY(script)
#!/bin/bash
function prepare_generation {
- if [[ ! -f "./rs-config" ]]; then
- echo "There is no rs-config."
+ local config_file="./rs-config"
+ local copy_dest=$1
+
+ if [[ ! -f "${config_file}" ]]; then
+ echo "There is no config file(${config_file})."
exit 1
fi
- local copy_dest=$1
-
- sed -i 's@^export BUILD_REQUIRED_INSTALLED_PATH=""@export BUILD_REQUIRED_INSTALLED_PATH="/"@' "./rs-config"
- sed -i 's@^export GBS_BUILDROOT=""@export GBS_BUILDROOT="'${copy_dest}'"@' "./rs-config"
+ sed -i 's@^export BUILD_REQUIRED_INSTALLED_PATH=.*$@export BUILD_REQUIRED_INSTALLED_PATH="/"@' "${config_file}"
+ sed -i 's@^export GBS_BUILDROOT=.*$@export GBS_BUILDROOT="'${copy_dest}'"@' "${config_file}"
}
function generate_rootstrap_ix86 {
function generate_rootstrap {
local arch=$1
+ local rootstrap_type=$2
+ local rootstrap_resource_dir="./rs_resource"
- cp -r '/tmp/rs_resource' .
+ rm -rf "${rootstrap_resource_dir}"
+ cp -r "/tmp/rs_resource/${ROOTSTRAP_TYPE}" "${rootstrap_resource_dir}"
case "${arch}" in
"arm")
}
ARCH=$1
-COPY_DEST=$2
+ROOTSTRAP_TYPE=$2
+COPY_DEST=$3
-if [[ -z "${ARCH}" ]] || [[ -z "${COPY_DEST}" ]]; then
- echo "2 parameters are required: <architecture> <generate destination>"
+if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]]; then
+ echo "3 parameters are required: <architecture> <rootstrap type> <generate destination>"
exit 1
fi
prepare_generation "${COPY_DEST}"
-generate_rootstrap "${ARCH}"
+generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}"
f.write("CXXflags: {}\n".format(' '.join(cxxflags)))
f.close()
-hal_rootstrap_pc_path = argv[1]
+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)
+write_to_pc(rootstrap_pc_path)
--- /dev/null
+# Package Information for pkg-config
+
+package_name=hal-rootstrap
+prefix=/opt/data/hal-rootstrap@PREFIX@
+exec_prefix=/opt/data/hal-rootstrap@EXEC_PREFIX@
+hal_rootstrap_dir=/opt/data/hal-rootstrap/headed
+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:
package_name=hal-rootstrap
prefix=/opt/data/hal-rootstrap@PREFIX@
exec_prefix=/opt/data/hal-rootstrap@EXEC_PREFIX@
-hal_rootstrap_dir=/opt/data/hal-rootstrap
+hal_rootstrap_dir=/opt/data/hal-rootstrap/common
hal_rootstrap_libdir=${hal_rootstrap_dir}@LIBDIR@
hal_rootstrap_include_dir=${hal_rootstrap_dir}@INCLUDEDIR@
-%define name hal-rootstrap
-%define devel_name hal-rootstrap-devel
-%define hal_rootstrap_install_path /opt/data/hal-rootstrap
+%define name hal-rootstrap
+%define devel_name hal-rootstrap-devel
+%define hal_rootstrap_install_path /opt/data/hal-rootstrap/common
+
+%define headed_name hal-rootstrap-headed
+%define headed_devel_name hal-rootstrap-headed-devel
+%define hal_rootstrap_headed_install_path /opt/data/hal-rootstrap/headed
Name: hal-rootstrap
Summary: Package for rootstrap of hal
%description checker
Checker for the hal rootstrap
+### hal-rootstrap-headed
+%package -n %{headed_name}
+Summary: Package for rootstrap of hal, for headed image
+
+%description -n %{headed_name}
+Package for rootstrap of hal, for headed image
+
+### hal-rootstrap-headed-devel
+%package -n %{headed_devel_name}
+Summary: %{headed_name} interface
+Group: Development/Libraries
+Requires: %{headed_name} = %{version}-%{release}
+
+%description -n %{headed_devel_name}
+${headed_name} Interface for product vendor developer
+
%prep
%setup -q
%cmake . -DCMAKE_LIBDIR_PREFIX=%{_libdir}
%install
rm -rf %{buildroot}
mkdir %{buildroot}
-./generate_rootstrap.sh "%{_arch}" "%{buildroot}%{hal_rootstrap_install_path}"
-
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
+
+# hal-rootstrap
+./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}"
cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap.pc" "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig"
+rm -f "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig/*.pc"
+
+# hal-rootstrap-headed
+./generate_rootstrap.sh "%{_arch}" "headed" "%{buildroot}%{hal_rootstrap_headed_install_path}"
+cp packaging/hal-rootstrap-headed.pc %{buildroot}%{_libdir}/pkgconfig/
+./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap-headed.pc" "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig"
+rm -f "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig/*.pc"
mkdir -p %{buildroot}%{_sysconfdir}/hal/rootstrap
install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/hal/rootstrap
rm -f %{_sysconfdir}/rpm/macros.hal-rootstrap-checker
%files
-%{hal_rootstrap_install_path}/etc/*
-%{hal_rootstrap_install_path}/lib*/*
-%{hal_rootstrap_install_path}/usr/share/*
-%{hal_rootstrap_install_path}/usr/lib*/*
+%{hal_rootstrap_install_path}
+%exclude %dir %{hal_rootstrap_install_path}/%{_includedir}
%files -n %{devel_name}
%defattr(-,root,root,-)
-%{hal_rootstrap_install_path}/%{_includedir}/*
-%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig/*.pc
-%{_libdir}/pkgconfig/*.pc
+%{hal_rootstrap_install_path}/%{_includedir}
+%{_libdir}/pkgconfig/hal-rootstrap.pc
+
+%files -n %{headed_name}
+%{hal_rootstrap_headed_install_path}
+%exclude %dir %{hal_rootstrap_headed_install_path}/%{_includedir}
+
+%files -n %{headed_devel_name}
+%defattr(-,root,root,-)
+%{hal_rootstrap_headed_install_path}/%{_includedir}
+%{_libdir}/pkgconfig/hal-rootstrap-headed.pc
%files checker
%defattr(-,root,root,-)