1################################################################################
2#
3# dosfstools
4#
5################################################################################
6
7DOSFSTOOLS_VERSION = 4.2
8DOSFSTOOLS_SITE = https://github.com/dosfstools/dosfstools/releases/download/v$(DOSFSTOOLS_VERSION)
9DOSFSTOOLS_LICENSE = GPL-3.0+
10DOSFSTOOLS_LICENSE_FILES = COPYING
11DOSFSTOOLS_CPE_ID_VALID = YES
12DOSFSTOOLS_SELINUX_MODULES = fstools
13DOSFSTOOLS_CONF_OPTS = --enable-compat-symlinks --exec-prefix=/
14HOST_DOSFSTOOLS_CONF_OPTS = --enable-compat-symlinks
15
16ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
17DOSFSTOOLS_CONF_OPTS += --with-udev
18DOSFSTOOLS_DEPENDENCIES += udev
19else
20DOSFSTOOLS_CONF_OPTS += --without-udev
21endif
22
23ifneq ($(BR2_ENABLE_LOCALE),y)
24DOSFSTOOLS_CONF_OPTS += LIBS="-liconv"
25DOSFSTOOLS_DEPENDENCIES += libiconv
26endif
27
28ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FATLABEL),y)
29define DOSFSTOOLS_INSTALL_FATLABEL
30	$(INSTALL) -D -m 0755 $(@D)/src/fatlabel $(TARGET_DIR)/sbin/fatlabel
31	ln -sf fatlabel $(TARGET_DIR)/sbin/dosfslabel
32endef
33endif
34
35ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT),y)
36define DOSFSTOOLS_INSTALL_FSCK_FAT
37	$(INSTALL) -D -m 0755 $(@D)/src/fsck.fat $(TARGET_DIR)/sbin/fsck.fat
38	ln -sf fsck.fat $(TARGET_DIR)/sbin/fsck.vfat
39	ln -sf fsck.fat $(TARGET_DIR)/sbin/fsck.msdos
40	ln -sf fsck.fat $(TARGET_DIR)/sbin/dosfsck
41endef
42endif
43
44ifeq ($(BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT),y)
45define DOSFSTOOLS_INSTALL_MKFS_FAT
46	$(INSTALL) -D -m 0755 $(@D)/src/mkfs.fat $(TARGET_DIR)/sbin/mkfs.fat
47	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkdosfs
48	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkfs.msdos
49	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkfs.vfat
50endef
51endif
52
53define DOSFSTOOLS_INSTALL_TARGET_CMDS
54	$(call DOSFSTOOLS_INSTALL_FATLABEL)
55	$(call DOSFSTOOLS_INSTALL_FSCK_FAT)
56	$(call DOSFSTOOLS_INSTALL_MKFS_FAT)
57endef
58
59$(eval $(autotools-package))
60$(eval $(host-autotools-package))
61