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