build: support make tools/<name>/install again
[openwrt/openwrt.git] / package / utils / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 # Copyright 2010 Vertical Communications
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:=e2fsprogs
11 PKG_VERSION:=1.43.3
12 PKG_HASH:=ce8ef1bbb0d4730f170167284fda156ac9d6bf18db2750eb94af619a81b19927
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/e2fsprogs
17
18 PKG_BUILD_DEPENDS:=util-linux
19 PKG_INSTALL:=1
20
21 PKG_BUILD_PARALLEL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/e2fsprogs/Default
26 URL:=http://e2fsprogs.sourceforge.net/
27 SUBMENU:=Filesystem
28 endef
29
30 define Package/e2fsprogs
31 $(call Package/e2fsprogs/Default)
32 SECTION:=utils
33 CATEGORY:=Utilities
34 TITLE:=Ext2/3/4 filesystem utilities
35 DEPENDS:=+libuuid +libext2fs
36 endef
37
38 define Package/e2fsprogs/description
39 This package contains essential ext2 filesystem utilities which consists of
40 e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
41 endef
42
43 define Package/libext2fs
44 $(call Package/e2fsprogs/Default)
45 SECTION:=libs
46 CATEGORY:=Libraries
47 DEPENDS:=+libuuid
48 TITLE:=ext2/3/4 filesystem library
49 endef
50
51 define Package/libext2fs/description
52 libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
53 endef
54
55 define Package/tune2fs
56 $(call Package/e2fsprogs)
57 TITLE:=Ext2 Filesystem tune utility
58 DEPENDS:= +e2fsprogs
59 endef
60
61 define Package/resize2fs
62 $(call Package/e2fsprogs)
63 TITLE:=Ext2 Filesystem resize utility
64 DEPENDS:= +e2fsprogs
65 endef
66
67 define Package/badblocks
68 $(call Package/e2fsprogs)
69 TITLE:=Ext2 Filesystem badblocks utility
70 DEPENDS:= +e2fsprogs
71 endef
72
73 define Package/dumpe2fs
74 $(call Package/e2fsprogs)
75 TITLE:=Ext2 Filesystem information dumping utility
76 DEPENDS:= +e2fsprogs
77 endef
78
79 define Package/e2freefrag
80 $(call Package/e2fsprogs)
81 TITLE:=Ext2 Filesystem free space fragmentation information utility
82 DEPENDS:= +e2fsprogs
83 endef
84
85 define Package/filefrag
86 $(call Package/e2fsprogs)
87 TITLE:=Ext2 Filesystem file fragmentation report utility
88 DEPENDS:= +e2fsprogs
89 endef
90
91 define Package/debugfs
92 $(call Package/e2fsprogs)
93 TITLE:=Ext2 Filesystem debugger
94 DEPENDS:= +e2fsprogs
95 endef
96
97 define Package/chattr
98 $(call Package/e2fsprogs)
99 TITLE:=Ext2 Filesystem chattr utility
100 DEPENDS:= +e2fsprogs
101 endef
102
103 define Package/lsattr
104 $(call Package/e2fsprogs)
105 TITLE:=Ext2 Filesystem lsattr utility
106 DEPENDS:= +e2fsprogs
107 endef
108
109 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
110
111 CONFIGURE_VARS += \
112 ac_cv_lib_pthread_sem_init=no
113
114 CONFIGURE_ARGS += \
115 --disable-testio-debug \
116 --enable-elf-shlibs \
117 --disable-libuuid \
118 --enable-libblkid \
119 --disable-uuidd \
120 --disable-tls \
121 --disable-nls \
122 --disable-rpath
123
124 define Build/Prepare
125 $(call Build/Prepare/Default)
126 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
127 endef
128
129 define Build/Compile
130 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \
131 BUILDCC="$(HOSTCC)" \
132 CFLAGS="" \
133 CPPFLAGS="" \
134 LDFLAGS="" \
135 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
136 subst
137 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
138 LDFLAGS=-Wl,--gc-sections \
139 BUILDCC="$(HOSTCC)" \
140 DESTDIR="$(PKG_INSTALL_DIR)" \
141 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
142 ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
143 SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \
144 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
145 all
146 endef
147
148 define Build/InstallDev
149 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
150 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig
151 $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig
152
153 $(INSTALL_DIR) $(1)/usr/lib
154 $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib
155 $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib
156
157 $(INSTALL_DIR) $(1)/usr/include/ext2fs
158 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs
159 $(INSTALL_DIR) $(1)/usr/include/et
160 $(CP) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et
161 endef
162
163 define Package/e2fsprogs/conffiles
164 /etc/e2fsck.conf
165 endef
166
167 define Package/e2fsprogs/install
168 $(INSTALL_DIR) $(1)/usr/sbin
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
171 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2
172 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3
173 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4
174 $(LN) e2fsck $(1)/usr/sbin/fsck.ext2
175 $(LN) e2fsck $(1)/usr/sbin/fsck.ext3
176 $(LN) e2fsck $(1)/usr/sbin/fsck.ext4
177 $(INSTALL_DIR) $(1)/usr/lib
178 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
179 $(INSTALL_DIR) $(1)/etc/init.d
180 $(INSTALL_DIR) $(1)/lib/functions/fsck
181 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
182 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
183 endef
184
185 define Package/libcom_err/install
186 endef
187
188 define Package/libext2fs/install
189 $(INSTALL_DIR) $(1)/usr/lib
190 $(CP) \
191 $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
192 $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
193 $(1)/usr/lib/
194 endef
195
196 define Package/libext2fs/install_lib
197 $(INSTALL_DIR) $(1)/usr/lib
198 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
199 endef
200
201 define Package/tune2fs/install
202 $(INSTALL_DIR) $(1)/usr/sbin
203 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
204 $(LN) tune2fs $(1)/usr/sbin/findfs
205 endef
206
207 define Package/resize2fs/install
208 $(INSTALL_DIR) $(1)/usr/sbin
209 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
210 endef
211
212 define Package/badblocks/install
213 $(INSTALL_DIR) $(1)/usr/sbin
214 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
215 endef
216
217 define Package/dumpe2fs/install
218 $(INSTALL_DIR) $(1)/usr/sbin
219 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/
220 endef
221
222 define Package/e2freefrag/install
223 $(INSTALL_DIR) $(1)/usr/sbin
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
225 endef
226
227 define Package/filefrag/install
228 $(INSTALL_DIR) $(1)/usr/sbin
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
230 endef
231
232 define Package/debugfs/install
233 $(INSTALL_DIR) $(1)/usr/sbin
234 $(INSTALL_DIR) $(1)/usr/lib
235 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/
236 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so.* $(1)/usr/lib/
237 endef
238
239 define Package/chattr/install
240 $(INSTALL_DIR) $(1)/usr/bin
241 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chattr $(1)/usr/bin/
242 endef
243
244 define Package/lsattr/install
245 $(INSTALL_DIR) $(1)/usr/bin
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsattr $(1)/usr/bin/
247 endef
248
249 $(eval $(call BuildPackage,e2fsprogs))
250 $(eval $(call BuildPackage,libext2fs))
251 $(eval $(call BuildPackage,tune2fs))
252 $(eval $(call BuildPackage,resize2fs))
253 $(eval $(call BuildPackage,badblocks))
254 $(eval $(call BuildPackage,dumpe2fs))
255 $(eval $(call BuildPackage,e2freefrag))
256 $(eval $(call BuildPackage,filefrag))
257 $(eval $(call BuildPackage,debugfs))
258 $(eval $(call BuildPackage,chattr))
259 $(eval $(call BuildPackage,lsattr))