Skip to content

Commit bd13d08

Browse files
ignores for RPM
1 parent 1e0c713 commit bd13d08

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

cmake/cpack_manage.cmake

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ if(NOT RPM)
22
return()
33
endif()
44

5+
# Define %ignore as a comment so RPM doesn't claim ownership of shared directories
6+
set(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
7+
%define ignore \#
8+
")
9+
10+
set(ignored
11+
"%ignore /usr"
12+
"%ignore /usr/local"
13+
"%ignore /bin"
14+
"%ignore /lib"
15+
"%ignore /usr/sbin"
16+
"%ignore /usr/lib64/mysql"
17+
"%ignore /usr/lib64/mysql/plugin"
18+
"%ignore /etc/my.cnf.d"
19+
"%ignore /var/lib"
20+
"%ignore /var"
21+
)
22+
23+
set(CPACK_RPM_columnstore-engine_USER_FILELIST ${ignored})
24+
525
macro(columnstore_append_for_cpack var_name)
626
# Get current value from parent scope or use empty string
727
if(DEFINED ${var_name})
@@ -32,48 +52,29 @@ macro(columnstore_add_rpm_deps)
3252
columnstore_append_for_cpack(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES ${ARGN})
3353
endmacro()
3454

35-
if(NOT COLUMNSTORE_MAINTAINER)
36-
return()
37-
endif()
38-
39-
# Columnstore-specific RPM packaging overrides 1) Use fast compression to speed up packaging
40-
set(CPACK_RPM_COMPRESSION_TYPE
41-
"zstd"
42-
CACHE STRING "RPM payload compression" FORCE
43-
)
44-
# 2) Disable debuginfo/debugsource to avoid slow packaging and duplicate file warnings
45-
set(CPACK_RPM_DEBUGINFO_PACKAGE
46-
OFF
47-
CACHE BOOL "Disable debuginfo package" FORCE
48-
)
49-
set(CPACK_RPM_PACKAGE_DEBUG
50-
0
51-
CACHE STRING "Disable RPM debug package" FORCE
52-
)
53-
unset(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX CACHE)
54-
55-
# Ensure our overrides are applied by CPack at packaging time CPACK_PROJECT_CONFIG_FILE is included by cpack after
56-
# CPackConfig.cmake is loaded
57-
set(CPACK_PROJECT_CONFIG_FILE
58-
"${CMAKE_CURRENT_LIST_DIR}/cpack_overrides.cmake"
59-
CACHE FILEPATH "Columnstore CPack overrides" FORCE
60-
)
61-
6255
columnstore_add_rpm_deps("snappy" "jemalloc" "procps-ng" "gawk")
6356

57+
if(COLUMNSTORE_MAINTAINER)
58+
# Columnstore-specific RPM packaging overrides 1) Use fast compression to speed up packaging
59+
set(CPACK_RPM_COMPRESSION_TYPE
60+
"zstd"
61+
CACHE STRING "RPM payload compression" FORCE
62+
)
63+
# 2) Disable debuginfo/debugsource to avoid slow packaging and duplicate file warnings
64+
set(CPACK_RPM_DEBUGINFO_PACKAGE
65+
OFF
66+
CACHE BOOL "Disable debuginfo package" FORCE
67+
)
68+
set(CPACK_RPM_PACKAGE_DEBUG
69+
0
70+
CACHE STRING "Disable RPM debug package" FORCE
71+
)
72+
unset(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX CACHE)
6473

65-
SET(ignored
66-
"%ignore /usr"
67-
"%ignore /usr/local"
68-
"%ignore /bin"
69-
"%ignore /lib"
70-
"%ignore /usr/sbin"
71-
"%ignore /usr/lib64/mysql"
72-
"%ignore /usr/lib64/mysql/plugin"
73-
"%ignore /etc/my.cnf.d"
74-
"%ignore /var/lib"
75-
"%ignore /var"
76-
)
77-
78-
SET(CPACK_RPM_columnstore-engine_USER_FILELIST ${ignored})
79-
INCLUDE (CPack)
74+
# Ensure our overrides are applied by CPack at packaging time CPACK_PROJECT_CONFIG_FILE is included by cpack after
75+
# CPackConfig.cmake is loaded
76+
set(CPACK_PROJECT_CONFIG_FILE
77+
"${CMAKE_CURRENT_LIST_DIR}/cpack_overrides.cmake"
78+
CACHE FILEPATH "Columnstore CPack overrides" FORCE
79+
)
80+
endif() # COLUMNSTORE_MAINTAINER

0 commit comments

Comments
 (0)