Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ export DH_OPTIONS
override_dh_auto_build:
gpg \
--no-default-keyring \
--homedir /tmp \
--keyring ./apache-arrow-apt-source.kbx \
--import KEYS
gpg \
--no-default-keyring \
--homedir /tmp \
--keyring ./apache-arrow-apt-source.kbx \
--armor \
--export > apache-arrow-apt-source.asc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN \
apt install -y -V ${quiet} \
base-files \
build-essential \
ccache \
clang \
cmake \
debhelper \
Expand Down
21 changes: 16 additions & 5 deletions dev/tasks/linux-packages/apt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

LANG=C

set -u
set -ux

# Set consistent umask for reproducible file permissions
umask 0022

run()
{
Expand Down Expand Up @@ -48,8 +51,9 @@ architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
debuild_options=()
dpkg_buildpackage_options=(-us -uc)

run mkdir -p /build
run cd /build
build_root_dir="/build"
run mkdir -p "${build_root_dir}"
run pushd "${build_root_dir}"
find . -not -path ./ccache -a -not -path "./ccache/*" -delete
if which ccache > /dev/null 2>&1; then
export CCACHE_COMPILERCHECK=content
Expand All @@ -67,6 +71,9 @@ if which ccache > /dev/null 2>&1; then
debuild_options+=(--prepend-path=/usr/lib/ccache)
fi
fi
build_dir="${build_root_dir}/build-${PACKAGE}-${VERSION}"
run mkdir -p "${build_dir}"
run pushd "${build_dir}"
run cp /host/tmp/${PACKAGE}-${VERSION}.tar.gz \
${PACKAGE}_${VERSION}.orig.tar.gz
run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
Expand All @@ -80,7 +87,7 @@ case "${VERSION}" in
${PACKAGE}-${VERSION}
;;
esac
run cd ${PACKAGE}-${VERSION}/
run pushd ${PACKAGE}-${VERSION}/
platform="${distribution}-${code_name}"
if [ -d "/host/tmp/debian.${platform}-${architecture}" ]; then
run cp -rp "/host/tmp/debian.${platform}-${architecture}" debian
Expand All @@ -102,7 +109,7 @@ df -h
if which ccache > /dev/null 2>&1; then
ccache --show-stats --verbose || :
fi
run cd -
run popd

repositories="/host/repositories"
package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
Expand All @@ -116,3 +123,7 @@ run \
-exec cp '{}' "${pool_dir}/" ';'

run chown -R "$(stat --format "%u:%g" "${repositories}")" "${repositories}"
run find "${repositories}"

run popd
rm -rf "${build_dir}"
4 changes: 3 additions & 1 deletion dev/tasks/linux-packages/package-task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def docker_run(os, architecture, console: false)
end
pass_through_env_names = [
"DEB_BUILD_OPTIONS",
"HOME",
"RPM_BUILD_NCPUS",
"TZ",
]
pass_through_env_names.each do |name|
value = ENV[name]
Expand Down Expand Up @@ -188,7 +190,7 @@ def docker_run(os, architecture, console: false)
run_command_line << image
run_command_line << "/host/build.sh" unless console

sh(*build_command_line)
sh(*build_command_line) if Dir.exist?(ENV["HOME"])
sh(*run_command_line)
end

Expand Down