libgd: avoid recursive and redundant dependencies
[feed/packages.git] / utils / xz / Makefile
1 #
2 # Copyright (C) 2013-2015 OpenWrt.org
3 # Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=xz
12 PKG_VERSION:=5.2.5
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_URL:=@SF/lzmautils
17 PKG_HASH:=3e1e518ffc912f86608a8cb35e4bd41ad1aec210df2a47aaa1f95e7f5576ef56
18
19 PKG_MAINTAINER:=
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
23
24 PKG_BUILD_PARALLEL:=1
25 PKG_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/xz/Default
30 SUBMENU:=Compression
31 SECTION:=utils
32 CATEGORY:=Utilities
33 URL:=https://tukaani.org/xz
34 endef
35
36 define Package/xz-utils
37 $(call Package/xz/Default)
38 TITLE:=XZ Utils (meta)
39 MENU:=1
40 endef
41
42 define Package/liblzma
43 $(call Package/xz/Default)
44 SECTION:=libs
45 CATEGORY:=Libraries
46 DEPENDS:=+libpthread
47 TITLE:=liblzma library from XZ Utils
48 endef
49
50 # $(1): package name & command in /usr/bin/
51 # $(2): package dependencies
52 # $(3): symbolic links to $(1) in /usr/bin/
53 define BuildSubPackage
54
55 define Package/$(1)
56 $(call Package/xz/Default)
57 DEPENDS:=xz-utils $(2)
58 TITLE:=$(1) utility from XZ Utils
59 $(if $(3),ALTERNATIVES:=$(foreach f,$(1) $(3),300:/usr/bin/$(f):/usr/libexec/$(1)-lzmautils))
60 endef
61
62 define Package/$(1)/description
63 Contains: $(1) $(3)
64 endef
65
66 define Package/$(1)/install
67 $(INSTALL_DIR) $$(1)$(if $(3),/usr/libexec,/usr/bin)
68 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)$(if $(3),/usr/libexec/$(1)-lzmautils,/usr/bin/$(1))
69 endef
70
71 $$(eval $$(call BuildPackage,$(1)))
72 endef
73
74 TARGET_LDFLAGS += -Wl,--gc-sections -flto
75
76 CONFIGURE_ARGS += \
77 --enable-small \
78 --enable-assume-ram=4 \
79 --disable-assembler \
80 --disable-debug \
81 --disable-doc \
82 --disable-rpath \
83 --disable-symbol-versions \
84 --disable-werror \
85 --with-pic
86
87 CONFIGURE_VARS += \
88 gl_cv_posix_shell=/bin/sh
89
90 define Build/InstallDev
91 $(INSTALL_DIR) $(1)/usr/include
92 $(CP) \
93 $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
94 $(1)/usr/include/
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) \
97 $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
98 $(1)/usr/lib/
99 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
100 $(CP) \
101 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
102 $(1)/usr/lib/pkgconfig/
103 endef
104
105 define Package/xz-utils/install
106 true
107 endef
108
109 define Package/liblzma/install
110 $(INSTALL_DIR) $(1)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
112 endef
113
114
115 $(eval $(call BuildPackage,xz-utils))
116 $(eval $(call BuildPackage,liblzma))
117 $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
118 $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
119 $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
120 $(eval $(call BuildSubPackage,xzdec, +liblzma,))
121 $(eval $(call BuildSubPackage,xzdiff, +xz, lzcmp lzdiff xzcmp))
122 $(eval $(call BuildSubPackage,xzgrep, +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
123 $(eval $(call BuildSubPackage,xzless, +xz, lzless))
124 $(eval $(call BuildSubPackage,xzmore, +xz, lzmore))