@@ -3,9 +3,14 @@ set(CPACK_GENERATOR "RPM")
3
3
set (CPACK_COMPONENTS_IGNORE_GROUPS 1)
4
4
set (CPACK_RPM_COMPONENT_INSTALL ON )
5
5
# use "server" as main component so its RPM filename won't have "server"
6
- set (CPACK_RPM_MAIN_COMPONENT "server" )
6
+ if (BUILD_CDC_ONLY)
7
+ set (CPACK_RPM_MAIN_COMPONENT "cdc" )
8
+ else ()
9
+ set (CPACK_RPM_MAIN_COMPONENT "server" )
10
+ endif ()
7
11
# let rpmbuild determine rpm filename
8
12
set (CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
13
+ set (CMAKE_INSTALL_LIBDIR "lib64" )
9
14
## Stardard debuginfo generating instructions in cmake. However 6u
10
15
## server with rpm-4.8.0 which doesn't support dwarf4 won't generate
11
16
## BUILDID for RPM. And Our debuginfo package doesn't contain source
@@ -40,7 +45,7 @@ set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
40
45
set (CPACK_RPM_PACKAGE_LICENSE "Mulan PubL v2." )
41
46
set (CPACK_RPM_DEFAULT_USER "admin" )
42
47
set (CPACK_RPM_DEFAULT_GROUP "admin" )
43
- if (OB_BUILD_OPENSOURCE)
48
+ if (OB_BUILD_OPENSOURCE AND NOT BUILD_CDC_ONLY )
44
49
set (DEBUG_INSTALL_POST "mv $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell %{_builddir}/obshell; %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir}; mv %{_builddir}/obshell $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell; %{nil}" )
45
50
else ()
46
51
set (DEBUG_INSTALL_POST "%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir};%{nil}" )
@@ -102,14 +107,25 @@ install(FILES
102
107
COMPONENT server)
103
108
endif ()
104
109
110
+ if (BUILD_CDC_ONLY)
111
+ message (STATUS "oceanbase build cdc only" )
112
+ set (CPACK_COMPONENTS_ALL cdc)
113
+ set (CPACK_PACKAGE_NAME "oceanbase-cdc" )
114
+ if (OB_BUILD_OPENSOURCE)
115
+ set (CPACK_PACKAGE_NAME "oceanbase-ce-cdc" )
116
+ endif ()
117
+ else ()
118
+ add_custom_target (bitcode_to_elf ALL
119
+ DEPENDS ${BITCODE_TO_ELF_LIST} )
120
+ add_custom_target (ob_table ALL
121
+ DEPENDS obtable obtable_static)
122
+ endif ()
123
+ message (STATUS "Cpack Components:${CPACK_COMPONENTS_ALL} " )
124
+
105
125
# install cpack to make everything work
106
126
include (CPack)
107
127
108
128
#add rpm target to create RPMS
109
129
add_custom_target (rpm
110
130
COMMAND +make package
111
- DEPENDS
112
- observer obcdc_tailf obtable obtable_static
113
- ob_admin ob_error ob_sql_proxy_parser_static
114
- ${BITCODE_TO_ELF_LIST}
115
131
)
0 commit comments