From 2b6898ef61355d10c0fa0b5c3cbdd4e4b516e940 Mon Sep 17 00:00:00 2001 From: eunufe Date: Sun, 5 Jan 2025 17:56:03 -0600 Subject: [PATCH] feat(24.04): add SDF for file and dependencies --- slices/file.yaml | 16 ++++++++++++++++ slices/libmagic-mgc.yaml | 13 +++++++++++++ slices/libmagic1t64.yaml | 21 +++++++++++++++++++++ tests/spread/integration/file/task.yaml | 13 +++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 slices/file.yaml create mode 100644 slices/libmagic-mgc.yaml create mode 100644 slices/libmagic1t64.yaml create mode 100644 tests/spread/integration/file/task.yaml diff --git a/slices/file.yaml b/slices/file.yaml new file mode 100644 index 00000000..3521e233 --- /dev/null +++ b/slices/file.yaml @@ -0,0 +1,16 @@ +package: file + +essential: + - file_copyright + +slices: + bins: + essential: + - libc6_libs + - libmagic1t64_libs + contents: + /usr/bin/file: + + copyright: + contents: + /usr/share/doc/file/copyright: diff --git a/slices/libmagic-mgc.yaml b/slices/libmagic-mgc.yaml new file mode 100644 index 00000000..64d7d6a5 --- /dev/null +++ b/slices/libmagic-mgc.yaml @@ -0,0 +1,13 @@ +package: libmagic-mgc + +essential: + - libmagic-mgc_copyright + +slices: + data: + contents: + /usr/lib/file/magic.mgc: + + copyright: + contents: + /usr/share/doc/libmagic-mgc/copyright: diff --git a/slices/libmagic1t64.yaml b/slices/libmagic1t64.yaml new file mode 100644 index 00000000..621957a8 --- /dev/null +++ b/slices/libmagic1t64.yaml @@ -0,0 +1,21 @@ +package: libmagic1t64 + +essential: + - libmagic1t64_copyright + +slices: + libs: + essential: + - libbz2-1.0_libs + - libc6_libs + - liblzma5_libs + - libmagic-mgc_data + - zlib1g_libs + contents: + /etc/magic: + /etc/magic.mime: + /usr/lib/*-linux-*/libmagic.so.1*: + + copyright: + contents: + /usr/share/doc/libmagic1t64/copyright: diff --git a/tests/spread/integration/file/task.yaml b/tests/spread/integration/file/task.yaml new file mode 100644 index 00000000..da4f2d7e --- /dev/null +++ b/tests/spread/integration/file/task.yaml @@ -0,0 +1,13 @@ +summary: Integration tests for file + +execute: | + rootfs="$(install-slices file_bins)" + + chroot "${rootfs}/" file --help + echo "Hello World" > "${rootfs}/testfile" + output=$(chroot "${rootfs}/" \ + file -b testfile) + if [ "$output" != "ASCII text" ]; then + echo "file failed" + exit 1 + fi