Browse Source

unrar: split unrar and libunrar into build variants, add missing InstallDev

Building unrar together with libunrar creates conflicts that can be fixed by
doing separate builds.
Closes https://github.com/openwrt/packages/pull/2060.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
lilik-openwrt-22.03
Álvaro Fernández Rojas 9 years ago
parent
commit
082314c49d
2 changed files with 35 additions and 4 deletions
  1. +26
    -4
      utils/unrar/Makefile
  2. +9
    -0
      utils/unrar/patches/100-makefile_fixes.patch

+ 26
- 4
utils/unrar/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=unrar
PKG_VERSION:=5.3.7
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rarlab.com/rar
@ -19,7 +19,7 @@ PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=UnRAR
PKG_LICENSE_FILES:=license.txt
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/unrar
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/unrar
PKG_INSTALL:=1
include $(INCLUDE_DIR)/uclibc++.mk
@ -37,6 +37,7 @@ $(call Package/unrar/Default)
SECTION:=utils
CATEGORY:=Utilities
TITLE+= (application)
VARIANT:=bin
endef
define Package/libunrar
@ -44,6 +45,7 @@ $(call Package/unrar/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE+= (library)
VARIANT:=lib
endef
define Package/unrar/description
@ -56,11 +58,31 @@ define Package/libunrar/description
archives
endef
ifeq ($(BUILD_VARIANT),lib)
define Build/Compile
$(call Build/Compile/Default,unrar)
$(call Build/Compile/Default,lib)
endef
define Build/Install
$(call Build/Install/Default,install-lib)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/unrar
$(CP) $(PKG_BUILD_DIR)/*.hpp $(1)/usr/include/unrar/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libunrar.so $(1)/usr/lib/
endef
else
define Build/Compile
$(call Build/Compile/Default,unrar)
endef
define Build/Install
$(call Build/Install/Default,install-unrar)
endef
endif
define Package/unrar/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/unrar $(1)/usr/bin/
@ -68,7 +90,7 @@ endef
define Package/libunrar/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libunrar.so $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libunrar.so $(1)/usr/lib/
endef
$(eval $(call BuildPackage,unrar))


+ 9
- 0
utils/unrar/patches/100-makefile_fixes.patch View File

@ -16,3 +16,12 @@
DESTDIR=/usr
# Linux using LCC
@@ -142,7 +142,7 @@ uninstall-unrar:
rm -f $(DESTDIR)/bin/unrar
install-lib:
- install libunrar.so $(DESTDIR)/lib
+ install -D libunrar.so $(DESTDIR)/lib/libunrar.so
uninstall-lib:
rm -f $(DESTDIR)/lib/libunrar.so

Loading…
Cancel
Save