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