Skip to content

Commit d4ac034

Browse files
authored
DLPX-95062 simplify challenge-response package build (#368)
PR URL: https://www.github.com/delphix/linux-pkg/pull/368
1 parent 0eea2f2 commit d4ac034

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

lib/common.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,24 @@ function push_to_remote() {
10871087
#
10881088
function set_changelog() {
10891089
check_env PACKAGE_REVISION
1090-
local src_package="${1:-$PACKAGE}"
10911090
local final_version
10921091

1092+
#
1093+
# If the name of the source package isn't passed in as a parameter,
1094+
# then deduce it. If there's a debian/control file that specifies that
1095+
# package name, then use it. Otherwise, default to the name of the
1096+
# linux-pkg directory name. This can't always be the default because
1097+
# for some packages, those are different. For example, the
1098+
# challenge-response linux-pkg directory generates the
1099+
# pam-challenge-response debian package.
1100+
#
1101+
if [[ -n $1 ]]; then
1102+
src_package=$1
1103+
elif [[ -f debian/control ]]; then
1104+
src_package=$(awk '/^Source:/ { print $2 }' debian/control)
1105+
fi
1106+
src_package=${src_package:-$PACKAGE}
1107+
10931108
#
10941109
# If PACKAGE_VERSION hasn't been set already, then retrieve it from
10951110
# The changelog file. If the changelog file doesn't exist, which

packages/challenge-response/config.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,9 @@
1919
DEFAULT_PACKAGE_GIT_URL="https://github.com/delphix/challenge-response.git"
2020

2121
function prepare() {
22-
logmust install_pkgs \
23-
libpam0g-dev \
24-
libssl-dev \
25-
uuid-dev
22+
install_build_deps_from_control_file
2623
}
2724

2825
function build() {
29-
logmust cd "$WORKDIR/repo/challenge_response/lib"
30-
PACKAGE_VERSION=$(date +%Y.%m.%d.%H)
31-
logmust set_changelog
32-
33-
logmust cd "$WORKDIR/repo/challenge_response"
34-
logmust make package
35-
logmust mv "./$(dpkg-architecture -q DEB_HOST_GNU_CPU)"/*deb "$WORKDIR/artifacts/"
26+
dpkg_buildpackage_default
3627
}

0 commit comments

Comments
 (0)