Build debian package for SQLCipher4
This commit is contained in:
parent
2f68084bdd
commit
d1aa5762bc
28 changed files with 285904 additions and 168 deletions
78
Dockerfile.debbuild
Normal file
78
Dockerfile.debbuild
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
ARG BASE_IMAGE=debian:bookworm
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# If Ubuntu, ensure Universe is enabled.
|
||||
RUN set -eux; \
|
||||
. /etc/os-release; \
|
||||
if [ "${ID:-}" = "ubuntu" ]; then \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends software-properties-common ca-certificates; \
|
||||
add-apt-repository -y universe; \
|
||||
fi;
|
||||
|
||||
# Build deps
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
devscripts \
|
||||
debhelper \
|
||||
dh-python \
|
||||
python3-all-dev \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
libssl-dev \
|
||||
ca-certificates \
|
||||
rsync \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Build runner script
|
||||
RUN set -eux; \
|
||||
cat > /usr/local/bin/build-deb <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SRC="${SRC:-/src}"
|
||||
WORKROOT="${WORKROOT:-/work}"
|
||||
WORK="${WORKROOT}/src"
|
||||
OUT="${OUT:-/out}"
|
||||
|
||||
mkdir -p "$WORK" "$OUT"
|
||||
|
||||
rsync -a --delete \
|
||||
--exclude '.git' \
|
||||
--exclude '.venv' \
|
||||
--exclude 'dist' \
|
||||
--exclude 'build' \
|
||||
--exclude '__pycache__' \
|
||||
--exclude '.pytest_cache' \
|
||||
--exclude '.mypy_cache' \
|
||||
"${SRC}/" "${WORK}/"
|
||||
|
||||
cd "${WORK}"
|
||||
if [ -n "${SUITE:-}" ]; then
|
||||
export DEBEMAIL="mig@mig5.net"
|
||||
export DEBFULLNAME="Miguel Jacq"
|
||||
|
||||
dch --distribution "$SUITE" --local "~${SUITE}" "CI build for $SUITE"
|
||||
fi
|
||||
dpkg-buildpackage -us -uc -b
|
||||
|
||||
shopt -s nullglob
|
||||
cp -v "${WORKROOT}"/*.deb \
|
||||
"${WORKROOT}"/*.changes \
|
||||
"${WORKROOT}"/*.buildinfo \
|
||||
"${WORKROOT}"/*.dsc \
|
||||
"${WORKROOT}"/*.tar.* \
|
||||
"${OUT}/" || true
|
||||
|
||||
echo "Artifacts copied to ${OUT}"
|
||||
EOF
|
||||
RUN chmod +x /usr/local/bin/build-deb
|
||||
|
||||
WORKDIR /work
|
||||
ENTRYPOINT ["/usr/local/bin/build-deb"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue