1515# -v, --version <version> : Specify the version (required)
1616# -h, --help : Display this help and exit
1717# -n, --dry-run : Show what would be done, without making any changes
18+ # --custom-name : Custom package name
1819#
1920# Example:
2021# ./build-deb.sh -v 1.5.5 # Build with version 1.5.5
3435set -euo pipefail
3536
3637# Default values
38+ PACKAGE=" greenplum-db-6"
3739VERSION=" "
3840RELEASE=" 1"
3941DEBUG_BUILD=false
42+ CUSTOM_NAME=" "
4043
4144# Function to display usage information
4245usage () {
4346 echo " Usage: $0 [-v <version>] [-h] [--dry-run]"
4447 echo " -v, --version <version> : Specify the version (optional)"
4548 echo " -h, --help : Display this help and exit"
4649 echo " -n, --dry-run : Show what would be done, without making any changes"
50+ echo " --custom-name : Custom package name"
4751 exit 1
4852}
4953
@@ -60,7 +64,7 @@ check_commands() {
6064
6165function print_changelog() {
6266cat << EOF
63- greenplum-db-6 (${GPDB_PKG_VERSION} ) stable; urgency=low
67+ ${PACKAGE} (${GPDB_PKG_VERSION} ) stable; urgency=low
6468
6569 * open-gpdb autobuild
6670
@@ -82,6 +86,10 @@ while [[ "$#" -gt 0 ]]; do
8286 DRY_RUN=true
8387 shift
8488 ;;
89+ --custom-name)
90+ CUSTOM_NAME=" $2 "
91+ shift 2
92+ ;;
8593 * )
8694 echo " Unknown option: ($1 )"
8795 shift
@@ -122,6 +130,14 @@ if [ ! -f "$CONTROL_FILE" ]; then
122130 exit 1
123131fi
124132
133+ # Change package name to custom
134+ if [ -n " $CUSTOM_NAME " ]; then
135+ PACKAGE=" $CUSTOM_NAME "
136+ sed -i " s/^Source: .*/Source: $CUSTOM_NAME /" " $CONTROL_FILE "
137+ sed -i " s/^Package: .*/Package: $PACKAGE /" " $CONTROL_FILE "
138+ sed -i " s/^Description:/Conflicts: greenplum-db-6\nDescription:/" " $CONTROL_FILE "
139+ fi
140+
125141# Build the rpmbuild command based on options
126142DEBBUILD_CMD=" dpkg-buildpackage -us -uc"
127143
0 commit comments