update lighttpd server

This commit is contained in:
Martijn Scheepers
2023-01-04 09:27:26 +01:00
parent 344a1f6c44
commit 2846cc8a6b
11 changed files with 455 additions and 106 deletions

View File

@@ -208,5 +208,4 @@ CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
# CONFIG_RUNTIME_TESTING_MENU is not set
# CONFIG_ARM_UNWIND is not set
CONFIG_DEBUG_USER=y

View File

@@ -1,21 +1,28 @@
Modify the default lighttpd configuration file to have one a starting conf
From d1de409b0aeb8dffd42673444043caf01437804e Mon Sep 17 00:00:00 2001
From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Mon, 13 Dec 2021 22:07:17 +0100
Subject: [PATCH] Modify the default lighttpd configuration file to have one a
starting conf
* Changed the log path to /var/log and logs filenames
* Disable IPv6
* Do not setuid to a user that doesn't exist on the system
* Disable pdf ranges fix for Adobe Reader since it uses regex and we
don't always have pcre support
* Change the network backend to writev since linux-sendfile fails on buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Simon Dawson <spdawson@gmail.com>
[Gustavo: update for 1.4.37]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
doc/config/conf.d/access_log.conf | 2 +-
doc/config/lighttpd.conf | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff -Nura lighttpd-1.4.37.orig/doc/config/conf.d/access_log.conf lighttpd-1.4.37/doc/config/conf.d/access_log.conf
--- lighttpd-1.4.37.orig/doc/config/conf.d/access_log.conf 2015-09-01 14:38:48.684673663 -0300
+++ lighttpd-1.4.37/doc/config/conf.d/access_log.conf 2015-09-01 14:38:53.975855142 -0300
@@ -9,7 +9,7 @@
diff --git a/doc/config/conf.d/access_log.conf b/doc/config/conf.d/access_log.conf
index e685d43..92cff4f 100644
--- a/doc/config/conf.d/access_log.conf
+++ b/doc/config/conf.d/access_log.conf
@@ -9,7 +9,7 @@ server.modules += ( "mod_accesslog" )
##
## Default access log.
##
@@ -24,21 +31,22 @@ diff -Nura lighttpd-1.4.37.orig/doc/config/conf.d/access_log.conf lighttpd-1.4.3
##
## The default format produces CLF compatible output.
diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/config/lighttpd.conf
--- lighttpd-1.4.37.orig/doc/config/lighttpd.conf 2015-09-01 14:38:48.684673663 -0300
+++ lighttpd-1.4.37/doc/config/lighttpd.conf 2015-09-01 14:39:40.256442492 -0300
diff --git a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf
index 495d2a1..c3e1446 100644
--- a/doc/config/lighttpd.conf
+++ b/doc/config/lighttpd.conf
@@ -13,8 +13,8 @@
## if you add a variable here. Add the corresponding variable in the
## chroot example aswell.
## chroot example as well.
##
-var.log_root = "/var/log/lighttpd"
-var.server_root = "/srv/www"
+var.log_root = "/var/log"
+var.server_root = "/var/www"
var.state_dir = "/var/run"
var.state_dir = "/run"
var.home_dir = "/var/lib/lighttpd"
var.conf_dir = "/etc/lighttpd"
@@ -90,7 +90,7 @@
@@ -90,7 +90,7 @@ server.port = 80
##
## Use IPv6?
##
@@ -47,7 +55,7 @@ diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/con
##
## bind to a specific IP
@@ -101,8 +101,8 @@
@@ -101,8 +101,8 @@ server.use-ipv6 = "enable"
## Run as a different username/groupname.
## This requires root permissions during startup.
##
@@ -56,9 +64,9 @@ diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/con
+server.username = "www-data"
+server.groupname = "www-data"
##
## enable core files.
@@ -112,7 +112,7 @@
##
## Enable lighttpd to serve requests on sockets received from systemd
@@ -118,7 +118,7 @@ server.groupname = "lighttpd"
##
## Document root
##
@@ -67,7 +75,7 @@ diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/con
##
## The value for the "Server:" response field.
@@ -138,7 +138,7 @@
@@ -144,7 +144,7 @@ server.pid-file = state_dir + "/lighttpd.pid"
##
## Path to the error log file
##
@@ -76,25 +84,15 @@ diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/con
##
## If you want to log to syslog you have to unset the
@@ -188,7 +188,7 @@
## sendfile - is recommended for small files.
## writev - is recommended for sending many large files
@@ -192,7 +192,7 @@ include conf_dir + "/conf.d/debug.conf"
## and write(). Every modern OS provides its own syscall to help network
## servers transfer files as fast as possible
##
-server.network-backend = "sendfile"
-#server.network-backend = "sendfile"
+server.network-backend = "writev"
##
## As lighttpd is a single-threaded server, its main resource limit is
@@ -311,9 +311,9 @@
## disable range requests for pdf files
## workaround for a bug in the Acrobat Reader plugin.
##
-$HTTP["url"] =~ "\.pdf$" {
- server.range-requests = "disable"
-}
+# $HTTP["url"] =~ "\.pdf$" {
+# server.range-requests = "disable"
+# }
##
## url handling modules (rewrite, redirect)
--
2.34.1

View File

@@ -6,6 +6,7 @@ config BR2_PACKAGE_LIGHTTPD
bool "lighttpd"
depends on BR2_USE_MMU # fork()
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_XXHASH
help
lighttpd a secure, fast, compliant and very flexible
web-server which has been optimized for high-performance
@@ -16,10 +17,59 @@ config BR2_PACKAGE_LIGHTTPD
webserver-software for every server that is suffering load
problems.
http://www.lighttpd.net/
https://www.lighttpd.net/
if BR2_PACKAGE_LIGHTTPD
config BR2_PACKAGE_LIGHTTPD_BROTLI
bool "brotli support"
select BR2_PACKAGE_BROTLI
help
Enable brotli support for lighttpd mod_deflate.
config BR2_PACKAGE_LIGHTTPD_BZIP2
bool "bzip2 support"
select BR2_PACKAGE_BZIP2
help
Enable bzip2 support for lighttpd mod_deflate.
config BR2_PACKAGE_LIGHTTPD_KRB5
bool "krb5 support"
select BR2_PACKAGE_LIBKRB5
help
Enable Kerberos5 support for lighttpd mod_auth.
config BR2_PACKAGE_LIGHTTPD_LDAP
bool "ldap support"
depends on BR2_USE_WCHAR # openldap
select BR2_PACKAGE_OPENLDAP
help
Enable LDAP support for lighttpd mod_auth mod_vhostdb_ldap.
comment "ldap support needs a toolchain w/ wchar"
depends on !BR2_USE_WCHAR
config BR2_PACKAGE_LIGHTTPD_LUA
bool "lua support"
depends on BR2_PACKAGE_LUA
help
Enable Lua support. Needed to support mod_magnet
config BR2_PACKAGE_LIGHTTPD_MAXMINDDB
bool "maxminddb support"
select BR2_PACKAGE_LIBMAXMINDDB
help
Enable MaxMind GeoIP2 support. Needed to support mod_maxminddb
config BR2_PACKAGE_LIGHTTPD_MYSQL
bool "mysql support"
depends on BR2_PACKAGE_MARIADB
help
Enable mysql support for lighttpd mod_vhostdb_mysql.
comment "mysql support needs mariadb"
depends on !BR2_PACKAGE_MARIADB
config BR2_PACKAGE_LIGHTTPD_OPENSSL
bool "openssl support"
select BR2_PACKAGE_OPENSSL
@@ -33,24 +83,28 @@ config BR2_PACKAGE_LIGHTTPD_PAM
help
Enable PAM authentication support for lighttpd.
config BR2_PACKAGE_LIGHTTPD_ZLIB
bool "zlib support"
select BR2_PACKAGE_ZLIB
help
Enable zlib support for lighttpd mod_compress.
config BR2_PACKAGE_LIGHTTPD_BZIP2
bool "bzip2 support"
select BR2_PACKAGE_BZIP2
help
Enable bzip2 support for lighttpd mod_compress.
config BR2_PACKAGE_LIGHTTPD_PCRE
bool "pcre support"
select BR2_PACKAGE_PCRE
select BR2_PACKAGE_PCRE2
help
Enable PCRE support. Needed to support mod_rewrite
config BR2_PACKAGE_LIGHTTPD_PGSQL
bool "pgsql support"
depends on BR2_USE_MMU # postgresql
depends on BR2_USE_WCHAR # postgresql
depends on !BR2_OPTIMIZE_FAST # postgresql
select BR2_PACKAGE_POSTGRESQL
help
Enable postgres support for lighttpd mod_vhostdb_pgsql.
comment "pgsql support needs a toolchain w/ wchar"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR
comment "pgsql support can't be built with Optimize for fast"
depends on BR2_OPTIMIZE_FAST
config BR2_PACKAGE_LIGHTTPD_WEBDAV
bool "webdav support"
select BR2_PACKAGE_LIBXML2
@@ -58,10 +112,16 @@ config BR2_PACKAGE_LIGHTTPD_WEBDAV
help
Enable webdav support. Needed to support mod_webdav
config BR2_PACKAGE_LIGHTTPD_LUA
bool "lua support"
depends on BR2_PACKAGE_LUA
config BR2_PACKAGE_LIGHTTPD_ZLIB
bool "zlib support"
select BR2_PACKAGE_ZLIB
help
Enable Lua support. Needed to support mod_magnet
Enable zlib support for lighttpd mod_deflate.
config BR2_PACKAGE_LIGHTTPD_ZSTD
bool "zstd support"
select BR2_PACKAGE_ZSTD
help
Enable zstd support for lighttpd mod_deflate.
endif

View File

@@ -1,4 +1,4 @@
# From https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.55.sha256sum
sha256 6a0b50e9c9d5cc3d9e48592315c25a2d645858f863e1ccd120507a30ce21e927 lighttpd-1.4.55.tar.xz
# From https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.67.sha512sum
sha512 acfde71675d1c54b4e805998d1dabaa291437181bdbca0d6a3a069584c4576d7585d2401f57f8691f23aaf6283a95ac61156789a055a2a7236fd305c1f248627 lighttpd-1.4.67.tar.xz
# Locally calculated
sha256 5c98cad2fbaf5c5e2562bcbab401a7c557c1bb1bac9914ecc63730925052fb13 COPYING
sha256 5c98cad2fbaf5c5e2562bcbab401a7c557c1bb1bac9914ecc63730925052fb13 COPYING

View File

@@ -5,71 +5,133 @@
################################################################################
LIGHTTPD_VERSION_MAJOR = 1.4
LIGHTTPD_VERSION = $(LIGHTTPD_VERSION_MAJOR).55
LIGHTTPD_VERSION = $(LIGHTTPD_VERSION_MAJOR).67
LIGHTTPD_SOURCE = lighttpd-$(LIGHTTPD_VERSION).tar.xz
LIGHTTPD_SITE = http://download.lighttpd.net/lighttpd/releases-$(LIGHTTPD_VERSION_MAJOR).x
LIGHTTPD_LICENSE = BSD-3-Clause
LIGHTTPD_LICENSE_FILES = COPYING
LIGHTTPD_DEPENDENCIES = host-pkgconf
LIGHTTPD_CPE_ID_VENDOR = lighttpd
LIGHTTPD_DEPENDENCIES = host-pkgconf xxhash
LIGHTTPD_CONF_OPTS = \
--without-wolfssl \
--libdir=/usr/lib/lighttpd \
--libexecdir=/usr/lib
-Dwith_dbi=false \
-Dwith_fam=false \
-Dwith_gnutls=false \
-Dwith_libev=false \
-Dwith_libunwind=false \
-Dwith_mbedtls=false \
-Dwith_nettle=false \
-Dwith_nss=false \
-Dwith_pcre=false \
-Dwith_sasl=false \
-Dwith_wolfssl=false \
-Dwith_xattr=false \
-Dwith_xxhash=true \
-Dbuild_extra_warnings=false \
-Dbuild_static=false \
-Dmoduledir=lib/lighttpd
ifeq ($(BR2_PACKAGE_LIGHTTPD_OPENSSL),y)
LIGHTTPD_DEPENDENCIES += openssl
LIGHTTPD_CONF_OPTS += --with-openssl
ifeq ($(BR2_PACKAGE_LIGHTTPD_BROTLI),y)
LIGHTTPD_DEPENDENCIES += brotli
LIGHTTPD_CONF_OPTS += -Dwith_brotli=true
else
LIGHTTPD_CONF_OPTS += --without-openssl
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_PAM),y)
LIGHTTPD_DEPENDENCIES += linux-pam
LIGHTTPD_CONF_OPTS += --with-pam
else
LIGHTTPD_CONF_OPTS += --without-pam
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_ZLIB),y)
LIGHTTPD_DEPENDENCIES += zlib
LIGHTTPD_CONF_OPTS += --with-zlib
else
LIGHTTPD_CONF_OPTS += --without-zlib
LIGHTTPD_CONF_OPTS += -Dwith_brotli=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_BZIP2),y)
LIGHTTPD_DEPENDENCIES += bzip2
LIGHTTPD_CONF_OPTS += --with-bzip2
LIGHTTPD_CONF_OPTS += -Dwith_bzip=true
else
LIGHTTPD_CONF_OPTS += --without-bzip2
LIGHTTPD_CONF_OPTS += -Dwith_bzip=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_PCRE),y)
LIGHTTPD_CONF_ENV = PCRECONFIG=$(STAGING_DIR)/usr/bin/pcre-config
LIGHTTPD_DEPENDENCIES += pcre
LIGHTTPD_CONF_OPTS += --with-pcre
ifeq ($(BR2_PACKAGE_LIGHTTPD_KRB5),y)
LIGHTTPD_DEPENDENCIES += libkrb5
LIGHTTPD_CONF_OPTS += -Dwith_krb5=true
else
LIGHTTPD_CONF_OPTS += --without-pcre
LIGHTTPD_CONF_OPTS += -Dwith_krb5=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_WEBDAV),y)
LIGHTTPD_DEPENDENCIES += libxml2 sqlite
LIGHTTPD_CONF_OPTS += --with-webdav-props
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
LIGHTTPD_CONF_OPTS += --with-webdav-locks
LIGHTTPD_DEPENDENCIES += util-linux
ifeq ($(BR2_PACKAGE_LIGHTTPD_LDAP),y)
LIGHTTPD_DEPENDENCIES += openldap
LIGHTTPD_CONF_OPTS += -Dwith_ldap=true
else
LIGHTTPD_CONF_OPTS += --without-webdav-locks
endif
else
LIGHTTPD_CONF_OPTS += --without-webdav-props --without-webdav-locks
LIGHTTPD_CONF_OPTS += -Dwith_ldap=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_LUA),y)
LIGHTTPD_DEPENDENCIES += lua
LIGHTTPD_CONF_OPTS += --with-lua
LIGHTTPD_CONF_OPTS += -Dwith_lua=true
else
LIGHTTPD_CONF_OPTS += --without-lua
LIGHTTPD_CONF_OPTS += -Dwith_lua=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_MAXMINDDB),y)
LIGHTTPD_DEPENDENCIES += libmaxminddb
LIGHTTPD_CONF_OPTS += -Dwith_maxminddb=true
else
LIGHTTPD_CONF_OPTS += -Dwith_maxminddb=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_MYSQL),y)
LIGHTTPD_DEPENDENCIES += mysql
LIGHTTPD_CONF_OPTS += -Dwith_mysql=true
else
LIGHTTPD_CONF_OPTS += -Dwith_mysql=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_OPENSSL),y)
LIGHTTPD_DEPENDENCIES += openssl
LIGHTTPD_CONF_OPTS += -Dwith_openssl=true
else
LIGHTTPD_CONF_OPTS += -Dwith_openssl=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_PAM),y)
LIGHTTPD_DEPENDENCIES += linux-pam
LIGHTTPD_CONF_OPTS += -Dwith_pam=true
else
LIGHTTPD_CONF_OPTS += -Dwith_pam=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_PCRE),y)
LIGHTTPD_DEPENDENCIES += pcre2
LIGHTTPD_CONF_OPTS += -Dwith_pcre2=true
else
LIGHTTPD_CONF_OPTS += -Dwith_pcre2=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_PGSQL),y)
LIGHTTPD_DEPENDENCIES += postgresql
LIGHTTPD_CONF_OPTS += -Dwith_pgsql=true
else
LIGHTTPD_CONF_OPTS += -Dwith_pgsql=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_WEBDAV),y)
LIGHTTPD_DEPENDENCIES += libxml2 sqlite
LIGHTTPD_CONF_OPTS += -Dwith_webdav_props=true
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
LIGHTTPD_CONF_OPTS += -Dwith_webdav_locks=true
LIGHTTPD_DEPENDENCIES += util-linux
else
LIGHTTPD_CONF_OPTS += -Dwith_webdav_locks=false
endif
else
LIGHTTPD_CONF_OPTS += -Dwith_webdav_props=false -Dwith_webdav_locks=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_ZLIB),y)
LIGHTTPD_DEPENDENCIES += zlib
LIGHTTPD_CONF_OPTS += -Dwith_zlib=true
else
LIGHTTPD_CONF_OPTS += -Dwith_zlib=false
endif
ifeq ($(BR2_PACKAGE_LIGHTTPD_ZSTD),y)
LIGHTTPD_DEPENDENCIES += zstd
LIGHTTPD_CONF_OPTS += -Dwith_zstd=true
else
LIGHTTPD_CONF_OPTS += -Dwith_zstd=false
endif
define LIGHTTPD_INSTALL_CONFIG
@@ -103,4 +165,4 @@ define LIGHTTPD_INSTALL_INIT_SYSTEMD
$(TARGET_DIR)/usr/lib/tmpfiles.d/lighttpd.conf
endef
$(eval $(autotools-package))
$(eval $(meson-package))

View File

@@ -0,0 +1,66 @@
From 836f4e735cf368542f14005e41d2f84ec29dfd60 Mon Sep 17 00:00:00 2001
From: Yann Collet <yann.collet.73@gmail.com>
Date: Sat, 4 Dec 2021 10:29:49 -0800
Subject: [PATCH] fix man page installation
for variant redirectors (`xxh32sum`, `xxh64sum` and `xxh128sum`).
fix #647, reported by @jpalus.
Also : slightly updated man page text, for clarity and accuracy.
[Retrieved (and updated to keep only Makefile update) from:
https://github.com/Cyan4973/xxHash/commit/836f4e735cf368542f14005e41d2f84ec29dfd60]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Makefile | 14 ++++++++------
cli/xxhsum.1 | 8 ++++----
cli/xxhsum.1.md | 8 +++++---
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index 2fbefbc6..63273e16 100644
--- a/Makefile
+++ b/Makefile
@@ -457,6 +457,7 @@ endif
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m 644
+INSTALL_DIR ?= $(INSTALL) -d -m 755
# Escape special symbols by putting each character into its separate class
@@ -496,7 +497,7 @@ libxxhash.pc: libxxhash.pc.in
.PHONY: install
install: lib libxxhash.pc xxhsum ## install libraries, CLI, links and man page
@echo Installing libxxhash
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
@@ -508,19 +509,20 @@ ifeq ($(DISPATCH),1)
$(Q)$(INSTALL_DATA) xxh_x86dispatch.h $(DESTDIR)$(INCLUDEDIR)
endif
@echo Installing pkgconfig
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(PKGCONFIGDIR)/
$(Q)$(INSTALL_DATA) libxxhash.pc $(DESTDIR)$(PKGCONFIGDIR)/
@echo Installing xxhsum
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(BINDIR)/
$(Q)$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh64sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh128sum
@echo Installing man pages
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/
$(Q)$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MANDIR)/xxhsum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh32sum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh64sum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh128sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
@echo xxhash installation completed
.PHONY: uninstall

View File

@@ -0,0 +1,71 @@
From 0e7418bce83bb9c236d9cb4535a36a80cd0cc663 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Wed, 15 Dec 2021 21:45:14 +0100
Subject: [PATCH] Makefile: add dedicated install targets
Add dedicated install targets to allow the user to install only xxhsum,
the static library, the shared library, etc.
This is especially useful on embedded systems where dynamic library is
not always supported by toolchains
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Retrieved from:
https://github.com/Cyan4973/xxHash/commit/db9c199e99f7b4d419647b1ef49c547fc2547516]
---
Makefile | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 8d4fcd21..5fe72972 100644
--- a/Makefile
+++ b/Makefile
@@ -505,11 +505,14 @@ libxxhash.pc: libxxhash.pc.in
$< > $@
-.PHONY: install
-install: lib libxxhash.pc xxhsum ## install libraries, CLI, links and man page
- @echo Installing libxxhash
+install_libxxhash.a: libxxhash.a
+ @echo Installing libxxhash.a
$(Q)$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
+
+install_libxxhash: libxxhash
+ @echo Installing libxxhash
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
@@ -519,21 +522,30 @@ install: lib libxxhash.pc xxhsum ## install libraries, CLI, links and man page
ifeq ($(DISPATCH),1)
$(Q)$(INSTALL_DATA) xxh_x86dispatch.h $(DESTDIR)$(INCLUDEDIR)
endif
+
+install_libxxhash.pc: libxxhash.pc
@echo Installing pkgconfig
$(Q)$(INSTALL_DIR) $(DESTDIR)$(PKGCONFIGDIR)/
$(Q)$(INSTALL_DATA) libxxhash.pc $(DESTDIR)$(PKGCONFIGDIR)/
+
+install_xxhsum: xxhsum
@echo Installing xxhsum
$(Q)$(INSTALL_DIR) $(DESTDIR)$(BINDIR)/
$(Q)$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh64sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh128sum
+
+install_man:
@echo Installing man pages
$(Q)$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/
$(Q)$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MANDIR)/xxhsum.1
$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
+
+.PHONY: install
+install: install_libxxhash.a install_libxxhash install_libxxhash.pc install_xxhsum install_man ## install libraries, CLI, links and man page
@echo xxhash installation completed
.PHONY: uninstall

View File

@@ -0,0 +1,29 @@
From 6189ecd3d44a693460f86280ccf49d33cb4b18e1 Mon Sep 17 00:00:00 2001
From: Yann Collet <cyan@fb.com>
Date: Sun, 26 Dec 2021 15:15:26 -0800
Subject: [PATCH] do no longer depend on `<assert.h>` for XXH_STATIC_ASSERT
since some versions are buggy.
Use `_Static_assert` instead, which is part of the C11 language.
[Retrieved from:
https://github.com/Cyan4973/xxHash/commit/6189ecd3d44a693460f86280ccf49d33cb4b18e1]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
xxhash.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xxhash.h b/xxhash.h
index 311a69c7..5dfd5c45 100644
--- a/xxhash.h
+++ b/xxhash.h
@@ -1749,8 +1749,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
/* note: use after variable declarations */
#ifndef XXH_STATIC_ASSERT
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
-# include <assert.h>
-# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
+# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0)
# elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */
# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
# else

View File

@@ -0,0 +1,39 @@
From b7c91f761b6d0b79398d0a064d2d6e34de3dfa47 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Tue, 27 Dec 2022 23:12:37 +0100
Subject: [PATCH] Makefile: add install_libxxhash.includes target
Add install_libxxhash.includes to be able to install headers when
building and installing the static library
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/Cyan4973/xxHash/pull/776]
---
Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index cfa5779..2276282 100644
--- a/Makefile
+++ b/Makefile
@@ -557,6 +557,8 @@ install_libxxhash: libxxhash
$(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
+
+install_libxxhash.includes:
$(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR) # includes
$(Q)$(INSTALL_DATA) xxhash.h $(DESTDIR)$(INCLUDEDIR)
$(Q)$(INSTALL_DATA) xxh3.h $(DESTDIR)$(INCLUDEDIR) # for compatibility, will be removed in v0.9.0
@@ -586,7 +588,7 @@ install_man:
$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
.PHONY: install
-install: install_libxxhash.a install_libxxhash install_libxxhash.pc install_xxhsum install_man ## install libraries, CLI, links and man page
+install: install_libxxhash.a install_libxxhash install_libxxhash.includes install_libxxhash.pc install_xxhsum install_man ## install libraries, CLI, links and man page
@echo xxhash installation completed
.PHONY: uninstall
--
2.35.1

View File

@@ -1,3 +1,4 @@
# locally computed
sha256 7e93d28e81c3e95ff07674a400001d0cdf23b7842d49b211e5582d00d8e3ac3e xxhash-0.7.2.tar.gz
sha256 94df5da58df6c83bcc2fc0c84aaad71a0b0fe94625060d6cac000121dda37730 LICENSE
sha256 3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c xxhash-0.8.1.tar.gz
sha256 553d0035773ddd1590045f8fdc3a4c6ead31e36336721aeca8421e88ed1c9f80 LICENSE
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 cli/COPYING

View File

@@ -4,17 +4,41 @@
#
################################################################################
XXHASH_VERSION = 0.7.2
XXHASH_VERSION = 0.8.1
XXHASH_SITE = $(call github,Cyan4973,xxHash,v$(XXHASH_VERSION))
XXHASH_LICENSE = BSD-2-Clause (library), GPL-2.0+ (xxhsum)
XXHASH_LICENSE_FILES = LICENSE
XXHASH_LICENSE_FILES = LICENSE cli/COPYING
XXHASH_INSTALL_STAGING = YES
XXHASH_TARGETS = xxhsum libxxhash.pc
XXHASH_INSTALL_TARGETS = \
install_libxxhash.includes \
install_libxxhash.pc \
install_xxhsum
ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
XXHASH_TARGETS += libxxhash.a
XXHASH_INSTALL_TARGETS += install_libxxhash.a
endif
ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
XXHASH_TARGETS += libxxhash
XXHASH_INSTALL_TARGETS += install_libxxhash
endif
define XXHASH_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) xxhsum
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
$(XXHASH_TARGETS)
endef
define XXHASH_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
PREFIX=/usr DESTDIR=$(STAGING_DIR) $(XXHASH_INSTALL_TARGETS)
endef
define XXHASH_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/xxhsum $(TARGET_DIR)/usr/bin/xxhsum
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
PREFIX=/usr DESTDIR=$(TARGET_DIR) $(XXHASH_INSTALL_TARGETS)
endef
$(eval $(generic-package))