- touch $@
- touch $@
-
-$(IPKG_E2FSPROGS):
- mkdir -p $(IDIR_E2FSPROGS)/sbin
- $(CP) $(PKG_INSTALL_DIR)/sbin/e2fsck $(IDIR_E2FSPROGS)/sbin/
- $(CP) $(PKG_INSTALL_DIR)/sbin/mke2fs $(IDIR_E2FSPROGS)/sbin/
- $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ext{2,3} $(IDIR_E2FSPROGS)/sbin/
- $(CP) $(PKG_INSTALL_DIR)/sbin/tune2fs $(IDIR_E2FSPROGS)/sbin/
- mkdir -p $(IDIR_E2FSPROGS)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{blkid,com_err,e2p,ext2fs,uuid}.so.* $(IDIR_E2FSPROGS)/usr/lib/
- $(RSTRIP) $(IDIR_E2FSPROGS)
- $(IPKG_BUILD) $(IDIR_E2FSPROGS) $(PACKAGE_DIR)
+endef
+
+define Build/InstallDev
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ BUILDCC="$(HOSTCC)" \
+ DESTDIR="$(1)" \
+ install-libs
+ $(MAKE) -C $(PKG_BUILD_DIR)/lib/ext2fs \
+ BUILDCC="$(HOSTCC)" \
+ DESTDIR="$(1)" \
+ install
+endef
+
+define Package/e2fsprogs/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
+ ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
+ ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
+ ln -sf mke2fs $(1)/usr/sbin/mkfs.ext4
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(foreach lib,com_err e2p,$(PKG_INSTALL_DIR)/usr/lib/lib$(lib).so.*) $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_DIR) $(1)/lib/functions/fsck
+ $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
+ $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
+endef
+
+define Package/libuuid/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuuid.so.* $(1)/usr/lib/
+endef
+
+define Package/uuidgen/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uuidgen $(1)/usr/bin/
+endef
+
+define Package/libblkid/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libblkid.so.* $(1)/usr/lib/
+endef
+
+define Package/libext2fs/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* $(1)/usr/lib/
+endef
+
+define Package/tune2fs/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
+endef
+
+define Package/resize2fs/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
+endef
+
+define Package/badblocks/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
+endef
+
+define Package/blkid/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blkid $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,e2fsprogs))
+$(eval $(call BuildPackage,libuuid))
+$(eval $(call BuildPackage,uuidgen))
+$(eval $(call BuildPackage,libblkid))
+$(eval $(call BuildPackage,libext2fs))
+$(eval $(call BuildPackage,tune2fs))
+$(eval $(call BuildPackage,resize2fs))
+$(eval $(call BuildPackage,badblocks))
+$(eval $(call BuildPackage,blkid))