improve dependency handling, fix some package makefile bugs
[openwrt-10.03/.git] / package / rules.mk
index 55066610d012b2f661441197027a7566b78ded97..d436df8dcee01f4aa6f0bdc95afa5e318c0d38f6 100644 (file)
@@ -132,7 +132,14 @@ define BuildPackage
        mkdir -p $$(IDIR_$(1))/CONTROL
        echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
        echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Depends: $$(IDEPEND_$(1))" >> $$(IDIR_$(1))/CONTROL/control
+       ( \
+               DEPENDS=; \
+               for depend in $$(IDEPEND_$(1)); do \
+                       [ "$$$${depend%%%%%%%%[A-Za-z]*}" = "@" ] && continue; \
+                       DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
+               done; \
+               echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
+       )
        echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
        echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
        echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control