Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve packaging for Debian 12 #22

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jenkins/package-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ node {
sh "chmod +x " + runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh"
sh runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh " + runtimeSrcPath + " " + runtimeInstallPath

sshPublisher(publishers: [sshPublisherDesc(configName: 'marco-package', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: configName, remoteDirectorySDF: false, sourceFiles: '*.deb')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
sshPublisher(publishers: [sshPublisherDesc(configName: 'marco-package', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: configName + "/amd64", remoteDirectorySDF: false, sourceFiles: '*.deb')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
Expand Down
32 changes: 17 additions & 15 deletions .jenkins/package/debian-12/build.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
#!/bin/sh

# The path where the project was cloned.
src_path=$1

# The path where the project was installed.
install_path=$2

# Extract version and architecture from the control file.
version=$(grep "^Version:" "${src_path}/.jenkins/package/debian-12/control" | cut -d' ' -f2)
architecture=$(grep "^Architecture:" "${src_path}/.jenkins/package/debian-12/control" | cut -d' ' -f2)

# Create folders.
mkdir -p marco-runtime/DEBIAN
mkdir -p marco-runtime/usr/lib/marco-runtime
package_name=marco-runtime-${version}_${architecture}

mkdir -p "${package_name}"/DEBIAN
mkdir -p "${package_name}"/usr/lib/marco-runtime

# Copy the control file.
cp "${src_path}/.jenkins/package/debian-12/control" marco-runtime/DEBIAN/control
cp "${src_path}/.jenkins/package/debian-12/control" "${package_name}"/DEBIAN/control

# Copy the libraries.
cp "${install_path}"/lib/*.a marco-runtime/usr/lib/marco-runtime
cp "${install_path}"/lib/*.so marco-runtime/usr/lib/marco-runtime
chmod +x marco-runtime/usr/lib/marco-runtime/*.so
cp "${install_path}"/lib/*.a "${package_name}"/usr/lib/marco-runtime
cp "${install_path}"/lib/*.so "${package_name}"/usr/lib/marco-runtime
chmod +x "${package_name}"/usr/lib/marco-runtime/*.so

# Build the package.
dpkg-deb --build marco-runtime
dpkg-deb --build "${package_name}"

# Clean the work directory.
rm -rf marco-runtime

# Extract version and architecture from the control file.
version=$(grep "^Version:" "${src_path}/.jenkins/package/debian-12/control" | cut -d' ' -f2)
architecture=$(grep "^Architecture:" "${src_path}/.jenkins/package/debian-12/control" | cut -d' ' -f2)

# Rename the package.
mv marco-runtime.deb marco-runtime-${version}_${architecture}.deb
rm -rf "${package_name}"