- touch $@
-
-$(IPKG_LIBFUSE):
- mkdir -p $(IDIR_LIBFUSE)/usr/lib
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(IDIR_LIBFUSE)/usr/lib/
- $(RSTRIP) $(IDIR_LIBFUSE)
- $(IPKG_BUILD) $(IDIR_LIBFUSE) $(PACKAGE_DIR)
-
-$(IPKG_FUSE_UTILS):
- mkdir -p $(IDIR_FUSE_UTILS)/usr/bin
- cp -fpR $(PKG_INSTALL_DIR)/usr/bin/fusermount $(IDIR_FUSE_UTILS)/usr/bin/
- $(RSTRIP) $(IDIR_FUSE_UTILS)
- $(IPKG_BUILD) $(IDIR_FUSE_UTILS) $(PACKAGE_DIR)
-
-$(STAGING_DIR)/usr/lib/libfuse.so: $(PKG_BUILD_DIR)/.built
- mkdir -p $(STAGING_DIR)/usr/include
- cp -fpR $(PKG_INSTALL_DIR)/usr/include/fuse $(STAGING_DIR)/usr/include/
- cp -fpR $(PKG_INSTALL_DIR)/usr/include/fuse.h $(STAGING_DIR)/usr/include/
- mkdir -p $(STAGING_DIR)/usr/lib
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.a $(STAGING_DIR)/usr/lib/
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.so* $(STAGING_DIR)/usr/lib/
- mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(STAGING_DIR)/usr/lib/pkgconfig/
- $(SED) 's,-I$${includedir}/fuse,,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
- $(SED) 's,-L$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
-
-install-dev: $(STAGING_DIR)/usr/lib/libfuse.so
-
-uninstall-dev:
- rm -rf \
- $(STAGING_DIR)/usr/include/fuse \
- $(STAGING_DIR)/usr/include/fuse.h \
- $(STAGING_DIR)/usr/lib/libfuse.a \
- $(STAGING_DIR)/usr/lib/libfuse.so* \
- $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc \
-
-compile-targets: install-dev
-clean-targets: uninstall-dev
+endef
+
+define Build/InstallDev
+ mkdir -p $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/fuse{,.h} $(1)/usr/include/
+ mkdir -p $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(1)/usr/lib/
+ mkdir -p $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(1)/usr/lib/pkgconfig/
+ $(SED) 's,-I$$$${includedir}/fuse,,g' $(1)/usr/lib/pkgconfig/fuse.pc
+ $(SED) 's,-L$$$${libdir},,g' $(1)/usr/lib/pkgconfig/fuse.pc
+endef
+
+define Package/fuse-utils/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fusermount $(1)/usr/bin/
+endef
+
+define Package/libfuse/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fuse-utils))
+$(eval $(call BuildPackage,libfuse))
+$(eval $(call KernelPackage,fuse))