f2fs-tools: add selinux variant
[openwrt/staging/ldir.git] / package / utils / f2fs-tools / 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:=f2fs-tools
11 PKG_VERSION:=1.13.0
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-2.0
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
18 PKG_HASH:=b39d3ae9224267aab0070b5f17d91d0c5143f6d960166a27f6b11c8c87072c7d
19
20 PKG_FIXUP:=autoreconf
21 PKG_BUILD_PARALLEL:=1
22 PKG_INSTALL:=1
23
24 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/f2fs-tools/Default
29 SECTION:=utils
30 CATEGORY:=Utilities
31 SUBMENU:=Filesystem
32 DEPENDS:=+libf2fs
33 URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
34 VARIANT:=default
35 endef
36
37 define Package/f2fs-tools/SELinux
38 SECTION:=utils
39 CATEGORY:=Utilities
40 SUBMENU:=Filesystem
41 DEPENDS:=+libf2fs-selinux +libselinux
42 URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
43 VARIANT:=selinux
44 endef
45
46 define Package/mkf2fs
47 $(Package/f2fs-tools/Default)
48 TITLE:=Utility for creating a Flash-Friendly File System (F2FS)
49 CONFLICTS:=mkf2fs-selinux
50 endef
51
52 define Package/mkf2fs-selinux
53 $(Package/f2fs-tools/SELinux)
54 TITLE:=Utility for creating a Flash-Friendly File System (F2FS) with SELinux support
55 endef
56
57 define Package/f2fsck
58 $(Package/f2fs-tools/Default)
59 TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS)
60 CONFLICTS:=f2fsck-selinux
61 endef
62
63 define Package/f2fsck-selinux
64 $(Package/f2fs-tools/SELinux)
65 TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) with SELinux support
66 endef
67
68 define Package/f2fs-tools
69 $(Package/f2fs-tools/Default)
70 TITLE:=Tools for Flash-Friendly File System (F2FS)
71 DEPENDS += +mkf2fs +f2fsck
72 CONFLICTS:=f2fs-tools-selinux
73 endef
74
75 define Package/f2fs-tools-selinux
76 $(Package/f2fs-tools/SELinux)
77 TITLE:=Tools for Flash-Friendly File System (F2FS) with SELinux support
78 DEPENDS += +mkf2fs-selinux +f2fsck-selinux
79 endef
80
81 define Package/libf2fs
82 SECTION:=libs
83 CATEGORY:=Libraries
84 TITLE:=Library for Flash-Friendly File System (F2FS) tools
85 DEPENDS:=+libuuid
86 ABI_VERSION:=6
87 CONFLICTS:=libf2fs-selinux
88 endef
89
90 define Package/libf2fs-selinux
91 SECTION:=libs
92 CATEGORY:=Libraries
93 TITLE:=Library for Flash-Friendly File System (F2FS) tools with SELinux support
94 DEPENDS:=+libuuid +libselinux
95 ABI_VERSION:=6
96 endef
97
98 CONFIGURE_ARGS += \
99 --disable-static \
100 --without-blkid
101
102 ifneq ($(BUILD_VARIANT),selinux)
103 CONFIGURE_ARGS += --without-selinux
104 endif
105
106 CONFIGURE_VARS += \
107 ac_cv_file__git=no
108
109 define Package/libf2fs/install
110 $(INSTALL_DIR) $(1)/usr/lib
111 $(CP) \
112 $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so.* $(1)/usr/lib/
113 endef
114
115 Package/libf2fs-selinux/install = $(Package/libf2fs/install)
116
117 define Package/mkf2fs/install
118 $(INSTALL_DIR) $(1)/usr/sbin
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin
120 endef
121
122 Package/mkf2fs-selinux/install = $(Package/mkf2fs/install)
123
124 define Package/f2fsck/install
125 $(INSTALL_DIR) $(1)/usr/sbin
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin
127 ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs
128 ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
129 ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs
130 ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs
131 endef
132
133 Package/f2fsck-selinux/install = $(Package/f2fsck/install)
134
135 define Package/f2fs-tools/install
136 $(INSTALL_DIR) $(1)/usr/sbin
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/f2fstat $(1)/usr/sbin
138 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fibmap.f2fs $(1)/usr/sbin
139 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin
140 endef
141
142 Package/f2fs-tools-selinux/install = $(Package/f2fs-tools/install)
143
144 $(eval $(call BuildPackage,libf2fs))
145 $(eval $(call BuildPackage,libf2fs-selinux))
146 $(eval $(call BuildPackage,mkf2fs))
147 $(eval $(call BuildPackage,mkf2fs-selinux))
148 $(eval $(call BuildPackage,f2fsck))
149 $(eval $(call BuildPackage,f2fsck-selinux))
150 $(eval $(call BuildPackage,f2fs-tools))
151 $(eval $(call BuildPackage,f2fs-tools-selinux))