forked from tsaarni/docker-deb-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-helper.sh
executable file
·28 lines (22 loc) · 1 KB
/
build-helper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash -e
# This script is executed within the container as root. It assumes
# that source code with debian packaging files can be found at
# /source-ro and that resulting packages are written to /output after
# succesful build. These directories are mounted as docker volumes to
# allow files to be exchanged between the host and the container.
# Install extra dependencies that were provided for the build (if any)
# Note: dpkg can fail due to dependencies, ignore errors, and use
# apt-get to install those afterwards
[[ -d /dependencies ]] && dpkg -i /dependencies/*.deb || apt-get -f install -y --no-install-recommends
# Make read-write copy of source code
mkdir -p /build
cp -a /source-ro /build/source
cd /build/source
# Install build dependencies
mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends"
# Build packages
debuild -b -uc -us
# Copy packages to output dir with user's permissions
chown -R $USER:$GROUP /build
cp -a /build/*.deb /output/
ls -l /output