e2fsprogs: change the so-version of libcom_err to prevent conflicts, move it into...
[openwrt/svn-archive/archive.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 include $(INCLUDE_DIR)/package.mk
22
23 define Package/e2fsprogs/Default
24 URL:=http://e2fsprogs.sourceforge.net/
25 SUBMENU:=Filesystem
26 endef
27
28 define Package/e2fsprogs
29 $(call Package/e2fsprogs/Default)
30 SECTION:=utils
31 CATEGORY:=Utilities
32 TITLE:=Ext2/3/4 filesystem utilities
33 DEPENDS:=+libuuid +libext2fs
34 endef
35
36 define Package/e2fsprogs/description
37 This package contains essential ext2 filesystem utilities which consists of
38 e2fsck, mke2fs, tune2fs, and most of the other core ext2
39 filesystem utilities.
40 endef
41
42 define Package/libext2fs
43 $(call Package/e2fsprogs/Default)
44 SECTION:=libs
45 CATEGORY:=Libraries
46 TITLE:=ext2/3/4 filesystem library
47 endef
48
49 define Package/libext2fs/description
50 libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
51 endef
52
53 define Package/tune2fs
54 $(call Package/e2fsprogs)
55 TITLE:=Ext2 Filesystem tune utility
56 DEPENDS:= +e2fsprogs
57 endef
58
59 define Package/resize2fs
60 $(call Package/e2fsprogs)
61 TITLE:=Ext2 Filesystem resize utility
62 DEPENDS:= +e2fsprogs
63 endef
64
65 define Package/badblocks
66 $(call Package/e2fsprogs)
67 TITLE:=Ext2 Filesystem badblocks utility
68 DEPENDS:= +e2fsprogs
69 endef
70
71 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
72
73 CONFIGURE_VARS += \
74 ac_cv_lib_pthread_sem_init=no
75
76 CONFIGURE_ARGS += \
77 --disable-testio-debug \
78 --enable-elf-shlibs \
79 --disable-libuuid \
80 --enable-libblkid \
81 --disable-uuidd \
82 --disable-tls \
83 --disable-nls \
84 --disable-rpath
85
86 define Build/Prepare
87 $(call Build/Prepare/Default)
88 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
89 endef
90
91 define Build/Compile
92 $(MAKE) -C $(PKG_BUILD_DIR)/util \
93 BUILDCC="$(HOSTCC)" \
94 CFLAGS="" \
95 CPPFLAGS="" \
96 LDFLAGS="" \
97 subst
98 $(MAKE) -C $(PKG_BUILD_DIR) \
99 LDFLAGS=-Wl,--gc-sections \
100 BUILDCC="$(HOSTCC)" \
101 DESTDIR="$(PKG_INSTALL_DIR)" \
102 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
103 all
104 endef
105
106 define Package/e2fsprogs/install
107 $(INSTALL_DIR) $(1)/usr/sbin
108 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
109 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
110 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
111 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
112 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext4
113 $(INSTALL_DIR) $(1)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
115 $(INSTALL_DIR) $(1)/etc/init.d
116 $(INSTALL_DIR) $(1)/lib/functions/fsck
117 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
118 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
119 endef
120
121 define Package/libcom_err/install
122 endef
123
124 define Package/libext2fs/install
125 $(INSTALL_DIR) $(1)/usr/lib
126 $(CP) \
127 $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
128 $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
129 $(1)/usr/lib/
130 endef
131
132 define Package/libext2fs/install_lib
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
135 endef
136
137 define Package/tune2fs/install
138 $(INSTALL_DIR) $(1)/usr/sbin
139 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
140 endef
141
142 define Package/resize2fs/install
143 $(INSTALL_DIR) $(1)/usr/sbin
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
145 endef
146
147 define Package/badblocks/install
148 $(INSTALL_DIR) $(1)/usr/sbin
149 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
150 endef
151
152 $(eval $(call BuildPackage,e2fsprogs))
153 $(eval $(call BuildPackage,libext2fs))
154 $(eval $(call BuildPackage,tune2fs))
155 $(eval $(call BuildPackage,resize2fs))
156 $(eval $(call BuildPackage,badblocks))