treewide: fix licence typos
[feed/packages.git] / utils / xxhash / Makefile
1 #
2 # Copyright (C) 2022 Julien Malik <julien.malik@paraiso.me>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # initial implementation kindly stolen from (and then updated) :
9 # https://forum.openwrt.org/t/xxhash-makefile/118426
10
11 include $(TOPDIR)/rules.mk
12
13 PKG_NAME:=xxhash
14 PKG_VERSION:=0.8.1
15 PKG_RELEASE:=2
16
17 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://github.com/Cyan4973/xxHash/archive/v$(PKG_VERSION)
19 PKG_HASH:=3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c
20
21 # The source for the library (xxhash.c and xxhash.h) is BSD
22 # The source for the command line tool (xxhsum.c) is GPLv2+
23 PKG_LICENSE:=BSD-2-Clause GPL-2.0-or-later
24 PKG_LICENSE_FILES:=LICENSE cli/COPYING
25 PKG_MAINTAINER:=Julien Malik <julien.malik@paraiso.me>
26
27 PKG_INSTALL:=1
28
29 include $(INCLUDE_DIR)/package.mk
30
31 PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
32
33 define Package/xxhash/Default
34 TITLE:=Extremely fast hash algorithm
35 URL:=https://cyan4973.github.io/xxHash/
36 endef
37
38 define Package/xxhash/Default/description
39 xxHash is an Extremely fast Hash algorithm, running at RAM speed
40 limits. It successfully completes the SMHasher test suite which
41 evaluates collision, dispersion and randomness qualities of hash
42 functions. Code is highly portable, and hashes are identical on all
43 platforms (little / big endian).
44 endef
45
46 define Package/libxxhash
47 $(call Package/xxhash/Default)
48 SECTION:=libs
49 CATEGORY:=Libraries
50 endef
51
52 define Package/libxxhash/description
53 $(call Package/xxhash/Default/description)
54
55 This package contains the shared library.
56 endef
57
58 define Package/xxhash
59 $(call Package/xxhash/Default)
60 SECTION:=utils
61 CATEGORY:=Utilities
62 DEPENDS:= +libxxhash
63 endef
64
65 define Package/xxhash/description
66 $(call Package/xxhash/Default/description)
67
68 This package contains the executables.
69 endef
70
71 MAKE_FLAGS += PREFIX=/usr
72
73 define Build/InstallDev
74 $(INSTALL_DIR) $(1)/usr/include
75 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxxhash.{a,so*} $(1)/usr/lib/
78 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxxhash.pc $(1)/usr/lib/pkgconfig/
80 endef
81
82 define Package/libxxhash/install
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxxhash.so.* $(1)/usr/lib/
85 endef
86
87 define Package/xxhash/install
88 $(INSTALL_DIR) $(1)/usr/bin
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xxh*sum $(1)/usr/bin/
90 endef
91
92 $(eval $(call BuildPackage,libxxhash))
93 $(eval $(call BuildPackage,xxhash))