From: Mathieu Baudier Date: Sun, 16 Feb 2025 13:01:35 +0000 (+0100) Subject: Make build-pbuilder more portable X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4c6410c7b88291ae442960e11c7fe5a69c8f89dc;p=pkg%2Fggml Make build-pbuilder more portable --- diff --git a/README.md b/README.md index d6adbd5..dcaac92 100644 --- a/README.md +++ b/README.md @@ -78,26 +78,33 @@ Push to remote repositories: "refs/tags/upstream/*" ### Using locally built packages -Except for `ggml` itself, pbuilder/cowbuilder needs to be configured appropriately +Except for the `ggml` layer itself, pbuilder/cowbuilder needs to be configured appropriately in order to use either a local repository with the `ggml` packages you just built, or a remote repository with the required `ggml`-related packages. -To configure a local repository, update `/etc/pbuilderrc`. For example: +Below is a basic approach to configure a local repository, as an illustration + to be adapted to your own build infrastructure and procedures. + +Update `/etc/pbuilderrc`. For example: ... BINDMOUNTS="/srv/repo/deb/bullseye/ml/1.1 /srv/repo/deb/bookworm/ml/1.1 /srv/repo/deb/sid/ml/1.1" ... -and create a `create-pbuilder.settings` file which will be sourced by the script: +and create a `create-pbuilder.settings` file which will be sourced by the `create-pbuilder` script: + + export GIT_PBUILDER_OPTIONS="--aptcache /var/cache/pbuilder/aptcache --othermirror 'deb [trusted=yes] file:/srv/repo/deb/$DIST/ml/1.1/ ./'" + +Apply the same procedure for the `build-pbuilder` script by editing build-pbuilder.settings: - export GIT_PBUILDER_OPTIONS="--aptcache /var/cache/pbuilder/aptcache --othermirror 'deb [trusted=yes] file:/srv/repo/deb/$1/ml/1.1/ ./'" + export GIT_PBUILDER_OPTIONS="--aptcache /var/cache/pbuilder/aptcache --buildresult /srv/repo/deb/$DIST/ml/1.1/" -The `Packages` file needs to be generated after each build. For example: +Please note that the `Packages` file needs to be generated after each build. For example: cd /srv/repo/deb/sid/ml/1.1 apt-ftparchive packages . > Packages -(Or [hooks](https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build) can be used.) +Or [pbuilder hooks](https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build) can be used. ## Development ## When developing the packaging, cd to a layer directory and [use git-buildpackage as usual](https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/). diff --git a/sources/build-pbuilder b/sources/build-pbuilder index 23c4e6c..74e89d4 100755 --- a/sources/build-pbuilder +++ b/sources/build-pbuilder @@ -14,11 +14,14 @@ else DEBIAN_BRANCH=$3 fi +if [ -f "$(dirname $0)/$(basename $0).settings" ]; then +. $(dirname $0)/$(basename $0).settings +fi + gbp buildpackage \ --git-submodules \ --git-ignore-branch \ --git-debian-branch="$DEBIAN_BRANCH" \ --git-pbuilder \ --git-arch="$ARCH" \ ---git-dist="$DIST" \ ---git-pbuilder-options="--aptcache /var/cache/pbuilder/aptcache --buildresult $HOME/qa/git/argeo-qa-unstable/build/repo/deb/$DIST/ml/1.1" +--git-dist="$DIST"