diff --git a/lib/common.sh b/lib/common.sh index 59279ab..6f8fdf3 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -1087,9 +1087,24 @@ function push_to_remote() { # function set_changelog() { check_env PACKAGE_REVISION - local src_package="${1:-$PACKAGE}" local final_version + # + # If the name of the source package isn't passed in as a parameter, + # then deduce it. If there's a debian/control file that specifies that + # package name, then use it. Otherwise, default to the name of the + # linux-pkg directory name. This can't always be the default because + # for some packages, those are different. For example, the + # challenge-response linux-pkg directory generates the + # pam-challenge-response debian package. + # + if [[ -n $1 ]]; then + src_package=$1 + elif [[ -f debian/control ]]; then + src_package=$(awk '/^Source:/ { print $2 }' debian/control) + fi + src_package=${src_package:-$PACKAGE} + # # If PACKAGE_VERSION hasn't been set already, then retrieve it from # The changelog file. If the changelog file doesn't exist, which diff --git a/packages/challenge-response/config.sh b/packages/challenge-response/config.sh index 8d07ed8..997f96f 100644 --- a/packages/challenge-response/config.sh +++ b/packages/challenge-response/config.sh @@ -19,18 +19,9 @@ DEFAULT_PACKAGE_GIT_URL="https://github.com/delphix/challenge-response.git" function prepare() { - logmust install_pkgs \ - libpam0g-dev \ - libssl-dev \ - uuid-dev + install_build_deps_from_control_file } function build() { - logmust cd "$WORKDIR/repo/challenge_response/lib" - PACKAGE_VERSION=$(date +%Y.%m.%d.%H) - logmust set_changelog - - logmust cd "$WORKDIR/repo/challenge_response" - logmust make package - logmust mv "./$(dpkg-architecture -q DEB_HOST_GNU_CPU)"/*deb "$WORKDIR/artifacts/" + dpkg_buildpackage_default }