Merge pull request #2009 from roger-/micropython-new
[feed/packages.git] / utils / xz / Makefile
1 #
2 # Copyright (C) 2013-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=xz
11 PKG_VERSION:=5.2.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://tukaani.org/xz \
16 http://fossies.org/linux/misc
17 PKG_MD5SUM:=f90c9a0c8b259aee2234c4e0d7fd70af
18
19 PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
20 PKG_LICENSE_FILES:=COPYING
21 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/xz/Default
29 SUBMENU:=Compression
30 SECTION:=utils
31 CATEGORY:=Utilities
32 URL:=http://tukaani.org/xz
33 endef
34
35 define Package/xz-utils
36 $(call Package/xz/Default)
37 TITLE:=XZ Utils (meta)
38 MENU:=1
39 endef
40
41 define Package/liblzma
42 $(call Package/xz/Default)
43 SECTION:=libs
44 CATEGORY:=Libraries
45 DEPENDS:=+libpthread
46 TITLE:=liblzma library from XZ Utils
47 endef
48
49 # $(1): package name & command in /usr/bin/
50 # $(2): package dependencies
51 # $(3): symbolic links to $(1) in /usr/bin/
52 define BuildSubPackage
53
54 define Package/$(1)
55 $(call Package/xz/Default)
56 DEPENDS:=xz-utils $(2)
57 TITLE:=$(1) utility from XZ Utils
58 endef
59
60 define Package/$(1)/description
61 Contains: $(1) $(3)
62 endef
63
64 define Package/$(1)/install
65 $(INSTALL_DIR) $$(1)/usr/bin
66 $(CP) $(foreach f,$(1) $(3),$(PKG_INSTALL_DIR)/usr/bin/$(f)) $$(1)/usr/bin/
67 endef
68
69 $$(eval $$(call BuildPackage,$(1)))
70 endef
71
72
73 CONFIGURE_ARGS += \
74 --enable-small \
75 --enable-assume-ram=4 \
76 --disable-assembler \
77 --disable-werror \
78
79 # API uses "restrict" keyword introduced in C99 standard
80 TARGET_CFLAGS += \
81 -std=c99 \
82
83 define Build/InstallDev
84 $(INSTALL_DIR) $(1)/usr/include
85 $(CP) \
86 $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
87 $(1)/usr/include/
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) \
90 $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
91 $(1)/usr/lib/
92 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
93 $(CP) \
94 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
95 $(1)/usr/lib/pkgconfig/
96 endef
97
98 define Package/xz-utils/install
99 true
100 endef
101
102 define Package/liblzma/install
103 $(INSTALL_DIR) $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
105 endef
106
107
108 $(eval $(call BuildPackage,xz-utils))
109 $(eval $(call BuildPackage,liblzma))
110 $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
111 $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
112 $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
113 $(eval $(call BuildSubPackage,xzdec, +liblzma,))
114 $(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
115 $(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
116 $(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
117 $(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))