Merge pull request #1001 from rafalste/multiarch-packages

Add multi-arch package build support
This commit is contained in:
Robert Baldyga 2021-12-09 10:57:02 +01:00 committed by GitHub
commit 8207d5d2b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -68,6 +68,7 @@ print_help() {
echo " dsc generate DSC (source DEB) package"
echo
echo "Options:"
echo " -a, --arch <ARCH> target platform architecture for packages"
echo " -o, --output-dir <DIR> put all created files in the given directory;"
echo " default: 'SOURCES_PATH/packages/'"
echo " -d, --debug create all debug files and packages as well"
@ -366,7 +367,7 @@ generate_rpm() {
if [ ! "$GENERATE_SRPM" ] && [ "$GENERATE_RPM" ]; then
echo "--- Building binary RPM packages"
(HOME="$TEMP_DIR"; rpmbuild -bb "$RPM_SPECS_DIR/$CAS_NAME.spec")
(HOME="$TEMP_DIR"; rpmbuild -bb --target "$ARCH" "$RPM_SPECS_DIR/$CAS_NAME.spec")
if [ $? -ne 0 ]; then
error "couldn't create RPM packages"
fi
@ -382,7 +383,7 @@ generate_rpm() {
fi
if [ "$GENERATE_SRPM" ] && [ "$GENERATE_RPM" ]; then
echo "--- Building source and binary RPM packages"
(HOME="$TEMP_DIR"; rpmbuild -ba "$RPM_SPECS_DIR/$CAS_NAME.spec")
(HOME="$TEMP_DIR"; rpmbuild -ba --target "$ARCH" "$RPM_SPECS_DIR/$CAS_NAME.spec")
if [ $? -ne 0 ]; then
error "couldn't create RPM packages"
fi
@ -407,7 +408,7 @@ generate_deb() {
if [ ! "$GENERATE_DSC" ] && [ "$GENERATE_DEB" ]; then
echo "--- Building binary DEB packages"
(cd "$DEB_SOURCES_DIR" && debuild -us -uc -b)
(cd "$DEB_SOURCES_DIR" && debuild -us -uc -b --host-type "$ARCH-linux-gnu")
if [ $? -ne 0 ]; then
error "couldn't create DEB packages"
fi
@ -425,7 +426,7 @@ generate_deb() {
fi
if [ "$GENERATE_DSC" ] && [ "$GENERATE_DEB" ]; then
echo "--- Building DEB and DSC (source DEB) packages"
(cd "$DEB_SOURCES_DIR" && debuild -us -uc -F)
(cd "$DEB_SOURCES_DIR" && debuild -us -uc -F --host-type "$ARCH-linux-gnu")
if [ $? -ne 0 ]; then
error "couldn't create DEB and DSC packages"
fi
@ -467,6 +468,10 @@ while (( $# )); do
dsc)
GENERATE_DSC="generate_dsc"
;;
--arch|-a)
ARCH="$2"
shift
;;
--output-dir|-o)
OUTPUT_DIR="$2"
if ! dirname $OUTPUT_DIR &>/dev/null; then

View File

@ -8,7 +8,7 @@ Homepage: <CAS_HOMEPAGE>
Vcs-Git: <CAS_GIT>
Package: <CAS_NAME>
Architecture: amd64
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, python3, python3-packaging, python3-yaml,
<CAS_NAME>-modules (= <CAS_VERSION>-1)
Description: Open Cache Acceleration Software
@ -20,7 +20,7 @@ Description: Open Cache Acceleration Software
running cache instances (no kernel modules).
Package: <CAS_NAME>-modules
Architecture: amd64
Architecture: any
Depends: ${misc:Depends}, debhelper (>= 9), dkms
Description: Open Cache Acceleration Software kernel modules (${kver})
Open Cache Acceleration Software (Open CAS) is an open source project