Browse Source

xz: import from old packages feed

 - update to latest version (v5.2.1)
 - add license info
 - add myself as maintainer
 - put everything in a "Compression" submenu
 - reduce the number of packages (put symlinks with their matching target)

Signed-off-by: Nicolas Thill <nico@openwrt.org>
Nicolas Thill 9 years ago
parent
commit
b9e87eeb7d
1 changed files with 112 additions and 0 deletions
  1. 112
    0
      utils/xz/Makefile

+ 112
- 0
utils/xz/Makefile View File

@@ -0,0 +1,112 @@
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:=1
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/liblzma/install
98
+	$(INSTALL_DIR) $(1)/usr/lib
99
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
100
+endef
101
+
102
+
103
+$(eval $(call BuildPackage,xz-utils))
104
+$(eval $(call BuildPackage,liblzma))
105
+$(eval $(call BuildSubPackage,lzmadec, +liblzma,))
106
+$(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
107
+$(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
108
+$(eval $(call BuildSubPackage,xzdec, +liblzma,))
109
+$(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
110
+$(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
111
+$(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
112
+$(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))