- touch $@
-
-$(IPKG_KMOD_FUSE):
- mkdir -p $(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)
- cp -fpR $(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.o \
- $(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)/
- $(IPKG_BUILD) $(IDIR_KMOD_FUSE) $(PACKAGE_DIR)
-
-$(IPKG_LIBFUSE):
- mkdir -p $(IDIR_LIBFUSE)/usr/lib
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(IDIR_LIBFUSE)/usr/lib/
- chmod 0644 $(IDIR_LIBFUSE)/usr/lib/lib*.so*
- $(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/
- mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(STAGING_DIR)/usr/lib/
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(STAGING_DIR)/usr/lib/pkgconfig/
-
-install-dev: $(STAGING_DIR)/usr/lib/libfuse.so
-
-uninstall-dev:
- rm -rf $(STAGING_DIR)/usr/include/fuse*
- rm -rf $(STAGING_DIR)/usr/lib/libfuse.{a,so*}
- rm -rf $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
-
-install: install-dev
-clean: 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))