Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / utils / hfsprogs / Makefile
1 #
2 # Copyright (C) 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:=hfsprogs
11 PKG_VERSION:=332.25
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-3.0+
15 PKG_LICENSE_FILES:=COPYING
16
17 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
18
19 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
20 PKG_SOURCE_URL:=http://archive.ubuntu.com/ubuntu/pool/universe/h/$(PKG_NAME)
21 PKG_BUILD_DIR:=$(BUILD_DIR)/diskdev_cmds-$(PKG_VERSION)
22 PKG_HASH:=74c9aeca899ed7f4bf155c65fc45bf0f250c0f6d57360ea953b1d536d9aa45e6
23 PKG_LICENSE:=APSL 2.0
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 define Package/hfsprogs/Default
29 SECTION:=utils
30 CATEGORY:=Utilities
31 SUBMENU:=Filesystem
32 DEPENDS:=+libopenssl +USE_GLIBC:libbsd
33 endef
34
35 define Package/hfsfsck
36 $(call Package/hfsprogs/Default)
37 TITLE:=fsck (fsck.hfs) utility from hfsprogs
38 endef
39
40 define Package/mkhfs
41 $(call Package/hfsprogs/Default)
42 TITLE:=mkfs (mkfs.hfs) utility from hfsprogs
43 endef
44
45 define Package/hfsfsck/description
46 Utilities to create and check HFS/HFS+ filesystems.
47 (fsck.hfs and fsck.hfsplus for checking integrity of HFS/HFS+ volumes)
48 endef
49
50 define Package/mkhfs/description
51 Utilities to create and check HFS/HFS+ filesystems.
52 (mkfs.hfs and mkfs.hfsplus for creating HFS/HFS+ volumes)
53 endef
54
55 define Build/Configure
56 endef
57
58 define Build/Compile
59 $(MAKE) -C $(PKG_BUILD_DIR) \
60 -f Makefile.lnx \
61 $(TARGET_CONFIGURE_OPTS) \
62 CFLAGS+="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1" \
63 LDFLAGS+="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_GLIBC),-lbsd)" \
64 all
65 endef
66
67 define Package/hfsfsck/install
68 $(INSTALL_DIR) $(1)/lib/functions/fsck
69 $(INSTALL_DATA) ./files/hfsfsck.sh $(1)/lib/functions/fsck/
70 $(INSTALL_DIR) $(1)/usr/sbin
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fsck_hfs.tproj/fsck_hfs $(1)/usr/sbin/fsck.hfsplus
72 (cd $(1)/usr/sbin; ln -sf fsck.hfsplus fsck.hfs;)
73 endef
74
75 define Package/mkhfs/install
76 $(INSTALL_DIR) $(1)/usr/sbin
77 $(INSTALL_BIN) $(PKG_BUILD_DIR)/newfs_hfs.tproj/newfs_hfs $(1)/usr/sbin/mkfs.hfsplus
78 (cd $(1)/usr/sbin; ln -sf mkfs.hfsplus mkfs.hfs;)
79 endef
80
81 $(eval $(call BuildPackage,hfsfsck))
82 $(eval $(call BuildPackage,mkhfs))