packaging: Add hal-rootstrap-devel package
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 9 Apr 2024 12:13:20 +0000 (21:13 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 9 Apr 2024 12:13:20 +0000 (21:13 +0900)
Add hal-rootstrap-devel package contains the hal-rootstrap.pc pkgconfig
file which specifies libdir and include_dir path.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
packaging/hal-rootstrap.pc.in [new file with mode: 0644]
packaging/hal-rootstrap.spec

index 7c8c3604ebd031d9bd91f5a6f3d3de7dfe27e9cc..fe9d563a1c1f491d17b094cc61383553e374d2db 100644 (file)
@@ -1 +1,14 @@
+PROJECT(hal-rootstrap)
+
+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
+       @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc
+       DESTINATION ${LIBDIR}/pkgconfig)
+
 ADD_SUBDIRECTORY(script)
diff --git a/packaging/hal-rootstrap.pc.in b/packaging/hal-rootstrap.pc.in
new file mode 100644 (file)
index 0000000..cf9b679
--- /dev/null
@@ -0,0 +1,16 @@
+# Package Information for pkg-config
+
+package_name=hal-rootstrap
+prefix=/opt/data/hal@PREFIX@
+exec_prefix=/opt/data/hal@EXEC_PREFIX@
+hal_rootstrap_libdir=/opt/data/hal/usr/lib
+hal_rootstrap_include_dir=/opt/data/hal/usr/include
+
+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}
index a1b84fe19fe475b2470f88da43895e40b3392e72..7995afc16ff87d87afb24e509c6361f48ee3a9ef 100644 (file)
@@ -1,3 +1,6 @@
+%define name           hal-rootstrap
+%define devel_name     hal-rootstrap-devel
+
 Name:          hal-rootstrap
 Summary:       Package for rootstrap of hal
 Version:       0.1.0
@@ -402,6 +405,17 @@ BuildRequires:  pkgconfig(hal-api-uwb)
 BuildRequires:  pkgconfig(hal-api-wifi)
 BuildRequires:  pkgconfig(hal-api-zigbee)
 
+### hal-rootstrap-devel
+%package -n    %{devel_name}
+Summary:       %{name} interface
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description -n        %{devel_name}
+%{name} Interface for product vendor developer
+
+
+### hal-rootstrap
 %description
 Package for rootstrap of hal
 
@@ -417,5 +431,14 @@ rm -rf %{buildroot}
 mkdir %{buildroot}
 ./copy_required_files.sh %{buildroot}
 
+mkdir -p %{buildroot}%{_libdir}/pkgconfig/
+cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
+
 %files
-/*
+/opt/data/hal/lib/*
+/opt/data/hal/usr/lib/*
+
+%files -n %{devel_name}
+%defattr(-,root,root,-)
+/opt/data/hal/usr/include/*
+%{_libdir}/pkgconfig/*.pc