Skip to content

Commit

Permalink
fix(build snap): switch to the python build plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nmw committed Mar 4, 2024
1 parent 397a7a1 commit 6b9d41e
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ package-repositories:

parts:
landscape-client:
plugin: dump
plugin: python
source: .
source-type: local # Don't use 'git' - it forces you to commit your changes
build-packages:
Expand All @@ -83,21 +83,7 @@ parts:
- locales-all
- python3-dbus
override-build: |
git commit -n -a -m "dev build for snap" --no-gpg-sign --allow-empty
cat << EOF > debian/changelog
landscape-client (0.0.1) UNRELEASED; urgency=medium
* Test build for snap
-- Guy Incognito <[email protected]> Fri, 1 Sep 2023 00:00:00 +0000
EOF
mkdir -p landscape-client-0.0.1
git ls-files --recurse-submodules | xargs -I {} cp -r --parents {} landscape-client-0.0.1/
rm -rf landscape-client-0.0.1/debian
tar -czf landscape-client-0.0.1.tar.gz landscape-client-0.0.1
cp -r debian landscape-client-0.0.1
cd landscape-client-0.0.1 && debuild -b --no-sign
cp ../landscape-*_0.0.1_*.deb $CRAFT_PART_INSTALL
make build
stage-packages:
- adduser
- bc
Expand All @@ -116,8 +102,16 @@ parts:
- python3-twisted
- python3-dbus
- ubuntu-advantage-tools
override-prime: |
override-stage: |
craftctl default
rm $CRAFT_PRIME/landscape-*_0.0.1_*.deb
dpkg-deb -x $CRAFT_STAGE/landscape-common_0.0.1_*.deb $CRAFT_PRIME
dpkg-deb -x $CRAFT_STAGE/landscape-client_0.0.1_*.deb $CRAFT_PRIME
# Copy the scripts over
mkdir -p "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-broker" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-client" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-config" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-manager" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-monitor" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-package-changer" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-package-reporter" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-release-upgrader" "${SNAPCRAFT_PRIME}/usr/bin/"
cp "${SNAPCRAFT_PART_SRC}/scripts/landscape-sysinfo" "${SNAPCRAFT_PRIME}/usr/bin/"

0 comments on commit 6b9d41e

Please sign in to comment.