Merge pull request #3766 from thess/ffmpeg3-update
[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.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/lzmautils \
17 http://tukaani.org/xz
18 PKG_MD5SUM:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
19
20 PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
21 PKG_LICENSE_FILES:=COPYING
22 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
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:=http://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 endef
60
61 define Package/$(1)/description
62 Contains: $(1) $(3)
63 endef
64
65 define Package/$(1)/install
66 $(INSTALL_DIR) $$(1)/usr/bin
67 $(CP) $(foreach f,$(1) $(3),$(PKG_INSTALL_DIR)/usr/bin/$(f)) $$(1)/usr/bin/
68 endef
69
70 $$(eval $$(call BuildPackage,$(1)))
71 endef
72
73
74 CONFIGURE_ARGS += \
75 --enable-small \
76 --enable-assume-ram=4 \
77 --disable-assembler \
78 --disable-werror \
79
80 # API uses "restrict" keyword introduced in C99 standard
81 TARGET_CFLAGS += \
82 -std=c99 \
83
84 define Build/InstallDev
85 $(INSTALL_DIR) $(1)/usr/include
86 $(CP) \
87 $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
88 $(1)/usr/include/
89 $(INSTALL_DIR) $(1)/usr/lib
90 $(CP) \
91 $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
92 $(1)/usr/lib/
93 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
94 $(CP) \
95 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
96 $(1)/usr/lib/pkgconfig/
97 endef
98
99 define Package/xz-utils/install
100 true
101 endef
102
103 define Package/liblzma/install
104 $(INSTALL_DIR) $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
106 endef
107
108
109 $(eval $(call BuildPackage,xz-utils))
110 $(eval $(call BuildPackage,liblzma))
111 $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
112 $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
113 $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
114 $(eval $(call BuildSubPackage,xzdec, +liblzma,))
115 $(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
116 $(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
117 $(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
118 $(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))