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