blob: 8477668658d1d3fa178a761911450fbe020f7a84 [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
Andrew Geissler5082cc72023-09-11 08:41:39 -040014SRC_URI = "git://github.com/file/file.git;branch=master;protocol=https \
15 file://print_c.patch \
16 "
Andrew Geissler517393d2023-01-13 08:55:19 -060017
Andrew Geissler5082cc72023-09-11 08:41:39 -040018SRCREV = "4cbd5c8f0851201d203755b76cb66ba991ffd8be"
Andrew Geissler517393d2023-01-13 08:55:19 -060019S = "${WORKDIR}/git"
20
21inherit autotools update-alternatives
22
23PACKAGECONFIG ??= "bz2 lzma zlib"
24PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2"
25PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz"
26PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050027PACKAGECONFIG[zstdlib] = "--enable-zstdlib, --disable-zstdlib, zstd"
28PACKAGECONFIG[lzlib] = "--enable-lzlib, --disable-lzlib, lzip"
29PACKAGECONFIG[seccomp] = "--enable-libseccomp, --disable-libseccomp, libseccomp"
Andrew Geissler517393d2023-01-13 08:55:19 -060030
31ALTERNATIVE:${PN} = "file"
32ALTERNATIVE_LINK_NAME[file] = "${bindir}/file"
33
34EXTRA_OEMAKE:append:class-target = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
35EXTRA_OEMAKE:append:class-nativesdk = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
36
37FILES:${PN} += "${datadir}/misc/*.mgc"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060038FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/file.sh"
Andrew Geissler517393d2023-01-13 08:55:19 -060039
40do_compile:append:class-native() {
41 oe_runmake check
42}
43
44do_install:append:class-native() {
45 create_cmdline_wrapper ${D}/${bindir}/file \
46 --magic-file ${datadir}/misc/magic.mgc
47}
48
49do_install:append:class-nativesdk() {
Patrick Williams2a254922023-08-11 09:48:11 -050050 create_wrapper ${D}/${bindir}/file MAGIC=${datadir}/misc/magic.mgc
Andrew Geisslerc5535c92023-01-27 16:10:19 -060051 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
52 cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh
Patrick Williams2a254922023-08-11 09:48:11 -050053 export MAGIC="${datadir}/misc/magic.mgc"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060054 EOF
Andrew Geissler517393d2023-01-13 08:55:19 -060055}
56
57BBCLASSEXTEND = "native nativesdk"
58PROVIDES:append:class-native = " file-replacement-native"
59# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
60# depends on file-replacement-native.
61bindir:append:class-native = "/file-native"