fstools: stage libubi-utils static library and headers
[openwrt.git] / package / system / fstools / Makefile
1 #
2 # Copyright (C) 2014 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:=2014-06-02
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=git://nbd.name/fstools.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=d04e58946eff771bf59db90d7a2301b746141ac4
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 CMAKE_INSTALL:=1
21
22 PKG_LICENSE:=GPLv2
23 PKG_LICENSE_FILES:=
24
25 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
31
32 define Package/fstools
33   SECTION:=base
34   CATEGORY:=Base system
35   DEPENDS:=+ubox +USE_EGLIBC:librt
36   TITLE:=OpenWrt filesystem tools
37 endef
38
39 define Package/ubi-flash
40   SECTION:=base
41   CATEGORY:=Base system
42   TITLE:=OpenWrt ubi flashing tool
43 endef
44
45 define Package/block-mount
46   SECTION:=base
47   CATEGORY:=Base system
48   TITLE:=Block device mounting and checking
49   DEPENDS:=+ubox +libubox +libuci
50 endef
51
52 define Package/fstools/install
53         $(INSTALL_DIR) $(1)/sbin $(1)/lib
54
55         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset,snapshot_tool} $(1)/sbin/
56         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
57         $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
58         ln -s /sbin/jffs2reset $(1)/sbin/jffs2mark
59 endef
60
61 define Package/ubi-flash/install
62         $(INSTALL_DIR) $(1)/sbin $(1)/lib
63
64         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ubi $(1)/sbin/
65 endef
66
67 define Package/block-mount/install
68         $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
69
70         $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
71         $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
72         $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
73
74         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
75         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
76         ln -s /sbin/block $(1)/usr/sbin/swapon
77         ln -s /sbin/block $(1)/usr/sbin/swapoff
78
79 endef
80
81 define Build/InstallDev
82         $(INSTALL_DIR) $(1)/usr/include
83         $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
84         $(INSTALL_DIR) $(1)/usr/lib/
85         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
86 endef
87
88 $(eval $(call BuildPackage,fstools))
89 $(eval $(call BuildPackage,ubi-flash))
90 $(eval $(call BuildPackage,block-mount))