5d5ad901dd11cda6e3e2973529def73967581ca2
[openwrt/openwrt.git] / package / utils / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2012 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.42.4
12 PKG_MD5SUM:=b6e296f210d642361b7394437ff0f318
13 PKG_RELEASE:=1
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_LICENSE:=GPL-2.0 LGPL-2.0 BSD-3-Clause MIT
22 PKG_LICENSE_FILES:=COPYING
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/e2fsprogs/Default
27 URL:=http://e2fsprogs.sourceforge.net/
28 SUBMENU:=Filesystem
29 endef
30
31 define Package/e2fsprogs
32 $(call Package/e2fsprogs/Default)
33 SECTION:=utils
34 CATEGORY:=Utilities
35 TITLE:=Ext2/3/4 filesystem utilities
36 DEPENDS:=+libuuid +libext2fs
37 endef
38
39 define Package/e2fsprogs/description
40 This package contains essential ext2 filesystem utilities which consists of
41 e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
42 endef
43
44 define Package/libext2fs
45 $(call Package/e2fsprogs/Default)
46 SECTION:=libs
47 CATEGORY:=Libraries
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 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
74
75 CONFIGURE_VARS += \
76 ac_cv_lib_pthread_sem_init=no
77
78 CONFIGURE_ARGS += \
79 --disable-testio-debug \
80 --enable-elf-shlibs \
81 --disable-libuuid \
82 --enable-libblkid \
83 --disable-uuidd \
84 --disable-tls \
85 --disable-nls \
86 --disable-rpath
87
88 define Build/Prepare
89 $(call Build/Prepare/Default)
90 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
91 endef
92
93 define Build/Compile
94 $(MAKE) -C $(PKG_BUILD_DIR)/util \
95 BUILDCC="$(HOSTCC)" \
96 CFLAGS="" \
97 CPPFLAGS="" \
98 LDFLAGS="" \
99 subst
100 $(MAKE) -C $(PKG_BUILD_DIR) \
101 LDFLAGS=-Wl,--gc-sections \
102 BUILDCC="$(HOSTCC)" \
103 DESTDIR="$(PKG_INSTALL_DIR)" \
104 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
105 all
106 endef
107
108 define Package/e2fsprogs/install
109 $(INSTALL_DIR) $(1)/usr/sbin
110 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
112 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
113 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
114 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext4
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
117 $(INSTALL_DIR) $(1)/etc/init.d
118 $(INSTALL_DIR) $(1)/lib/functions/fsck
119 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
120 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
121 endef
122
123 define Package/libcom_err/install
124 endef
125
126 define Package/libext2fs/install
127 $(INSTALL_DIR) $(1)/usr/lib
128 $(CP) \
129 $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
130 $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
131 $(1)/usr/lib/
132 endef
133
134 define Package/libext2fs/install_lib
135 $(INSTALL_DIR) $(1)/usr/lib
136 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
137 endef
138
139 define Package/tune2fs/install
140 $(INSTALL_DIR) $(1)/usr/sbin
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
142 endef
143
144 define Package/resize2fs/install
145 $(INSTALL_DIR) $(1)/usr/sbin
146 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
147 endef
148
149 define Package/badblocks/install
150 $(INSTALL_DIR) $(1)/usr/sbin
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
152 endef
153
154 $(eval $(call BuildPackage,e2fsprogs))
155 $(eval $(call BuildPackage,libext2fs))
156 $(eval $(call BuildPackage,tune2fs))
157 $(eval $(call BuildPackage,resize2fs))
158 $(eval $(call BuildPackage,badblocks))