Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | SUMMARY = "File classification tool" |
| 2 | DESCRIPTION = "File attempts to classify files depending \ |
| 3 | on their contents and prints a description if a match is found." |
| 4 | HOMEPAGE = "http://www.darwinsys.com/file/" |
| 5 | SECTION = "console/utils" |
| 6 | |
| 7 | # two clause BSD |
| 8 | LICENSE = "BSD-2-Clause" |
| 9 | LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=0251eaec1188b20d9a72c502ecfdda1b" |
| 10 | |
| 11 | DEPENDS = "file-replacement-native" |
| 12 | DEPENDS:class-native = "bzip2-replacement-native" |
| 13 | |
| 14 | SRC_URI = "git://github.com/file/file.git;branch=master;protocol=https" |
| 15 | |
| 16 | SRCREV = "b92eed41b1bc0739c5c5d70c444e0c574429321b" |
| 17 | S = "${WORKDIR}/git" |
| 18 | |
| 19 | inherit autotools update-alternatives |
| 20 | |
| 21 | PACKAGECONFIG ??= "bz2 lzma zlib" |
| 22 | PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2" |
| 23 | PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz" |
| 24 | PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib" |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 25 | PACKAGECONFIG[zstdlib] = "--enable-zstdlib, --disable-zstdlib, zstd" |
| 26 | PACKAGECONFIG[lzlib] = "--enable-lzlib, --disable-lzlib, lzip" |
| 27 | PACKAGECONFIG[seccomp] = "--enable-libseccomp, --disable-libseccomp, libseccomp" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 28 | |
| 29 | ALTERNATIVE:${PN} = "file" |
| 30 | ALTERNATIVE_LINK_NAME[file] = "${bindir}/file" |
| 31 | |
| 32 | EXTRA_OEMAKE:append:class-target = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file" |
| 33 | EXTRA_OEMAKE:append:class-nativesdk = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file" |
| 34 | |
| 35 | FILES:${PN} += "${datadir}/misc/*.mgc" |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 36 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/file.sh" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 37 | |
| 38 | do_compile:append:class-native() { |
| 39 | oe_runmake check |
| 40 | } |
| 41 | |
| 42 | do_install:append:class-native() { |
| 43 | create_cmdline_wrapper ${D}/${bindir}/file \ |
| 44 | --magic-file ${datadir}/misc/magic.mgc |
| 45 | } |
| 46 | |
| 47 | do_install:append:class-nativesdk() { |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 48 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 49 | cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh |
| 50 | export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc" |
| 51 | EOF |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | BBCLASSEXTEND = "native nativesdk" |
| 55 | PROVIDES:append:class-native = " file-replacement-native" |
| 56 | # Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who |
| 57 | # depends on file-replacement-native. |
| 58 | bindir:append:class-native = "/file-native" |