Newer
Older
{{- $apt_debug := or .apt_debug "" -}}
{{- $architecture := or .architecture "amd64" -}}
{{- $suite := or .suite "stretch" -}}
{{- $flatpak_arch := or .flatpak_arch $architecture -}}
{{- $packages := or .packages "" -}}
{{- $post_script := or .post_script "" -}}
{{- $sdk := or .sdk "" -}}
{{- $sdk_packages := or .sdk_packages "" -}}
{{- $sdk_post_script := or .sdk_post_script "" -}}
{{- $platform_post_script := or .platform_post_script "" -}}
{{- $strip_source_version_suffix := or .strip_source_version_suffix "" -}}
{{- $build_id := or .build_id "" -}}
{{- $variant := or .variant "" -}}
{{- $variant_id := or .variant_id "" -}}
{{- $ospack := or .ospack (printf "base-%s-%s.tar.gz" $suite $architecture) -}}
{{- $runtime := .runtime -}}
{{- $runtime_branch := or .runtime_branch "master" -}}
{{- $artifact_prefix := or .artifact_prefix (printf "%s-%s-%s" $runtime $flatpak_arch $runtime_branch) -}}
{{- $sysroot_prefix := or .sysroot_prefix (printf "%s-sysroot" $artifact_prefix) -}}
{{- $sysroot_tarball := or .sysroot_tarball "" -}}
{{- $ostree_prefix := or .ostree_prefix (printf "%s-runtime" $artifact_prefix) -}}
{{- $ostree_tarball := or .ostree_tarball (printf "%s.tar.gz" $ostree_prefix) -}}
{{- $sources_prefix := or .sources_prefix (printf "%s-sources" $artifact_prefix) -}}
{{- $sources_tarball := or .sources_tarball (printf "%s.tar.gz" $sources_prefix) -}}
{{- $debug_prefix := or .debug_prefix (printf "%s-debug" $artifact_prefix) -}}
{{- $debug_tarball := or .debug_tarball (printf "%s.tar.gz" $debug_prefix) -}}
architecture: {{ $architecture }}
actions:
- action: unpack
compression: gz
file: {{ $ospack }}
# TODO: This duplicates what we should have done in debos-base.yaml
- action: run
command: 'echo; "$RECIPEDIR/disable-services" "$ROOTDIR"'
# TODO: This duplicates what we should have done in debos-base.yaml
- action: run
command: 'echo; "$RECIPEDIR/clean-up-base" "$ROOTDIR"'
command: 'echo; "$RECIPEDIR/prepare-runtime" "$ROOTDIR"'
command: echo; $RECIPEDIR/apt-install {{ if $apt_debug }}--debug{{ end }} "$ROOTDIR" "$RECIPEDIR/runtimes/{{ $runtime }}/packages.yaml"
# TODO: Everything before this step is common to the Platform and SDK
# We do this as a separate step in case it involves removing any
# of the common packages
{{ if and $sdk $sdk_packages }}
command: echo; $RECIPEDIR/apt-install {{ if $apt_debug }}--debug{{ end }} "$ROOTDIR" "$RECIPEDIR/runtimes/{{ $runtime }}/sdk_packages.yaml"
command: 'echo; "$RECIPEDIR/platformize" "$ROOTDIR"'
command: 'echo; "$RECIPEDIR/purge-conffiles" "$ROOTDIR"'
chroot: true
script: '{{ $post_script }}'
{{ end }}
{{ if $sdk }}
{{ if $sdk_post_script }}
- action: run
chroot: true
script: '{{ $sdk_post_script }}'
{{ end }}
{{ else }}
{{ if $platform_post_script }}
- action: run
chroot: true
script: '{{ $platform_post_script }}'
{{ end }}
{{ end }}
command: 'echo; "$RECIPEDIR/purge-conffiles" "$ROOTDIR"'
"$RECIPEDIR/write-manifest" "$ROOTDIR"
cp "$ROOTDIR/usr/manifest.dpkg" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.dpkg"
cp "$ROOTDIR/usr/manifest.dpkg.built-using" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.dpkg.built-using"
cp "$ROOTDIR/usr/manifest.deb822.gz" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.deb822.gz"
if test -e "$ROOTDIR/usr/lib/os-release"; then
sed -i -e '/^BUILD_ID=/d' -e '/^VARIANT=/d' -e '/^VARIANT_ID=/d' "$ROOTDIR/usr/lib/os-release"
if test -n "{{ $build_id }}"; then
echo 'BUILD_ID="{{ $build_id }}"' >> "$ROOTDIR/usr/lib/os-release"
fi
if test -n "{{ $variant }}"; then
echo 'VARIANT="{{ $variant }}"' >> "$ROOTDIR/usr/lib/os-release"
fi
if test -n "{{ $variant_id }}"; then
echo 'VARIANT_ID="{{ $variant_id }}"' >> "$ROOTDIR/usr/lib/os-release"
fi
cp "$ROOTDIR/usr/lib/os-release" "$ARTIFACTDIR/{{ $artifact_prefix }}.os-release.txt"
fi
command: 'echo; cp "$RECIPEDIR/manifest.dpkg.platform" "$ROOTDIR/usr"'
command: 'echo; cp "$RECIPEDIR/manifest.dpkg.built-using.platform" "$ROOTDIR/usr"'
command: 'echo; cp "$RECIPEDIR/manifest.platform.deb822.gz" "$ROOTDIR/usr"'
command: 'echo; "$RECIPEDIR/collect-source-code" --strip-source-version-suffix="{{ $strip_source_version_suffix }}" "$ROOTDIR"'
command: 'echo; cp "$ROOTDIR/usr/manifest.dpkg" "$RECIPEDIR/manifest.dpkg.platform"'
command: 'echo; cp "$ROOTDIR/usr/manifest.dpkg.built-using" "$RECIPEDIR/manifest.dpkg.built-using.platform"'
command: 'echo; mv "$ROOTDIR/usr/manifest.deb822.gz" "$RECIPEDIR/manifest.platform.deb822.gz"'
command: 'echo; dpkg --purge --force-remove-essential --force-depends dpkg'
command: 'echo; "$RECIPEDIR/usrmerge" "$ROOTDIR"'
# This adds the Flatpak metadata and the final apt configuration
- action: overlay
source: runtimes/{{ $runtime }}/overlay
- action: run
label: save final sources.list
chroot: false
command: |
echo
cp "$ROOTDIR/etc/apt/sources.list" "$ARTIFACTDIR/{{ $artifact_prefix }}.sources.list"
- action: run
label: try-apt-get-update
chroot: true
command: |
apt-get update || true
chroot: true
script: put-ldconfig-in-path
- action: run
label: clean-up-before-pack
chroot: false
command: 'echo; "$RECIPEDIR/clean-up-before-pack" "$ROOTDIR"'
{{ if $sysroot_tarball }}
- action: run
label: check uid/gid mapping
chroot: true
command: |
set -e
cd "$ROOTDIR"
if test -n "$(find . -xdev -path ./script -prune -o '(' -uid +99 -o -gid +99 ')' -print)"; then
echo "Warning: these files have a dynamically-allocated UID/GID"
echo " which could cause problems for schroot:"
find . -xdev -path ./script -prune -o '(' -uid +99 -o -gid +99 ')' -ls
fi
- action: run
label: pack sysroot tarball
chroot: false
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $sysroot_tarball }}"
--numeric-owner
--sort=name
-C "$ROOTDIR"
--exclude="./script"
--exclude="./src"
--exclude="./usr/lib/debug"
--transform="s,^./,,"
.
{{ end }}
- action: run
label: symlink-alternatives
chroot: true
script: symlink-alternatives
command: 'echo; "$RECIPEDIR/make-flatpak-friendly" --sdk "$ROOTDIR"'
command: 'echo; "$RECIPEDIR/make-flatpak-friendly" "$ROOTDIR"'
# TODO: Move zoneinfo, locales into extensions
# TODO: Hook point for GL, instead of just Mesa
# TODO: GStreamer extension
# TODO: Icon theme, Gtk theme extension
# TODO: VAAPI extension
# TODO: SDK extension
# TODO: ca-certificates extension to get newer certs?
- action: run
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $ostree_tarball }}"
--numeric-owner
--sort=name
-C "$ROOTDIR"
files metadata
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $sources_tarball }}"
--numeric-owner
--sort=name
--transform="s,^./,,"
-C "$ROOTDIR/src"
.
- action: run
label: pack debug symbols
chroot: false
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $debug_tarball }}"
--numeric-owner
--sort=name
--transform="s,^./,,"
-C "$ROOTDIR/debug"
.
- action: run
label: list of included source code
chroot: false
command: >
cp -v "$ROOTDIR/src/sources.txt"
"$ARTIFACTDIR/{{ $sources_prefix }}.sources.txt"
- action: run
label: list of missing source code
chroot: false
command: >
test ! -e "$ROOTDIR/src/MISSING.txt" ||
cp -v "$ROOTDIR/src/MISSING.txt"
"$ARTIFACTDIR/{{ $sources_prefix }}.MISSING.txt"
- action: run
label: manifests
chroot: false
command: >
cd "$ROOTDIR";
head -n10000
files/manifest.dpkg
files/manifest.dpkg.built-using
files/src/sources.txt
|| true
- action: run
label: metadata
chroot: false
command: >
cd "$ROOTDIR";
head -n10000
files/etc/apt/apt.conf
files/etc/apt/apt.conf.d/*
files/etc/apt/sources.list
files/etc/apt/sources.list.d/*
files/src/MISSING.txt
files/lib/os-release
metadata
|| true