aboutsummaryrefslogtreecommitdiffstats
path: root/tools/7z
diff options
context:
space:
mode:
authorJan Hoffmann <jan@3e8.eu>2022-07-23 22:53:18 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-07-28 14:08:56 +0200
commit5fcc6f0f19422c952db8bc4d72f324ead21232c6 (patch)
treeef6c7197c70e8c5c6847af25ff282da71f322527 /tools/7z
parent3b1261224aa0313ab8c155d3a4679e598a04d9a6 (diff)
downloadupstream-5fcc6f0f19422c952db8bc4d72f324ead21232c6.tar.gz
upstream-5fcc6f0f19422c952db8bc4d72f324ead21232c6.tar.bz2
upstream-5fcc6f0f19422c952db8bc4d72f324ead21232c6.zip
tools: add 7z host package
Add the 7zr command line tool, which is a version of the 7z application that only supports 7z archives. 7z is one of the two compression formats supported in H3C firmware images (the alternative would be ARJ). (Alternatively, the 7zr command line tool could also be built from a current version of the public-domain LZMA SDK. That would require repackaging the source package, as it is only provided in 7z format.) Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Diffstat (limited to 'tools/7z')
-rw-r--r--tools/7z/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/7z/Makefile b/tools/7z/Makefile
new file mode 100644
index 0000000000..c94d746c64
--- /dev/null
+++ b/tools/7z/Makefile
@@ -0,0 +1,36 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=7z
+PKG_VERSION:=22.00
+PKG_SOURCE_VERSION:=2200
+
+PKG_SOURCE:=$(PKG_NAME)$(PKG_SOURCE_VERSION)-src.tar.xz
+PKG_SOURCE_URL:=https://7-zip.org/a/
+PKG_HASH:=40969f601e86aff49aaa0ba0df5ce6fd397cf7e2683a84b591b0081e461ef675
+
+# This builds the 7zr variant which supports only 7z, so no non-LGPL code should be included
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=DOC/License.txt DOC/copying.txt
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
+
+ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Bundles/Alone7z
+
+define Host/Compile
+ $(MAKE) -C $(ALONE_DIR) -f makefile.gcc
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+ $(INSTALL_BIN) $(ALONE_DIR)/_o/7zr $(STAGING_DIR_HOST)/bin/7zr
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/7zr
+endef
+
+$(eval $(call HostBuild))