strip_deps=$(strip $(subst +,,$(filter-out @%,$(1))))
filter_deps=$(foreach dep,$(call strip_deps,$(1)),$(if $(findstring :,$(dep)),$(call dep_if,$(dep)),$(dep)))
+define AddDependency
+ $$(if $(1),$$(if $(2),$$(foreach pkg,$(1),$$(IPKG_$$(pkg))): $$(foreach pkg,$(2),$$(IPKG_$$(pkg)))))
+endef
+
+define FixupReverseDependencies
+ DEPS := $$(filter %:$(1),$$(IDEPEND))
+ DEPS := $$(patsubst %:$(1),%,$$(DEPS))
+ DEPS := $$(filter $$(DEPS),$$(IPKGS))
+ $(call AddDependency,$$(DEPS),$(1))
+endef
+
+define FixupDependencies
+ DEPS := $$(filter $(1):%,$$(IDEPEND))
+ DEPS := $$(patsubst $(1):%,%,$$(DEPS))
+ DEPS := $$(filter $$(DEPS),$$(IPKGS))
+ $(call AddDependency,$(1),$$(DEPS))
+endef
+
ifeq ($(DUMP),)
define BuildTarget/ipkg
IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
ifdef Package/$(1)/install
ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),)
- compile: $$(IPKG_$(1)) $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
+ IPKGS += $(1)
+ compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
ifeq ($(CONFIG_PACKAGE_$(1)),y)
install: $$(INFO_$(1))
endif
endif
+ DEPENDS:=$(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
IDEPEND_$(1):=$$(call filter_deps,$$(DEPENDS))
+ IDEPEND += $$(patsubst %,$(1):%,$$(IDEPEND_$(1)))
+ $(FixupDependencies)
+ $(FixupReverseDependencies)
$(eval $(call BuildIPKGVariable,$(1),conffiles))
$(eval $(call BuildIPKGVariable,$(1),preinst))
rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
touch $$@
- $$(IPKG_$(1)): $(STAMP_BUILT)
+ $(PKG_INFO_DIR)/$(1).provides: $$(IPKG_$(1))
+ $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
@rm -rf $(PACKAGE_DIR)/$(1)_* $$(IDIR_$(1))
- mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL
+ mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
$(call Package/$(1)/install,$$(IDIR_$(1)))
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| $(XARGS) rm -rf
+ @( \
+ find $$(IDIR_$(1)) -name lib\*.so\* | awk -F/ '{ print $$$$NF }'; \
+ for file in $$(patsubst %,$(PKG_INFO_DIR)/%.provides,$$(IDEPEND_$(1))); do \
+ if [ -f "$$$$file" ]; then \
+ cat $$$$file; \
+ fi; \
+ done; \
+ ) | sort -u > $(PKG_INFO_DIR)/$(1).provides
$(RSTRIP) $$(IDIR_$(1))
( \
echo "Package: $(1)"; \