- $$(IPKG_$(1)): $(STAGING_DIR)/etc/opkg.conf $(STAMP_BUILT)
- @rm -f $(PACKAGE_DIR)/$(1)_*
- rm -rf $$(IDIR_$(1))
- mkdir -p $$(IDIR_$(1))/CONTROL
- echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
- echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
- ( \
- DEPENDS='$(EXTRA_DEPENDS)'; \
- for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \
- DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
- done; \
- echo "Depends: $$$$DEPENDS"; \
- echo "Provides: $(PROVIDES)"; \
- echo "Source: $(SOURCE)"; \
- echo "Section: $(SECTION)"; \
- echo "Priority: $(PRIORITY)"; \
- echo "Maintainer: $(MAINTAINER)"; \
- echo "Architecture: $(PKGARCH)"; \
- echo "Installed-Size: 1"; \
- echo -n "Description: "; getvar $(call shvar,Package/$(1)/description) | sed -e 's,^[[:space:]]*, ,g'; \
- ) >> $$(IDIR_$(1))/CONTROL/control
- chmod 644 $$(IDIR_$(1))/CONTROL/control
+ $(PKG_INFO_DIR)/$(1).version: $$(IPKG_$(1))
+ echo '$(ABI_VERSION)' | cmp -s - $$@ || \
+ echo '$(ABI_VERSION)' > $$@
+
+ Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
+ ifneq ($$(EXTRA_DEPENDS),)
+ Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
+ endif
+
+$(_define) Package/$(1)/CONTROL
+Package: $(1)
+Version: $(VERSION)
+$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
+)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
+)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
+)$$(call addfield,Source,$(SOURCE)
+)$$(call addfield,License,$$(PKG_LICENSE)
+)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES)
+)$$(call addfield,Section,$(SECTION)
+)$$(call addfield,Require-User,$(USERID)
+)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
+)$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
+)$(if $(MAINTAINER),Maintainer: $(MAINTAINER)
+)Architecture: $(PKGARCH)
+Installed-Size: 0
+$(_endef)
+
+ $(PKG_INFO_DIR)/$(1).provides: $$(IPKG_$(1))
+ $$(IPKG_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
+ $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
+ $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
+ @rm -rf $$(PDIR_$(1))/$(1)_* $$(IDIR_$(1))
+ 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\* -or -name \*.ko | awk -F/ '{ print $$$$NF }'; \
+ for file in $$(patsubst %,$(PKG_INFO_DIR)/%.provides,$$(IDEPEND_$(1))); do \
+ if [ -f "$$$$file" ]; then \
+ cat $$$$file; \
+ fi; \
+ done; $(Package/$(1)/extra_provides) \
+ ) | sort -u > $(PKG_INFO_DIR)/$(1).provides
+ $(if $(PROVIDES),@for pkg in $(PROVIDES); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
+ $(CheckDependencies)
+
+ $(RSTRIP) $$(IDIR_$(1))