00f2bb6452
After removing the following files, $pkgdir/usr/share/deviceinfo is empty: - $pkgdir/usr/share/deviceinfo/$pkgname - $pkgdir/usr/share/deviceinfo/deviceinfo Remove it when it's empty. [ci:skip-build]: already built successfully in CI
88 lines
4 KiB
Text
88 lines
4 KiB
Text
pkgname=devicepkg-dev
|
|
pkgver=0.18.1
|
|
pkgrel=0
|
|
pkgdesc="Provides default device package functions"
|
|
url="https://postmarketos.org"
|
|
arch="noarch"
|
|
license="MIT"
|
|
source="
|
|
compiler-gcc.h
|
|
devicepkg_build.sh
|
|
devicepkg_package.sh
|
|
devicepkg_pmtest_post_install.sh
|
|
downstreamkernel_prepare.sh
|
|
downstreamkernel_package.sh
|
|
devicepkg_subpackage_kernel.sh
|
|
testdata/deviceinfo
|
|
testdata/expected-deviceinfo-downstream
|
|
testdata/expected-deviceinfo-mainline
|
|
"
|
|
|
|
check() {
|
|
# Prepare a temporary dir to run the tests
|
|
testdir=$(mktemp -d)
|
|
install -Dm644 "$srcdir/deviceinfo" \
|
|
"$testdir/src/deviceinfo"
|
|
|
|
# Execute the script to create the subpackage deviceinfo
|
|
sh devicepkg_subpackage_kernel.sh \
|
|
$testdir device-test device-test-kernel-downstream
|
|
sh devicepkg_subpackage_kernel.sh \
|
|
$testdir device-test device-test-kernel-mainline
|
|
|
|
# Compare the result with the expected files
|
|
if ! cmp -s "$srcdir/expected-deviceinfo-downstream" \
|
|
"$testdir/pkg/device-test-kernel-downstream/usr/share/deviceinfo/device-test-kernel-downstream"
|
|
then
|
|
echo "ERROR: unexpected result with downstream deviceinfo"
|
|
exit 1
|
|
fi
|
|
if ! cmp -s "$srcdir/expected-deviceinfo-mainline" \
|
|
"$testdir/pkg/device-test-kernel-mainline/usr/share/deviceinfo/device-test-kernel-mainline"
|
|
then
|
|
echo "ERROR: unexpected result with mainline deviceinfo"
|
|
exit 1
|
|
fi
|
|
# Check that the link is a link, and that it points to the right place
|
|
if [ "$(readlink $testdir/pkg/device-test-kernel-mainline/usr/share/deviceinfo/deviceinfo)" != "device-test-kernel-mainline" ];
|
|
then
|
|
echo "ERROR: mainline deviceinfo link not pointing to correct location"
|
|
fi
|
|
if ! cmp -s "$testdir/pkg/device-test-kernel-mainline/usr/share/deviceinfo/deviceinfo" \
|
|
"$srcdir/expected-deviceinfo-mainline";
|
|
then
|
|
echo "ERROR: mainline deviceinfo contains incorrect data"
|
|
fi
|
|
|
|
# Cleanup
|
|
rm -r "$testdir"
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 "$srcdir/devicepkg_build.sh" \
|
|
"$pkgdir/usr/bin/devicepkg_build"
|
|
install -Dm755 "$srcdir/devicepkg_package.sh" \
|
|
"$pkgdir/usr/bin/devicepkg_package"
|
|
install -Dm755 "$srcdir/devicepkg_pmtest_post_install.sh" \
|
|
"$pkgdir"/usr/bin/devicepkg_pmtest_post_install
|
|
install -Dm755 "$srcdir/downstreamkernel_prepare.sh" \
|
|
"$pkgdir/usr/bin/downstreamkernel_prepare"
|
|
install -Dm755 "$srcdir/downstreamkernel_package.sh" \
|
|
"$pkgdir/usr/bin/downstreamkernel_package"
|
|
install -Dm755 "$srcdir/devicepkg_subpackage_kernel.sh" \
|
|
"$pkgdir/usr/bin/devicepkg_subpackage_kernel"
|
|
install -Dm644 "$srcdir/compiler-gcc.h" \
|
|
"$pkgdir/usr/share/devicepkg-dev/compiler-gcc.h"
|
|
}
|
|
sha512sums="
|
|
d69930dd790b00fb39760a37d95a10899f0d167e10e2804feb05d9ce04f94185dc32d36edc90214aba2ea2aa09bf18f7dab93f1d2eff23f67beb2cc83be30e7c compiler-gcc.h
|
|
a483a970f6cf3e1f2724d8ec1039c2a935cc3e75efd016b3f134cef8a6e53820428bff0f1cb2bcfbd8ccda33c69fdb250be1cf061b2dc53c6063d2ab49023f97 devicepkg_build.sh
|
|
5b83255dabd2019ea07a589d185bee5dad6760e28ab02de3480a0adfd1cf20d0c2e0b4a978e56757899ef683819091cee99d168a48e24a3f604b725e1ba26849 devicepkg_package.sh
|
|
3b997a00e76be7d4540290275585026c5b83832c0b9a7214346763f03ec196b3f1bea9f50a9928a5cab0bc22dc557af136ffe146bd45d3666b5c05589891047d devicepkg_pmtest_post_install.sh
|
|
f81e74e45ae8e55686ae459f550e229e7398daeafa72bd023c2d8c3a0d50e60bf53d5bbdfec931e9fbabe1cd71de57b2192805aaef091ab90bc7203cbaf66ba6 downstreamkernel_prepare.sh
|
|
107242a3da38a574c46cb779e0c75afbeef4cfe659e1b85971973ac55843df06f70f53a5985ca623d4123f05f2984f5dace4a53a3509ecefd7dfdc3c8b705cfe downstreamkernel_package.sh
|
|
b9e64582d8c4ed35116002388b58ee62531b8db5de3f4629980ca5dcc9f39ba2c1c7c7a9caa03438e183afa42c8cc6680fe217304ef667b8bf213d93789226e9 devicepkg_subpackage_kernel.sh
|
|
9bb7f2a0930f397a713e9f4b6d5b83a426d9a2a3f692dcc42ac30717bf26ead869d8823a38f3ad388af12b2b9a02e8ec4d4418e9c2062389ed06d2b891a49ff3 deviceinfo
|
|
136247a16ec91dc0c7241eeddb28c2196ae3b29946a9bc7e9566f848491ef1c53b12d05bf2dbc1cc352986712fd76f25c1510bcc8f301af540a2f01c33b299e1 expected-deviceinfo-downstream
|
|
8cdbf149e1bdfaf4d4a246a208732836956fd81a3aa01ef968e4c2e2cca4027f71cfc38e22debade83ddfca4e05267983c1c8a9c1aa9461a8cf493ef7e893097 expected-deviceinfo-mainline
|
|
"
|