diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2024-04-03 00:34:38 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2024-04-04 16:41:20 -0400 |
commit | b8637c0c87abb4bc130370d83faaf3f54a67d960 (patch) | |
tree | f83cb298f6d080957d04a6930cbe78716edb2a3e | |
parent | e99793b6f7dd47dba982b388607c06246d463f11 (diff) |
scratch-pkg: intial PKGBUILD
-rw-r--r-- | pcr-testing/scratch-pkg/PKGBUILD | 86 | ||||
-rw-r--r-- | pcr-testing/scratch-pkg/a.patch | 5 | ||||
-rw-r--r-- | pcr-testing/scratch-pkg/scratch-pkg.install | 11 |
3 files changed, 102 insertions, 0 deletions
diff --git a/pcr-testing/scratch-pkg/PKGBUILD b/pcr-testing/scratch-pkg/PKGBUILD new file mode 100644 index 000000000..06b93deab --- /dev/null +++ b/pcr-testing/scratch-pkg/PKGBUILD @@ -0,0 +1,86 @@ +# Maintainer: Your Name <your-email@example.net> + + +# NOTE: This PKGBUILD is for experiments and for testing libretools. +# Packages built with this PKGBUILD are not intended for distribution. +# Only the -nonfree source-ball is published, containing a single file: +# $pkgname-$pkgver/dummy + + +pkgbase=scratch-pkg +pkgname=(scratch-pkg{,-split1,-split2}) +pkgver=42 +pkgrel=420.3 + +pkgdesc="PKGBUILD for testing libretools" +arch=(any) +url= +license=(GPL) + +depends=() +makedepends=() + +_REPO_URL=https://repo.parabola.nu/other +source=(${_REPO_URL}/${pkgname}-libre/${pkgname}-${pkgver}-nonfree.tar.gz{,.sig} + a.patch) + +sha256sums=(a1ccabdfb9e43e4ddd00e5a4f801ed1c7ba89a4d0cb3a3f1dbf2d1895f585476 + SKIP + 787331f939f817e3b9cc7e0ee97cb8833de619863c4057b0bbd58d54d882569a) +validpgpkeys=() + +# parabola mksource over-rides +_N_MKSOURCES=2 +mksource=( ${source[*]:0:${_N_MKSOURCES}} ) +mksha256sums=( ${sha256sums[*]:0:${_N_MKSOURCES}} ) +mkvalidpgpkeys=( ${validpgpkeys[*]} ) +source=(${_REPO_URL}/${pkgname}-libre/${pkgname}-${pkgver}-parabola.tar.gz{,.sig} + ${source[*]:${_N_MKSOURCES}}) +sha256sums=(SKIP # the libre source-ball does not exist, intentionally + SKIP + ${sha256sums[*]:${_N_MKSOURCES}}) +validpgpkeys=( 'YOUR GPG KEY' ) + + +mksource() +{ + cd $pkgname-$pkgver + + rm dummy ; echo dummy-libre > dummy-libre ; +} + +prepare() +{ + cd $pkgname-$pkgver + + # network check + local net_check_url=https://repo.parabola.nu/check_network_status.txt + local online_msg="this PKGBUILD has internet access in the build chroot" + local offline_msg="this PKGBUILD does not have internet access in the build chroot" + curl ${net_check_url} &> /dev/null && echo "${online_msg}" || echo "${offline_msg}" + + patch < "$srcdir"/a.patch ; grep -q '^dummy-libre patched$' dummy-libre ; +} + +build() +{ + cd $pkgname-$pkgver +} + +check() +{ + cd $pkgname-$pkgver + + [[ ! -e dummy ]] && grep -q '^dummy-libre patched$' dummy-libre +} + +package_scratch-pkg() +{ + cd $pkgname-$pkgver + + install=${pkgname}.install + + cp dummy-libre "$pkgdir"/ +} +package_scratch-pkg-split1() { echo "package_scratch-pkg-split1()" ; } +package_scratch-pkg-split2() { echo "package_scratch-pkg-split2()" ; } diff --git a/pcr-testing/scratch-pkg/a.patch b/pcr-testing/scratch-pkg/a.patch new file mode 100644 index 000000000..101c4cb65 --- /dev/null +++ b/pcr-testing/scratch-pkg/a.patch @@ -0,0 +1,5 @@ +--- dummy-libre 2024-04-03 00:51:42.856666645 -0400 ++++ dummy-libre 2024-04-03 00:53:08.229999979 -0400 +@@ -0,1 +1 @@ +-dummy-libre ++dummy-libre patched diff --git a/pcr-testing/scratch-pkg/scratch-pkg.install b/pcr-testing/scratch-pkg/scratch-pkg.install new file mode 100644 index 000000000..0cb7a812f --- /dev/null +++ b/pcr-testing/scratch-pkg/scratch-pkg.install @@ -0,0 +1,11 @@ +avar=AVAR +post_install() { + echo "post_install() pkgver+rel=$1" + echo "post_install() CARCH=$CARCH" + echo "post_install() avar=$avar" + ls usr/lib/modules/*-gnu-[0-9]-vanilla/vmlinuz +} + +post_remove() { + echo "post_remove()=$@" +} |