rpmbuild: Add routine for generating a standalone rpm .spec
Signed-off-by: Michal Berger <michalx.berger@intel.com> Change-Id: Ib8e139b928fd3e8cea67ebdc3ff1e464f51598bc Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8389 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: <tomasz.rochumski@intel.com>
This commit is contained in:
parent
f6ab6c09e3
commit
47ee30d3e3
@ -32,6 +32,9 @@ function build_rpms() (
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_rpm() {
|
build_rpm() {
|
||||||
|
# Separate run to see the final .spec in use
|
||||||
|
GEN_SPEC=yes BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
|
||||||
|
# Actual build
|
||||||
BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
|
BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
|
||||||
install_uninstall_rpms
|
install_uninstall_rpms
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,9 @@ get_version() {
|
|||||||
echo "${version%%-*}"
|
echo "${version%%-*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_rpm() (
|
build_macros() {
|
||||||
local macros=() dir
|
local -g macros=()
|
||||||
|
local dir
|
||||||
|
|
||||||
macros+=(-D "configure ${configure:-"%{nil}"}")
|
macros+=(-D "configure ${configure:-"%{nil}"}")
|
||||||
macros+=(-D "make $make")
|
macros+=(-D "make $make")
|
||||||
@ -113,9 +114,13 @@ build_rpm() (
|
|||||||
macros+=(-D "build_requirements 1")
|
macros+=(-D "build_requirements 1")
|
||||||
macros+=(-D "build_requirements_list $build_requirements")
|
macros+=(-D "build_requirements_list $build_requirements")
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
cd "$rootdir"
|
gen_spec() {
|
||||||
|
rpmspec "${macros[@]}" -P "$spec"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_rpm() (
|
||||||
fedora_python_sys_path_workaround
|
fedora_python_sys_path_workaround
|
||||||
|
|
||||||
# Despite building in-place, rpmbuild still looks under source dir as defined
|
# Despite building in-place, rpmbuild still looks under source dir as defined
|
||||||
@ -139,4 +144,9 @@ version=${SPDK_VERSION:-$(get_version)}
|
|||||||
rpmbuild_dir=${BUILDDIR:-"$HOME/rpmbuild"}
|
rpmbuild_dir=${BUILDDIR:-"$HOME/rpmbuild"}
|
||||||
spec=$specdir/spdk.spec
|
spec=$specdir/spdk.spec
|
||||||
|
|
||||||
|
build_macros
|
||||||
|
if [[ -n $GEN_SPEC ]]; then
|
||||||
|
gen_spec
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
build_rpm
|
build_rpm
|
||||||
|
Loading…
Reference in New Issue
Block a user