hal: Make separate pass-hal-devel package 88/113288/1
authorWook Song <wook16.song@samsung.com>
Tue, 7 Feb 2017 05:37:03 +0000 (14:37 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 7 Feb 2017 05:44:19 +0000 (14:44 +0900)
This patch makes a separate package for pass-hal-devel. This package
includes header files to build the board-specific pass-hal packages.

Change-Id: Ia0581023a588ff7a1d39549c23a56268c808417d
Signed-off-by: Wook Song <wook16.song@samsung.com>
CMakeLists.txt
packaging/pass-hal-devel.manifest [new file with mode: 0644]
packaging/pass.spec
pass-hal-devel.pc.in [new file with mode: 0644]
src/hal/CMakeLists.txt [new file with mode: 0755]
src/hal/hal-cpu-example.c

index 2116f1b..eaffb0a 100644 (file)
@@ -59,6 +59,7 @@ SET(INCLUDEDIR "${PREFIX}/include/${PROJECT_NAME}")
 SET(DATADIR "${PREFIX}/share/${PROJECT_NAME}")
 SET(CONFDIR "/etc/${PROJECT_NAME}")
 SET(VERSION 0.1.0)
+SET(PASS_HAL_NAME pass-hal-devel)
 
 SET(SRCS
        src/pass/pass.c
@@ -162,6 +163,8 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pmqos/pass-pmqos.conf DESTINATION
 
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+CONFIGURE_FILE(${PASS_HAL_NAME}.pc.in ${PASS_HAL_NAME}.pc @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PASS_HAL_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/system
                FILES_MATCHING
@@ -170,3 +173,4 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/s
                )
 
 ADD_SUBDIRECTORY(src/shared)
+ADD_SUBDIRECTORY(src/hal)
diff --git a/packaging/pass-hal-devel.manifest b/packaging/pass-hal-devel.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
index 07677d2..fe944a4 100644 (file)
@@ -1,6 +1,7 @@
 
 %define _unpackaged_files_terminate_build 0
 %define daemon_name pass
+%define hal_name pass-hal-devel
 
 %if "%{?profile}" == "mobile"
 %endif
@@ -21,6 +22,7 @@ Group:      System/Kernel
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
+Source2:    %{hal_name}.manifest
 
 BuildRequires:  cmake
 BuildRequires:  libattr-devel
@@ -49,6 +51,14 @@ Group:      main
 %description %{daemon_name}
 PASS systemd daemon.
 
+%package -n    %{hal_name}
+Summary:       PASS HAL Header files
+Group:         Development/Library
+Requires:      pass = %{version}-%{release}
+
+%description -n        %{hal_name}
+Header files required to build pass-hal packages for specific boards.
+
 %prep
 %setup -q
 %if %{with emulator}
@@ -84,6 +94,7 @@ PASS systemd daemon.
 
 %build
 cp %{SOURCE1} .
+cp %{SOURCE2} .
 make %{?jobs:-j%jobs}
 
 %install
@@ -123,3 +134,9 @@ systemctl daemon-reload
 %{_unitdir}/sockets.target.wants/%{daemon_name}.socket
 %{_unitdir}/%{daemon_name}.service
 %{_unitdir}/%{daemon_name}.socket
+%files -n %{hal_name}
+%defattr(-,root,root,-)
+%manifest %{hal_name}.manifest
+%{_includedir}/%{daemon_name}/hal.h
+%{_includedir}/%{daemon_name}/hal-log.h
+%{_libdir}/pkgconfig/%{hal_name}.pc
diff --git a/pass-hal-devel.pc.in b/pass-hal-devel.pc.in
new file mode 100644 (file)
index 0000000..16fcdfc
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+package_name=pass-hal-devel
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDEDIR@
+
+Name: ${package_name}
+Description: --
+Version: @VERSION@
+Requires:
+Cflags: -I${includedir}
diff --git a/src/hal/CMakeLists.txt b/src/hal/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..ade8159
--- /dev/null
@@ -0,0 +1,15 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(pass-hal-devel C)
+
+SET(HAL_HEADERS
+       hal.h
+       hal-log.h
+)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       dlog)
+
+FOREACH(hheader ${HAL_HEADERS})
+       INSTALL(FILES ${hheader} DESTINATION ${INCLUDEDIR})
+ENDFOREACH(hheader)
index bc3896a..6817d87 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/types.h>
 #include <linux/un.h>
 
-#include <hal/hal.h>
+#include <pass/hal.h>
 
 
 static int get_curr_governor(char *res_name, char *governor)