treewide: clean up download hashes
[openwrt/staging/chunkeey.git] / package / system / fstools / Makefile
1 #
2 # Copyright (C) 2014-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:=fstools
11 PKG_VERSION:=2016-09-31
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=94a5b0ad8d53f024f036c3526b48c34ebbd66a2f
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
20 PKG_MIRROR_HASH:=f9fca74463187f2ef07c45154ae5dea296bd7e6fcb734bdc5f8d452e8d6b9fa2
21 CMAKE_INSTALL:=1
22
23 PKG_LICENSE:=GPL-2.0
24 PKG_LICENSE_FILES:=
25
26 PKG_USE_MIPS16:=0
27 PKG_FLAGS:=nonshared
28
29 PKG_BUILD_DEPENDS := util-linux
30 PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
31
32 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
33
34 include $(INCLUDE_DIR)/package.mk
35 include $(INCLUDE_DIR)/cmake.mk
36
37 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
38 CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
39
40 define Package/fstools
41 SECTION:=base
42 CATEGORY:=Base system
43 DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
44 TITLE:=OpenWrt filesystem tools
45 MENU:=1
46 endef
47
48 define Package/fstools/config
49 config FSTOOLS_UBIFS_EXTROOT
50 depends on PACKAGE_fstools
51 depends on NAND_SUPPORT
52 bool "Support extroot functionality with UBIFS"
53 default y
54 help
55 This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
56 endef
57
58 define Package/snapshot-tool
59 SECTION:=base
60 CATEGORY:=Base system
61 TITLE:=rootfs snapshoting tool
62 DEPENDS:=+libubox +fstools
63 endef
64
65 define Package/block-mount
66 SECTION:=base
67 CATEGORY:=Base system
68 TITLE:=Block device mounting and checking
69 DEPENDS:=+ubox +libubox +libuci
70 endef
71
72 define Package/fstools/install
73 $(INSTALL_DIR) $(1)/sbin $(1)/lib
74
75 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
76 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
77 $(LN) jffs2reset $(1)/sbin/jffs2mark
78 endef
79
80 define Package/snapshot-tool/install
81 $(INSTALL_DIR) $(1)/sbin
82
83 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
84 $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
85 endef
86
87 define Package/block-mount/install
88 $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
89
90 $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
91 $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
92 $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
93
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
95 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
96 $(LN) ../../sbin/block $(1)/usr/sbin/swapon
97 $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
98
99 endef
100
101 define Build/InstallDev
102 $(INSTALL_DIR) $(1)/usr/include
103 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
104 $(INSTALL_DIR) $(1)/usr/lib/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
106 endef
107
108 $(eval $(call BuildPackage,fstools))
109 $(eval $(call BuildPackage,snapshot-tool))
110 $(eval $(call BuildPackage,block-mount))