add a package for the badblocks utility (closes: #3404)
[openwrt/staging/florian.git] / package / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=e2fsprogs
12 PKG_VERSION:=1.39
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/e2fsprogs
17 PKG_MD5SUM:=06f7806782e357797fad1d34b7ced0c6
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/e2fsprogs/Default
22 URL:=http://e2fsprogs.sourceforge.net/
23 endef
24
25 define Package/e2fsprogs
26 $(call Package/e2fsprogs/Default)
27 SECTION:=utils
28 CATEGORY:=Utilities
29 TITLE:=Ext2/3 filesystem utilities
30 DEPENDS:=+libblkid +libuuid
31 endef
32
33 define Package/e2fsprogs/description
34 This package contains essential ext2 filesystem utilities which consists of
35 e2fsck, mke2fs, debugfs, dumpe2fs, tune2fs, and most of the other core ext2
36 filesystem utilities.
37 endef
38
39 define Package/libuuid
40 $(call Package/e2fsprogs/Default)
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE:=DCE compatible Universally Unique Identifier library
44 endef
45
46 define Package/libuuid/description
47 Library for generating DCE compatible Universally Unique Identifiers.
48 endef
49
50 define Package/uuidgen
51 $(call Package/e2fsprogs)
52 DEPENDS:=libuuid
53 TITLE:=Command line utility to create a new UUID value
54 endef
55
56 define Package/uuidgen/description
57 uuidgen program creates a new universally unique identifier (UUID)
58 using the libuuid library. The new UUID can reasonably be considered
59 unique among all UUIDs created on the local system, and among UUIDs
60 created on other systems in the past and in the future.
61 endef
62
63 define Package/libblkid
64 $(call Package/e2fsprogs/Default)
65 SECTION:=libs
66 CATEGORY:=Libraries
67 TITLE:=block device id library
68 endef
69
70 define Package/libblkid/description
71 The blkid library which allows system programs like fsck and mount to
72 quickly and easily find block devices by filesystem UUID and LABEL.
73 endef
74
75 define Package/tune2fs
76 $(call Package/e2fsprogs)
77 TITLE:=Ext2 Filesystem tune utility
78 DEPENDS:=e2fsprogs
79 endef
80
81 define Package/resize2fs
82 $(call Package/e2fsprogs)
83 TITLE:=Ext2 Filesystem resize utility
84 DEPENDS:=e2fsprogs
85 endef
86
87 define Package/badblocks
88 $(call Package/e2fsprogs)
89 TITLE:=Ext2 Filesystem badblocks utility
90 DEPENDS:=e2fsprogs
91 endef
92
93 CONFIGURE_ARGS += \
94 --enable-shared \
95 --enable-static \
96 --disable-rpath \
97 --enable-elf-shlibs \
98 --enable-dynamic-e2fsck
99
100 define Build/Prepare
101 $(call Build/Prepare/Default)
102 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
103 endef
104
105 define Build/Compile
106 $(MAKE) -C $(PKG_BUILD_DIR)/util \
107 BUILDCC="$(HOSTCC)" \
108 CFLAGS="" \
109 CPPFLAGS="" \
110 LDFLAGS="" \
111 subst
112 $(MAKE) -C $(PKG_BUILD_DIR) \
113 BUILDCC="$(HOSTCC)" \
114 DESTDIR="$(PKG_INSTALL_DIR)" \
115 all install
116 endef
117
118 define Build/InstallDev
119 $(MAKE) -C $(PKG_BUILD_DIR) \
120 BUILDCC="$(HOSTCC)" \
121 DESTDIR="$(1)" \
122 install-libs
123 endef
124
125 define Package/e2fsprogs/install
126 $(INSTALL_DIR) $(1)/usr/sbin
127 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
129 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
130 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
131 $(INSTALL_DIR) $(1)/usr/lib
132 $(CP) $(foreach lib,com_err e2p ext2fs,$(PKG_INSTALL_DIR)/usr/lib/lib$(lib).so.*) $(1)/usr/lib/
133 endef
134
135 define Package/libuuid/install
136 $(INSTALL_DIR) $(1)/usr/lib
137 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuuid.so.* $(1)/usr/lib/
138 endef
139
140 define Package/uuidgen/install
141 $(INSTALL_DIR) $(1)/usr/bin
142 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uuidgen $(1)/usr/bin/
143 endef
144
145 define Package/libblkid/install
146 $(INSTALL_DIR) $(1)/usr/lib
147 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libblkid.so.* $(1)/usr/lib/
148 endef
149
150 define Package/tune2fs/install
151 $(INSTALL_DIR) $(1)/usr/sbin
152 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
153 endef
154
155 define Package/resize2fs/install
156 $(INSTALL_DIR) $(1)/usr/sbin
157 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
158 endef
159
160 define Package/badblocks/install
161 $(INSTALL_DIR) $(1)/usr/sbin
162 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
163 endef
164
165 $(eval $(call BuildPackage,e2fsprogs))
166 $(eval $(call BuildPackage,libuuid))
167 $(eval $(call BuildPackage,uuidgen))
168 $(eval $(call BuildPackage,libblkid))
169 $(eval $(call BuildPackage,tune2fs))
170 $(eval $(call BuildPackage,resize2fs))
171 $(eval $(call BuildPackage,badblocks))