Bläddra i källkod

f2fs-tools: add package

Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov 10 år sedan
förälder
incheckning
bad607f2c2
3 ändrade filer med 133 tillägg och 0 borttagningar
  1. 25
    0
      utils/f2fs-tools/Config.in
  2. 89
    0
      utils/f2fs-tools/Makefile
  3. 19
    0
      utils/f2fs-tools/patches/001-compile.patch

+ 25
- 0
utils/f2fs-tools/Config.in Visa fil

@@ -0,0 +1,25 @@
1
+menu "Configuration"
2
+        depends on PACKAGE_f2fs-tools
3
+
4
+config F2FS_UTILS_f2fstat
5
+	bool "Install f2fstat utility"
6
+	default y
7
+
8
+config F2FS_UTILS_fibmap_f2fs
9
+	bool "Install fibmap.f2fs utility"
10
+	default y
11
+
12
+config F2FS_UTILS_fsck_f2fs
13
+	bool "Install fsck.f2fs utility"
14
+	default y
15
+
16
+config F2FS_UTILS_dump_f2fs
17
+	bool "Install dump.f2fs utility"
18
+	select F2FS_UTILS_fsck_f2fs
19
+	default y
20
+
21
+config F2FS_UTILS_mkfs_f2fs
22
+	bool "Install mkfs.f2fs utility"
23
+	default y
24
+
25
+endmenu

+ 89
- 0
utils/f2fs-tools/Makefile Visa fil

@@ -0,0 +1,89 @@
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:=f2fs-tools
11
+PKG_VERSION:=1.4.0
12
+PKG_RELEASE:=1
13
+
14
+PKG_LICENSE:=GPLv2
15
+
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17
+PKG_SOURCE_URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
18
+PKG_MD5SUM:=be9bfdddf3e5fd5e701a88d0b388dc26
19
+
20
+PKG_FIXUP:=autoreconf
21
+PKG_BUILD_PARALLEL:=1
22
+PKG_INSTALL:=1
23
+
24
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
25
+
26
+include $(INCLUDE_DIR)/package.mk
27
+
28
+define Package/f2fs-tools
29
+  SECTION:=utils
30
+  CATEGORY:=Utilities
31
+  SUBMENU:=Filesystem
32
+  TITLE:=Tools for Flash-Friendly File System (F2FS)
33
+  DEPENDS:=+libuuid +libf2fs
34
+  URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
35
+  MENU:=1
36
+endef
37
+
38
+define Package/libf2fs
39
+  $(call Package/lxc/Default)
40
+  SECTION:=libs
41
+  CATEGORY:=Libraries
42
+  TITLE:=Library for Flash-Friendly File System (F2FS) tools
43
+  DEPENDS:=
44
+endef
45
+
46
+define Package/f2fs-tools/config
47
+  source "$(SOURCE)/Config.in"
48
+endef
49
+
50
+define Package/libf2fs/install
51
+	$(INSTALL_DIR) $(1)/usr/lib
52
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
53
+endef
54
+
55
+define Package/f2fs-tools/install
56
+	$(INSTALL_DIR) $(1)/usr/sbin
57
+
58
+ifeq ($(CONFIG_F2FS_UTILS_f2fstat),y)
59
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/f2fstat $(1)/usr/sbin
60
+endif
61
+
62
+ifeq ($(CONFIG_F2FS_UTILS_fibmap_f2fs),y)
63
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fibmap.f2fs $(1)/usr/sbin
64
+endif
65
+
66
+ifeq ($(CONFIG_F2FS_UTILS_fsck_f2fs),y)
67
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fsck.f2fs $(1)/usr/sbin
68
+endif
69
+
70
+ifeq ($(CONFIG_F2FS_UTILS_dump_f2fs),y)
71
+	ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
72
+endif
73
+
74
+ifeq ($(CONFIG_F2FS_UTILS_mkfs_f2fs),y)
75
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mkfs.f2fs $(1)/usr/sbin
76
+endif
77
+
78
+endef
79
+
80
+define Build/InstallDev
81
+	$(INSTALL_DIR) $(1)/usr/include
82
+	$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
83
+	$(INSTALL_DIR) $(1)/usr/lib
84
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
85
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.a $(1)/usr/lib/
86
+endef
87
+
88
+$(eval $(call BuildPackage,libf2fs))
89
+$(eval $(call BuildPackage,f2fs-tools))

+ 19
- 0
utils/f2fs-tools/patches/001-compile.patch Visa fil

@@ -0,0 +1,19 @@
1
+--- a/configure.ac
2
++++ b/configure.ac
3
+@@ -20,14 +20,9 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpats
4
+ 				[\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
5
+ 				[Minor version for f2fs-tools])
6
+ 
7
+-AC_CHECK_FILE(.git,
8
+-	AC_DEFINE([F2FS_TOOLS_DATE],
9
+-		"m4_bpatsubst(f2fs_tools_gitdate,
10
+-		[\([0-9-]*\)\(\w\|\W\)*], [\1])",
11
+-		[f2fs-tools date based on Git commits]),
12
+-	AC_DEFINE([F2FS_TOOLS_DATE],
13
++AC_DEFINE([F2FS_TOOLS_DATE],
14
+ 		"f2fs_tools_date",
15
+-		[f2fs-tools date based on Source releases]))
16
++		[f2fs-tools date based on Source releases])
17
+ 
18
+ AC_CONFIG_SRCDIR([config.h.in])
19
+ AC_CONFIG_HEADER([config.h])