summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-02-06 21:38:11 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-02-06 21:38:11 +0600
commit69cea8f9106821e534776c87443f45defa9caa64 (patch)
tree577e281cca6c76a68de8e6ebdd92982acc658009
parentbaa72684e8d5e4f05e3d96518a865c030e4fe29b (diff)
downloadpatches-69cea8f9106821e534776c87443f45defa9caa64.tar.gz
patches-69cea8f9106821e534776c87443f45defa9caa64.zip
builder: Add build helper and docs
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
-rw-r--r--DOCS.md21
-rwxr-xr-xbuild-tools/build-root34
-rw-r--r--build-tools/config-home/builder/.gbp.conf3
-rw-r--r--build-tools/config-home/root/.pbuilderrc1
4 files changed, 59 insertions, 0 deletions
diff --git a/DOCS.md b/DOCS.md
new file mode 100644
index 0000000..64aaacf
--- /dev/null
+++ b/DOCS.md
@@ -0,0 +1,21 @@
+## build-tools/* files
+
+Contains helper scripts/tools and config for building/managing ShopnoOS Package
+repository.
+
+#### buildroot usage
+```sh
+# buildroot create [distribution] [architecture]
+# Create cowbuilder chroot for cross-building packages
+$ buildroot create bullseye arm64
+
+# buildroot build [distribution] [arch]
+# builds packages for [arch] architecture on [distribution] release
+# * must be executed inside a dpkg source tree (with debian/ tree)
+# ** buildroot for [distribution] and [arch] required to use this
+$ buildroot build bullseye armhf
+
+# buildroot update [distro] [arch]
+# Update buildroot for [distro]:[arch]
+$ buildroot update bullseye armel
+```
diff --git a/build-tools/build-root b/build-tools/build-root
new file mode 100755
index 0000000..35013a5
--- /dev/null
+++ b/build-tools/build-root
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+if [ "$#" -ne 3 ];then
+ cat >&2 <<EOF
+${0##*/} [operation] [distribution] [arch]
+
+operation: create | update | build
+EOF
+ exit
+fi
+if [ "$1" = "build" ]
+then
+set -x
+exec \
+gbp buildpackage \
+ --git-pbuilder \
+ --git-dist="$2" \
+ --git-arch="$3" \
+ --git-pbuilder-options="--mirror https://deb.debian.org/debian"
+fi
+
+sudo -i <<EOF
+set -e
+pbuilder "$1" \\
+ --distribution "$2" \\
+ --mirror https://deb.debian.org/debian \\
+ --architecture "$3" \\
+ --basetgz "/var/cache/pbuilder/base-$2-$3.tgz"
+cowbuilder "$1" \\
+ --distribution "$2" \\
+ --mirror https://deb.debian.org/debian \\
+ --architecture "$3" \\
+ --basepath "/var/cache/pbuilder/base-$2-$3.cow"
+EOF
diff --git a/build-tools/config-home/builder/.gbp.conf b/build-tools/config-home/builder/.gbp.conf
new file mode 100644
index 0000000..4f5179f
--- /dev/null
+++ b/build-tools/config-home/builder/.gbp.conf
@@ -0,0 +1,3 @@
+[buildpackage]
+export-dir = ~/pkgs/debyard
+tarball-dir = ~/pkgs/tarpit
diff --git a/build-tools/config-home/root/.pbuilderrc b/build-tools/config-home/root/.pbuilderrc
new file mode 100644
index 0000000..da5c606
--- /dev/null
+++ b/build-tools/config-home/root/.pbuilderrc
@@ -0,0 +1 @@
+PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"