2020-04-25 09:51:42 +00:00
|
|
|
pkgname=devicepkg-dev
|
2024-04-02 00:11:23 +00:00
|
|
|
pkgver=0.18.1
|
2024-06-18 19:53:59 +00:00
|
|
|
pkgrel=1
|
2017-12-14 21:17:18 +00:00
|
|
|
pkgdesc="Provides default device package functions"
|
2018-06-30 07:00:48 +00:00
|
|
|
url="https://postmarketos.org"
|
2023-06-01 09:55:19 +00:00
|
|
|
arch="noarch"
|
2017-12-14 21:17:18 +00:00
|
|
|
license="MIT"
|
|
|
|
source="
|
2018-10-05 06:02:52 +00:00
|
|
|
compiler-gcc.h
|
2017-12-14 21:17:18 +00:00
|
|
|
devicepkg_build.sh
|
|
|
|
devicepkg_package.sh
|
2023-10-20 01:16:43 +00:00
|
|
|
devicepkg_pmtest_post_install.sh
|
2018-07-02 00:12:49 +00:00
|
|
|
downstreamkernel_prepare.sh
|
2019-10-28 17:28:15 +00:00
|
|
|
downstreamkernel_package.sh
|
2018-10-15 19:54:15 +00:00
|
|
|
devicepkg_subpackage_kernel.sh
|
|
|
|
testdata/deviceinfo
|
|
|
|
testdata/expected-deviceinfo-downstream
|
|
|
|
testdata/expected-deviceinfo-mainline
|
2017-12-14 21:17:18 +00:00
|
|
|
"
|
|
|
|
|
2018-10-15 19:54:15 +00:00
|
|
|
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 \
|
2023-06-07 17:10:24 +00:00
|
|
|
$testdir device-test device-test-kernel-downstream
|
2018-10-15 19:54:15 +00:00
|
|
|
sh devicepkg_subpackage_kernel.sh \
|
2023-06-07 17:10:24 +00:00
|
|
|
$testdir device-test device-test-kernel-mainline
|
2018-10-15 19:54:15 +00:00
|
|
|
|
|
|
|
# Compare the result with the expected files
|
|
|
|
if ! cmp -s "$srcdir/expected-deviceinfo-downstream" \
|
2023-06-07 17:10:24 +00:00
|
|
|
"$testdir/pkg/device-test-kernel-downstream/usr/share/deviceinfo/device-test-kernel-downstream"
|
|
|
|
then
|
2018-10-15 19:54:15 +00:00
|
|
|
echo "ERROR: unexpected result with downstream deviceinfo"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if ! cmp -s "$srcdir/expected-deviceinfo-mainline" \
|
2023-06-07 17:10:24 +00:00
|
|
|
"$testdir/pkg/device-test-kernel-mainline/usr/share/deviceinfo/device-test-kernel-mainline"
|
|
|
|
then
|
2018-10-15 19:54:15 +00:00
|
|
|
echo "ERROR: unexpected result with mainline deviceinfo"
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-06-07 17:10:24 +00:00
|
|
|
# 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
|
2018-10-15 19:54:15 +00:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -r "$testdir"
|
|
|
|
}
|
|
|
|
|
2017-12-14 21:17:18 +00:00
|
|
|
package() {
|
|
|
|
install -Dm755 "$srcdir/devicepkg_build.sh" \
|
|
|
|
"$pkgdir/usr/bin/devicepkg_build"
|
|
|
|
install -Dm755 "$srcdir/devicepkg_package.sh" \
|
|
|
|
"$pkgdir/usr/bin/devicepkg_package"
|
2023-10-20 01:16:43 +00:00
|
|
|
install -Dm755 "$srcdir/devicepkg_pmtest_post_install.sh" \
|
|
|
|
"$pkgdir"/usr/bin/devicepkg_pmtest_post_install
|
2018-07-02 00:12:49 +00:00
|
|
|
install -Dm755 "$srcdir/downstreamkernel_prepare.sh" \
|
|
|
|
"$pkgdir/usr/bin/downstreamkernel_prepare"
|
2019-10-28 17:28:15 +00:00
|
|
|
install -Dm755 "$srcdir/downstreamkernel_package.sh" \
|
|
|
|
"$pkgdir/usr/bin/downstreamkernel_package"
|
2018-10-15 19:54:15 +00:00
|
|
|
install -Dm755 "$srcdir/devicepkg_subpackage_kernel.sh" \
|
|
|
|
"$pkgdir/usr/bin/devicepkg_subpackage_kernel"
|
2018-10-05 06:02:52 +00:00
|
|
|
install -Dm644 "$srcdir/compiler-gcc.h" \
|
|
|
|
"$pkgdir/usr/share/devicepkg-dev/compiler-gcc.h"
|
2017-12-14 21:17:18 +00:00
|
|
|
}
|
2021-08-17 23:25:46 +00:00
|
|
|
sha512sums="
|
|
|
|
d69930dd790b00fb39760a37d95a10899f0d167e10e2804feb05d9ce04f94185dc32d36edc90214aba2ea2aa09bf18f7dab93f1d2eff23f67beb2cc83be30e7c compiler-gcc.h
|
2024-03-21 13:08:24 +00:00
|
|
|
a483a970f6cf3e1f2724d8ec1039c2a935cc3e75efd016b3f134cef8a6e53820428bff0f1cb2bcfbd8ccda33c69fdb250be1cf061b2dc53c6063d2ab49023f97 devicepkg_build.sh
|
2023-06-07 17:10:24 +00:00
|
|
|
5b83255dabd2019ea07a589d185bee5dad6760e28ab02de3480a0adfd1cf20d0c2e0b4a978e56757899ef683819091cee99d168a48e24a3f604b725e1ba26849 devicepkg_package.sh
|
2024-06-18 19:53:59 +00:00
|
|
|
93432976bb785c3ad23ba40ac80c11cb2fb0d83d73642ed39fa3f637a471d5d08641ccc42912d63139af49c521bb86bd02a613482bf8f5e95437aa000a125969 devicepkg_pmtest_post_install.sh
|
2022-10-14 11:46:40 +00:00
|
|
|
f81e74e45ae8e55686ae459f550e229e7398daeafa72bd023c2d8c3a0d50e60bf53d5bbdfec931e9fbabe1cd71de57b2192805aaef091ab90bc7203cbaf66ba6 downstreamkernel_prepare.sh
|
2021-08-17 23:25:46 +00:00
|
|
|
107242a3da38a574c46cb779e0c75afbeef4cfe659e1b85971973ac55843df06f70f53a5985ca623d4123f05f2984f5dace4a53a3509ecefd7dfdc3c8b705cfe downstreamkernel_package.sh
|
2024-04-02 00:11:23 +00:00
|
|
|
b9e64582d8c4ed35116002388b58ee62531b8db5de3f4629980ca5dcc9f39ba2c1c7c7a9caa03438e183afa42c8cc6680fe217304ef667b8bf213d93789226e9 devicepkg_subpackage_kernel.sh
|
2024-06-18 19:53:59 +00:00
|
|
|
f09cb34626f2aedf9ffa69a8050500d54291c416f5e8c8d67ce72244e1d906b190d84a3fadccd7d82824b6a68d981ca8a197a053804df1103457ddb7892b2cc9 deviceinfo
|
2018-10-15 19:54:15 +00:00
|
|
|
136247a16ec91dc0c7241eeddb28c2196ae3b29946a9bc7e9566f848491ef1c53b12d05bf2dbc1cc352986712fd76f25c1510bcc8f301af540a2f01c33b299e1 expected-deviceinfo-downstream
|
2024-06-18 19:53:59 +00:00
|
|
|
b2e87ab10c116adc18e89ebf478b08904b9a73b17176c03068f8711dac6353e6ab4b3fdaf4051eda05660cac31514520756973ec43d052ba9f42cb1ec9375c5d expected-deviceinfo-mainline
|
2021-08-17 23:25:46 +00:00
|
|
|
"
|