subiquity/snapcraft.yaml

235 lines
6.0 KiB
YAML

name: subiquity
base: core20
version: git
summary: Ubuntu installer
description: The Ubuntu server installer
confinement: classic
source-code: https://github.com/canonical/subiquity
issues: https://bugs.launchpad.net/subiquity/+filebug
contact: https://bugs.launchpad.net/subiquity/+filebug
apps:
subiquity:
command: usr/bin/subiquity-cmd
environment:
# Save original values of environment variables, we want to restore them
# for the debug shell (LP: #1975629) and restart (LP: #1978139)
PYTHONPATH_ORIG: $PYTHONPATH
PATH_ORIG: $PATH
PYTHONIOENCODING_ORIG: $PYTHONIOENCODING
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT_ORIG: $SUBIQUITY_ROOT
SUBIQUITY_ROOT: $SNAP
PYTHON_ORIG: $PYTHON
PYTHON: $SNAP/usr/bin/python3.8
probert:
command: bin/probert
subiquity-server:
command: usr/bin/subiquity-server
daemon: simple
restart-condition: always
environment:
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT: $SNAP
PYTHON: $SNAP/usr/bin/python3.8
PY3OR2_PYTHON: $SNAP/usr/bin/python3.8
PATH: $PATH:$SNAP/bin:$SNAP/sbin
subiquity-service:
command: usr/bin/subiquity-service
daemon: simple
restart-condition: always
environment:
# Save original values of environment variables, we want to restore them
# for the debug shell (LP: #1975629).
PYTHONPATH_ORIG: $PYTHONPATH
PATH_ORIG: $PATH
PYTHONIOENCODING_ORIG: $PYTHONIOENCODING
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT_ORIG: $SUBIQUITY_ROOT
SUBIQUITY_ROOT: $SNAP
PYTHON_ORIG: $PYTHON
PYTHON: $SNAP/usr/bin/python3.8
os-prober:
command: usr/bin/os-prober
environment:
OS_PROBER_SHARE: $SNAP/usr/share
OS_PROBER_LIB: $SNAP/usr/lib
parts:
curtin:
plugin: nil
source: https://git.launchpad.net/curtin
source-type: git
source-commit: b08eecd68cf5f1bccf4255b3d00a77af51c159f7
override-pull: |
snapcraftctl pull
PACKAGED_VERSION="$(git describe --long --abbrev=9 --match=[0-9][0-9]*)"
sed -e "s,@@PACKAGED_VERSION@@,$PACKAGED_VERSION,g" -i curtin/version.py
override-build: &pyinstall |
# We install without dependencies because all dependencies come from
# archive packages.
pip3 install --prefix=$SNAPCRAFT_PART_INSTALL --no-dependencies .
build-packages:
- python3-pip
organize:
lib/python*/site-packages/usr/lib/curtin: usr/lib/
subiquity:
plugin: nil
source: .
source-type: git
override-build: *pyinstall
build-packages:
- gettext
- lsb-release
- python3-pip
stage-packages:
# This list includes the dependencies for curtin and probert as well,
# there doesn't seem to be any real benefit to listing them separately.
- cloud-init
- iso-codes
- libpython3-stdlib
- libpython3.8-minimal
- libpython3.8-stdlib
- libsystemd0
- lsb-release
- ntfs-3g
- python3-aiohttp
- python3-apport
- python3-attr
- python3-bson
- python3-jsonschema
- python3-minimal
- python3-oauthlib
- python3-pyrsistent
- python3-pyudev
- python3-requests
- python3-requests-unixsocket
- python3-systemd
- python3-urwid
- python3-yaml
- python3-yarl
- python3.8-minimal
- ssh-import-id
- ubuntu-advantage-tools
stage:
- "*"
- "-usr/lib/python2.7/"
override-prime: |
snapcraftctl prime
"./usr/bin/python3" -m compileall -q .
organize:
bin/subiquity-tui: usr/bin/subiquity
bin/subiquity-service: usr/bin/subiquity-service
bin/subiquity-server: usr/bin/subiquity-server
bin/subiquity-cmd: usr/bin/subiquity-cmd
$SNAPCRAFT_PART_BUILD/system_setup/ubuntu-wsl-setup: bin/ubuntu-wsl-setup
users-and-groups:
plugin: nil
build-packages:
- user-setup
override-build: |
echo "get passwd/user-default-groups" | \
debconf-communicate user-setup | \
cut -d ' ' -f 2- > $SNAPCRAFT_PART_INSTALL/users-and-groups
stage:
- users-and-groups
user-setup:
plugin: nil
source: https://git.launchpad.net/ubuntu/+source/user-setup
source-type: git
override-build: cp -a reserved-usernames $SNAPCRAFT_PART_INSTALL/
stage:
- reserved-usernames
keyboard-data:
plugin: nil
build-packages:
- console-setup
- locales
- python3-attr
- python3-yaml
override-build: |
PYTHONPATH=$SNAPCRAFT_PROJECT_DIR/ $SNAPCRAFT_PROJECT_DIR/scripts/make-kbd-info.py
cp $SNAPCRAFT_PROJECT_DIR/kbds/keyboard-configuration.yaml \
$SNAPCRAFT_PART_INSTALL/kbds/keyboard-configuration.yaml
stage:
- kbds/
font:
plugin: dump
source: .
source-type: git
organize:
font/subiquity.psf: subiquity.psf
stage:
- subiquity.psf
languagelists:
plugin: nil
build-packages:
- localechooser-data
override-build: |
grep '^path-exclude=.*LC_MESSAGES.*' /etc/dpkg/dpkg.cfg.d/excludes && {
sed -i 's/^path-exclude.*LC_MESSAGES.*/#\0/g' /etc/dpkg/dpkg.cfg.d/excludes
apt-get -y install --reinstall iso-codes
} || true
$SNAPCRAFT_PROJECT_DIR/scripts/make-language-lists $SNAPCRAFT_PROJECT_DIR/po > $SNAPCRAFT_PART_INSTALL/languagelist
stage:
- languagelist
probert:
plugin: nil
source: https://github.com/canonical/probert.git
source-type: git
source-commit: 31778895be3002422e9e8758d42940f290dc70af
override-build: *pyinstall
build-packages:
- build-essential
- libnl-3-dev
- libnl-genl-3-dev
- libnl-route-3-dev
- pkg-config
- python3-dev
- python3-pip
os-prober:
plugin: nil
source-type: git
source: https://github.com/dbungert/os-prober
source-commit: 80d6a3157a814278af4f96da91f9ab7218e20fdc
build-packages:
- build-essential
- debhelper
- fakeroot
override-build: |
./debian/rules build
fakeroot ./debian/rules install
cp -a debian/os-prober/{usr,var} $SNAPCRAFT_PART_INSTALL