forked from canonical/core-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use stage area to provide packages across snapcraft parts instead of using `$(CRAFT_PART_INSTALL)/../..` * Make a local debian package repository * Send all built binary packages to `extra-packages` hook. This is to avoid version mismatch in case some dependency start requiring other built packages * Install all extra packages at once
- Loading branch information
1 parent
bdefd0c
commit 088d1b8
Showing
4 changed files
with
122 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
case "$1" in | ||
pull) | ||
craftctl default | ||
export DEBIAN_FRONTEND=noninteractive | ||
export DEBCONF_NONINTERACTIVE_SEEN=true | ||
apt-get build-dep -y ./ | ||
;; | ||
build) | ||
# unset the LD_FLAGS and LD_LIBRARY_PATH vars that snapcraft sets for us | ||
# as those will point to the $CRAFT_STAGE which on re-builds will | ||
# contain things like libc and friends that confuse the debian package | ||
# build system | ||
# TODO: should we unset $PATH to not include $CRAFT_STAGE too? | ||
unset LD_FLAGS | ||
unset LD_LIBRARY_PATH | ||
# run the real build (but just build the binary package, and don't | ||
# bother compressing it too much) | ||
dpkg-buildpackage -b -uc -us -Zgzip -zfast | ||
mkdir -p "${CRAFT_PART_INSTALL}/local-debs" | ||
source="$(dpkg-parsechangelog -SSource)" | ||
version="$(dpkg-parsechangelog -SVersion)" | ||
arch="$(dpkg --print-architecture)" | ||
dcmd mv "../${source}_${version}_${arch}.changes" "${CRAFT_PART_INSTALL}/local-debs" | ||
;; | ||
stage) | ||
craftctl default | ||
cd "${CRAFT_STAGE}/local-debs" | ||
dpkg-scanpackages . >Packages | ||
apt-ftparchive release . >Release | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters