Modify bsdiff to be built during gbs build 14/310814/1
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 23 Apr 2024 02:32:20 +0000 (11:32 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 8 May 2024 11:26:08 +0000 (20:26 +0900)
Since bsdiff(executable name is ss_bsdiff) is required to make delta
image, CMakeLists.txt and .spec files are modified to make it to be
built during the gbs build.
ss_bsdiff is installed under /upgrade-tools/mk_delta/common/bin.

Change-Id: Ib7fda42c8677f5ebb9d892b87c90fc5e25ae2370
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
CMakeLists.txt
bsdiff/CMakeLists.txt
packaging/upgrade-tools.spec

index fd12d3e..028b5fa 100644 (file)
@@ -1 +1,3 @@
 PROJECT(upgrade-tools)
+
+ADD_SUBDIRECTORY(bsdiff)
index fb65ea5..66d45f8 100644 (file)
@@ -17,4 +17,4 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 
 ADD_EXECUTABLE(ss_bsdiff ${ss_bsdiff_SRCS})
 TARGET_LINK_LIBRARIES(ss_bsdiff ${${PROJECT_NAME}_pkgs_LDFLAGS} "-g" "-pthread")
-INSTALL(TARGETS ss_bsdiff DESTINATION bin)
+INSTALL(TARGETS ss_bsdiff DESTINATION ${INSTALL_PATH})
index cd8f80e..ae513cf 100644 (file)
@@ -1,3 +1,7 @@
+%define install_path /%{name}
+%define mk_delta_install_path %{install_path}/mk_delta
+%define bin_install_path %{mk_delta_install_path}/common/bin
+
 Name:          upgrade-tools
 Version:       0.1.0
 Release:       0
@@ -7,23 +11,25 @@ Group:               System/Tools
 Source0:       %{name}-%{version}.tar.gz
 
 BuildRequires: cmake
-BuildRequires: pkgconfig(python3)
+BuildRequires: pkgconfig(libbrotlienc)
+BuildRequires: pkgconfig(libdivsufsort)
 
 %description
 Tools for upgrade
 
 %prep
 %setup -q
-%cmake .
+%cmake . -DINSTALL_PATH=%{bin_install_path}
 
 %build
 make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}/upgrade-tools/mk_delta
-cp -r ./scripts %{buildroot}/upgrade-tools/.
-cp -r ./mk_delta/common %{buildroot}/upgrade-tools/mk_delta/.
+mkdir -p %{buildroot}/%{bin_install_path}
+cp -r ./scripts %{buildroot}/%{install_path}
+cp -r ./mk_delta/common %{buildroot}/%{mk_delta_install_path}/.
+%make_install
 
 %files
-/upgrade-tools/*
+%{install_path}/*