Merge pull request #2706 from dibdot/adblock
[feed/packages.git] / utils / dosfstools / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=dosfstools
11 PKG_VERSION:=3.0.28
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-3.0+
15 PKG_LICENSE_FILES:=COPYING
16
17 PKG_MAINTAINER:=David Bonnes <david.bonnes@gmail.com>
18
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20 PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
21 http://fossies.org/linux/misc
22 PKG_MD5SUM:=64e3b3a59b51d2a97d7ac38b23a124bb
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/nls.mk
26
27 define Package/dosfstools/Default
28 SECTION:=utils
29 CATEGORY:=Utilities
30 URL:=https://github.com/dosfstools
31 SUBMENU:=Filesystem
32 DEPENDS:=$(ICONV_DEPENDS)
33 endef
34
35 define Package/dosfsck
36 $(call Package/dosfstools/Default)
37 TITLE:=fsck (fsck.fat) utility from dosfstools
38 endef
39
40 define Package/dosfslabel
41 $(call Package/dosfstools/Default)
42 TITLE:=fslabel (fatlabel) utility from dosfstools
43 endef
44
45 define Package/mkdosfs
46 $(call Package/dosfstools/Default)
47 TITLE:=mkfs (mkfs.fat) utility from dosfstools
48 endef
49
50 define Package/dosfsck/description
51 Utilities to create and check MS-DOS FAT filesystems.
52 (fsck.vfat and fsck.fat for checking integrity of FAT volumes)
53 endef
54
55 define Package/dosfslabel/description
56 Utilities to create and check MS-DOS FAT filesystems.
57 (fatlabel for reading and writing labels of FAT volumes)
58 endef
59
60 define Package/mkdosfs/description
61 Utilities to create and check MS-DOS FAT filesystems.
62 (mkfs.vfat and mkfs.fat for creating FAT volumes)
63 endef
64
65 LDFLAGS+=$(ICONV_LDFLAGS)
66 LDLIBS+=-liconv
67
68 define Build/Configure
69 endef
70
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 $(TARGET_CONFIGURE_OPTS) \
74 OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" \
75 PREFIX="/usr" \
76 SBINDIR="/usr/sbin" \
77 LDFLAGS="$(LDFLAGS)" \
78 LDLIBS="$(LDLIBS)" \
79 all
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 $(TARGET_CONFIGURE_OPTS) \
82 OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
83 PREFIX="$(PKG_INSTALL_DIR)/usr" \
84 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin" \
85 install-bin
86 endef
87
88 define Package/dosfsck/install
89 $(INSTALL_DIR) $(1)/lib/functions/fsck
90 $(INSTALL_DATA) ./files/dosfsck.sh $(1)/lib/functions/fsck/
91 $(INSTALL_DIR) $(1)/usr/sbin
92 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.fat $(1)/usr/sbin/
93 (cd $(1)/usr/sbin; ln -sf fsck.fat fsck.msdos; ln -sf fsck.fat fsck.vfat; ln -sf fsck.fat dosfsck)
94 endef
95
96 define Package/dosfslabel/install
97 $(INSTALL_DIR) $(1)/usr/sbin
98 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fatlabel $(1)/usr/sbin/
99 endef
100
101 define Package/mkdosfs/install
102 $(INSTALL_DIR) $(1)/usr/sbin
103 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.fat $(1)/usr/sbin/
104 (cd $(1)/usr/sbin; ln -sf mkfs.fat mkfs.msdos; ln -sf mkfs.fat mkfs.vfat)
105 endef
106
107 $(eval $(call BuildPackage,dosfsck))
108 $(eval $(call BuildPackage,dosfslabel))
109 $(eval $(call BuildPackage,mkdosfs))