blob: 32b61f4f39a1c308705e60d1997fe5d053f7953a [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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
Andrew Geisslerc182c622020-05-15 14:13:32 -050011DEPENDS = "file-replacement-native"
Patrick Williams213cb262021-08-07 19:21:33 -050012DEPENDS:class-native = "bzip2-replacement-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013
Andrew Geisslerc926e172021-05-07 16:11:35 -050014SRC_URI = "git://github.com/file/file.git"
Andrew Geissler82c905d2020-04-13 13:39:40 -050015
Andrew Geisslerc926e172021-05-07 16:11:35 -050016SRCREV = "f49fda6f52a9477d817dbd9c06afab02daf025f8"
Andrew Geissler82c905d2020-04-13 13:39:40 -050017S = "${WORKDIR}/git"
18
19inherit autotools update-alternatives
20
Andrew Geissler6ce62a22020-11-30 19:58:47 -060021PACKAGECONFIG ??= "bz2 lzma zlib"
Andrew Geisslerc182c622020-05-15 14:13:32 -050022PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2"
23PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz"
24PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib"
25
Andrew Geissler82c905d2020-04-13 13:39:40 -050026EXTRA_OECONF += "--disable-libseccomp"
27
Patrick Williams213cb262021-08-07 19:21:33 -050028ALTERNATIVE:${PN} = "file"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029ALTERNATIVE_LINK_NAME[file] = "${bindir}/file"
30
Patrick Williams213cb262021-08-07 19:21:33 -050031EXTRA_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"
Andrew Geissler82c905d2020-04-13 13:39:40 -050033
Patrick Williams213cb262021-08-07 19:21:33 -050034FILES:${PN} += "${datadir}/misc/*.mgc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050035
Patrick Williams213cb262021-08-07 19:21:33 -050036do_compile:append:class-native() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 oe_runmake check
38}
39
Patrick Williams213cb262021-08-07 19:21:33 -050040do_install:append:class-native() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 create_cmdline_wrapper ${D}/${bindir}/file \
42 --magic-file ${datadir}/misc/magic.mgc
43}
44
Patrick Williams213cb262021-08-07 19:21:33 -050045do_install:append:class-nativesdk() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050046 create_cmdline_wrapper ${D}/${bindir}/file \
47 --magic-file ${datadir}/misc/magic.mgc
48}
49
50BBCLASSEXTEND = "native nativesdk"
Patrick Williams213cb262021-08-07 19:21:33 -050051PROVIDES:append:class-native = " file-replacement-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050052# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
53# depends on file-replacement-native.
Patrick Williams213cb262021-08-07 19:21:33 -050054bindir:append:class-native = "/file-native"