2 # Copyright (C) 2013-2015 OpenWrt.org
3 # Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=@SF
/lzmautils
17 PKG_HASH
:=e12aa03cbd200597bd4ce11d97be2d09a6e6d39a9311ce72c91ac7deacde3171
20 PKG_LICENSE
:=Public-Domain LGPL-2.1
-or-later GPL-2.0
-or-later GPL-3.0
-or-later
21 PKG_LICENSE_FILES
:=COPYING
22 PKG_CPE_ID
:=cpe
:/a
:tukaani
:xz
28 include $(INCLUDE_DIR
)/package.mk
30 define Package
/xz
/Default
34 URL
:=https
://tukaani.org
/xz
37 define Package
/xz-utils
38 $(call Package
/xz
/Default
)
39 TITLE
:=XZ Utils
(meta
)
43 define Package
/liblzma
44 $(call Package
/xz
/Default
)
48 TITLE
:=liblzma library from XZ Utils
51 # $(1): package name & command in /usr/bin/
52 # $(2): package dependencies
53 # $(3): symbolic links to $(1) in /usr/bin/
54 define BuildSubPackage
57 $(call Package
/xz
/Default
)
58 DEPENDS
:=xz-utils
$(2)
59 TITLE
:=$(1) utility from XZ Utils
60 $(if
$(3),ALTERNATIVES
:=$(foreach f
,$(1) $(3),300:/usr
/bin
/$(f
):/usr
/libexec
/$(1)-lzmautils
))
63 define Package
/$(1)/description
67 define Package
/$(1)/install
68 $(INSTALL_DIR
) $$(1)$(if
$(3),/usr
/libexec
,/usr
/bin
)
69 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(1) $$(1)$(if
$(3),/usr
/libexec
/$(1)-lzmautils
,/usr
/bin
/$(1))
72 $$(eval
$$(call BuildPackage
,$(1)))
75 TARGET_LDFLAGS
+= -Wl
,--gc-sections
79 --enable-assume-ram
=4 \
84 --disable-symbol-versions \
89 gl_cv_posix_shell
=/bin
/sh
91 define Build
/InstallDev
92 $(INSTALL_DIR
) $(1)/usr
/include
94 $(PKG_INSTALL_DIR
)/usr
/include/lzma
{,.h
} \
96 $(INSTALL_DIR
) $(1)/usr
/lib
98 $(PKG_INSTALL_DIR
)/usr
/lib
/liblzma.
{a
,so
*} \
100 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
102 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/liblzma.
pc \
103 $(1)/usr
/lib
/pkgconfig
/
106 define Package
/xz-utils
/install
110 define Package
/liblzma
/install
111 $(INSTALL_DIR
) $(1)/usr
/lib
112 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblzma.so.
* $(1)/usr
/lib
/
116 $(eval
$(call BuildPackage
,xz-utils
))
117 $(eval
$(call BuildPackage
,liblzma
))
118 $(eval
$(call BuildSubPackage
,lzmadec
, +liblzma
,))
119 $(eval
$(call BuildSubPackage
,lzmainfo
, +liblzma
,))
120 $(eval
$(call BuildSubPackage
,xz
, +liblzma
, lzcat lzma unlzma unxz xzcat
))
121 $(eval
$(call BuildSubPackage
,xzdec
, +liblzma
,))
122 $(eval
$(call BuildSubPackage
,xzdiff
, +xz
, lzcmp lzdiff xzcmp
))
123 $(eval
$(call BuildSubPackage
,xzgrep
, +xz
, lzegrep lzfgrep lzgrep xzegrep xzfgrep
))
124 $(eval
$(call BuildSubPackage
,xzless
, +xz
, lzless
))
125 $(eval
$(call BuildSubPackage
,xzmore
, +xz
, lzmore
))