summaryrefslogtreecommitdiffstats
path: root/include/package-ipkg.mk
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-01-17 17:31:09 +0100
committerJo-Philipp Wich <jo@mein.io>2019-01-19 14:32:12 +0100
commite6bcf1e4acc4901c1803cdccc4b9fabfd6d84c90 (patch)
treef7b66277175ff0ae6baf093db66ca929dfb2b225 /include/package-ipkg.mk
parente3d5b384aa67c5562d59e8745fc6c48a9f2a997d (diff)
downloadopenwrt-e6bcf1e4acc4901c1803cdccc4b9fabfd6d84c90.tar.gz
openwrt-e6bcf1e4acc4901c1803cdccc4b9fabfd6d84c90.tar.bz2
openwrt-e6bcf1e4acc4901c1803cdccc4b9fabfd6d84c90.zip
build: add ABI_VERSION to binary package names
Add the ABI_VERSION source makefile variable to the binary package basename and resolve source dependencies on packages with ABI_VERSION set to such expanded names. If for example a package specifies DEPENDS:=libopenssl while the OpenSSL Makefile specifies ABI_VERSION:=1.0.0, the resulting ipk control data dependency will be "Depends: libopenssl1.0.0" and the libopenssl ipk file will be called "libopenssl1.0.0_<version>_<arch>.ipk". The next time a library such as OpenSSL is updated to an incompatible version, the ABI_VERSION shall be changed accordingly to prevent opkg from simply upgrading to an incompatible library without considering the dependencies of already installed packages. Also introduce another "SourceName" control field which is required by the newly introduced "scritps/ipkg-remove" to determine the proper related .ipk files to delete upon buildroot package clean operations. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'include/package-ipkg.mk')
-rw-r--r--include/package-ipkg.mk17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index c374faa647..200a5cf4eb 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -13,6 +13,9 @@ endif
IPKG_BUILD:= \
$(SCRIPT_DIR)/ipkg-build -c -o 0 -g 0
+IPKG_REMOVE:= \
+ $(SCRIPT_DIR)/ipkg-remove
+
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
# 1: package name
@@ -90,8 +93,9 @@ _endef=endef
ifeq ($(DUMP),)
define BuildTarget/ipkg
+ ABIV_$(1):=$(call GetABISuffix,$(1))
PDIR_$(1):=$(call FeedPackageDir,$(1))
- IPKG_$(1):=$$(PDIR_$(1))/$(1)_$(VERSION)_$(PKGARCH).ipk
+ IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
@@ -148,19 +152,20 @@ ifeq ($(DUMP),)
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
touch $$@
- Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
+ Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
ifneq ($$(EXTRA_DEPENDS),)
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
endif
$(_define) Package/$(1)/CONTROL
-Package: $(1)
+Package: $(1)$$(ABIV_$(1))
Version: $(VERSION)
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
-)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
+)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)$$(if $$(ABIV_$(1)), $(1)))
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
)$$(call addfield,Source,$(SOURCE)
+)$$(call addfield,SourceName,$(1)
)$$(call addfield,License,$(LICENSE)
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
)$$(call addfield,Section,$(SECTION)
@@ -176,7 +181,7 @@ $(_endef)
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
- @rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
+ @rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
$(call Package/$(1)/install,$$(IDIR_$(1)))
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
@@ -235,7 +240,7 @@ $(_endef)
@[ -f $$(IPKG_$(1)) ]
$(1)-clean:
- $$(if $$(call opkg_package_files,$(1)),rm -f $$(call opkg_package_files,$(1)))
+ $$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
clean: $(1)-clean