diff mbox series

[v2,8/8] tipidee: new package

Message ID 20240709-tipidee-v2-8-a69a8668005e@gmx.net
State Accepted
Headers show
Series Various skarnet.org updates and new tipidee package | expand

Commit Message

J. Neuschäfer July 8, 2024, 10:45 p.m. UTC
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
---
 package/Config.in              |  1 +
 package/Config.in.host         |  1 +
 package/tipidee/Config.in      | 37 ++++++++++++++++++++++
 package/tipidee/Config.in.host |  8 +++++
 package/tipidee/tipidee.hash   |  3 ++
 package/tipidee/tipidee.mk     | 72 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 122 insertions(+)


--
2.43.0

Comments

Arnout Vandecappelle July 14, 2024, 8:22 p.m. UTC | #1
On 09/07/2024 00:45, J. Neuschäfer via buildroot wrote:
> Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>

  Applied series to master, thanks. The rest went in unchanged, but in this one, 
I made quite a few changes:

      - Remove BR2_PACKAGE_TIPIDEE_CONFIGURATION, use empty value of
        BR2_PACKAGE_TIPIDEE_CONFIG_FILE to flag false.
      - Rename BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE to
        BR2_PACKAGE_TIPIDEE_CONFIG_FILE.
      - Default BR2_PACKAGE_TIPIDEE_CONFIG_FILE to empty.
      - Fix spelling of BR2_PACKAGE_HOST_TIPIDEE.
      - Add J. to DEVELOPERS.
      - Install in /usr instead of /.

  You're welcome to add yourself to DEVELOPERS for other packages that you're 
interested in (e.g. the skarnet series) as well.

  Regards,
  Arnout

> ---
>   package/Config.in              |  1 +
>   package/Config.in.host         |  1 +
>   package/tipidee/Config.in      | 37 ++++++++++++++++++++++
>   package/tipidee/Config.in.host |  8 +++++
>   package/tipidee/tipidee.hash   |  3 ++
>   package/tipidee/tipidee.mk     | 72 ++++++++++++++++++++++++++++++++++++++++++
>   6 files changed, 122 insertions(+)
> 
> diff --git a/package/Config.in b/package/Config.in
> index 48ef1a6fdc..8f199b832b 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2595,6 +2595,7 @@ endif
>   	source "package/tinc/Config.in"
>   	source "package/tinyproxy/Config.in"
>   	source "package/tinyssh/Config.in"
> +	source "package/tipidee/Config.in"
>   	source "package/tor/Config.in"
>   	source "package/traceroute/Config.in"
>   	source "package/transmission/Config.in"
> diff --git a/package/Config.in.host b/package/Config.in.host
> index 9cdca62633..d1e3c0a45b 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -112,6 +112,7 @@ menu "Host utilities"
>   	source "package/systemd/Config.in.host"
>   	source "package/tegrarcm/Config.in.host"
>   	source "package/ti-cgt-pru/Config.in.host"
> +	source "package/tipidee/Config.in.host"
>   	source "package/uboot-tools/Config.in.host"
>   	source "package/util-linux/Config.in.host"
>   	source "package/utp_com/Config.in.host"
> diff --git a/package/tipidee/Config.in b/package/tipidee/Config.in
> new file mode 100644
> index 0000000000..cc1c91a47c
> --- /dev/null
> +++ b/package/tipidee/Config.in
> @@ -0,0 +1,37 @@
> +config BR2_PACKAGE_TIPIDEE
> +	bool "tipidee"
> +	depends on BR2_USE_MMU # skalibs
> +	select BR2_PACKAGE_SKALIBS
> +	help
> +	  tipidee is a web server. It supports HTTP 1.0 and 1.1. It aims
> +	  to be compliant with RFC 9112: while it only implements a very
> +	  limited subset of the optional functionality in HTTP 1.1, it
> +	  implements all the mandatory parts. It is usable with both
> +	  HTTP and HTTPS.
> +
> +	  It runs under a super-server, e.g. inetd, s6-tcpserver, or
> +	  s6-tlsserver (for HTTPS). Traditionally, inetd-mode web
> +	  servers aren't considered performant, but tipidee aims to eke
> +	  out every single drop of performance that is attainable with
> +	  its programming model.
> +
> +	  https://skarnet.org/software/tipidee/
> +
> +if BR2_PACKAGE_TIPIDEE
> +
> +config BR2_PACKAGE_TIPIDEE_CONFIGURATION
> +	bool "install a configuration file to /etc/tipidee.conf.cdb"
> +	select BR2_PACKAGE_HOST_TIPIDEE
> +	help
> +	  Build a tipidee configuration and install it to the target.
> +
> +config BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE
> +	string "configuration source file"
> +	default "$(CONFIG_DIR)/tipidee.conf"
> +	depends on BR2_PACKAGE_TIPIDEE_CONFIGURATION
> +	help
> +	  The configuration file in source (text) format, documented at:
> +
> +	  https://skarnet.org/software/tipidee/tipidee.conf.html
> +
> +endif
> diff --git a/package/tipidee/Config.in.host b/package/tipidee/Config.in.host
> new file mode 100644
> index 0000000000..93e548df1e
> --- /dev/null
> +++ b/package/tipidee/Config.in.host
> @@ -0,0 +1,8 @@
> +config BR2_HOST_PACKAGE_TIPIDEE
> +	bool "host tipidee"
> +	depends on BR2_USE_MMU # skalibs
> +	select BR2_PACKAGE_SKALIBS
> +	help
> +	  This package builds the tipidee-config tool for the host.
> +
> +	  https://skarnet.org/software/tipidee/
> diff --git a/package/tipidee/tipidee.hash b/package/tipidee/tipidee.hash
> new file mode 100644
> index 0000000000..ecc1ab34b4
> --- /dev/null
> +++ b/package/tipidee/tipidee.hash
> @@ -0,0 +1,3 @@
> +# Locally generated
> +sha256  d9e91fc719879a43d54329b99b02c6649c54e428e77bc96a0573506b52bf1422  tipidee-0.0.5.0.tar.gz
> +sha256  8feb7933c6e6506a7f20fbfc03fd37df3caff4becdf3b7a0ffad5016277e441e  COPYING
> diff --git a/package/tipidee/tipidee.mk b/package/tipidee/tipidee.mk
> new file mode 100644
> index 0000000000..2fde75b87d
> --- /dev/null
> +++ b/package/tipidee/tipidee.mk
> @@ -0,0 +1,72 @@
> +################################################################################
> +#
> +# tipidee
> +#
> +################################################################################
> +
> +TIPIDEE_VERSION = 0.0.5.0
> +TIPIDEE_SITE = https://skarnet.org/software/tipidee
> +TIPIDEE_LICENSE = ISC
> +TIPIDEE_LICENSE_FILES = COPYING
> +TIPIDEE_INSTALL_STAGING = YES
> +TIPIDEE_DEPENDENCIES = skalibs
> +
> +TIPIDEE_CONF_OPTS = \
> +	--prefix=/ \
> +	--with-sysdeps=$(STAGING_DIR)/lib/skalibs/sysdeps \
> +	--with-include=$(STAGING_DIR)/include \
> +	--with-dynlib=$(STAGING_DIR)/lib \
> +	--with-lib=$(STAGING_DIR)/lib/skalibs \
> +	$(if $(BR2_STATIC_LIBS),,--disable-allstatic) \
> +	$(SHARED_STATIC_LIBS_OPTS)
> +
> +define TIPIDEE_CONFIGURE_CMDS
> +	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure $(TIPIDEE_CONF_OPTS))
> +endef
> +
> +define TIPIDEE_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
> +endef
> +
> +define TIPIDEE_INSTALL_TARGET_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
> +	rm -f $(TARGET_DIR)/bin/tipidee-config
> +	rm -f $(TARGET_DIR)/libexec/tipidee-config-preprocess
> +endef
> +
> +ifeq ($(BR2_PACKAGE_TIPIDEE_CONFIGURATION),y)
> +TIPIDEE_DEPENDENCIES += host-tipidee
> +
> +define TIPIDEE_INSTALL_CONFIG
> +	$(HOST_DIR)/bin/tipidee-config -i $(BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE) \
> +		-o $(TARGET_DIR)/etc/tipidee.conf.cdb
> +endef
> +TIPIDEE_POST_INSTALL_TARGET_HOOKS += TIPIDEE_INSTALL_CONFIG
> +
> +endif
> +
> +HOST_TIPIDEE_DEPENDENCIES = host-skalibs
> +
> +HOST_TIPIDEE_CONF_OPTS = \
> +	--prefix=$(HOST_DIR) \
> +	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
> +	--with-include=$(HOST_DIR)/include \
> +	--with-dynlib=$(HOST_DIR)/lib \
> +	--disable-static \
> +	--enable-shared \
> +	--disable-allstatic
> +
> +define HOST_TIPIDEE_CONFIGURE_CMDS
> +	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_TIPIDEE_CONF_OPTS))
> +endef
> +
> +define HOST_TIPIDEE_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
> +endef
> +
> +define HOST_TIPIDEE_INSTALL_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install-dynlib install-bin install-libexec
> +endef
> +
> +$(eval $(generic-package))
> +$(eval $(host-generic-package))
> 
> --
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
J. Neuschäfer July 19, 2024, 2:36 p.m. UTC | #2
On Sun, Jul 14, 2024 at 10:22:30PM +0200, Arnout Vandecappelle wrote:
>
>
> On 09/07/2024 00:45, J. Neuschäfer via buildroot wrote:
> > Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
>
>  Applied series to master, thanks. The rest went in unchanged, but in this
> one, I made quite a few changes:
>
>      - Remove BR2_PACKAGE_TIPIDEE_CONFIGURATION, use empty value of
>        BR2_PACKAGE_TIPIDEE_CONFIG_FILE to flag false.
>      - Rename BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE to
>        BR2_PACKAGE_TIPIDEE_CONFIG_FILE.
>      - Default BR2_PACKAGE_TIPIDEE_CONFIG_FILE to empty.

Unfortunately, this approach causes autobuild failures because
tipidee-config cannot work without a file:

	http://autobuild.buildroot.org/?reason=tipidee-0.0.5.0

What's a good way to fix this?

-- jn
Arnout Vandecappelle July 19, 2024, 6:06 p.m. UTC | #3
On 19/07/2024 16:36, J. Neuschäfer wrote:
> On Sun, Jul 14, 2024 at 10:22:30PM +0200, Arnout Vandecappelle wrote:
>>
>>
>> On 09/07/2024 00:45, J. Neuschäfer via buildroot wrote:
>>> Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
>>
>>   Applied series to master, thanks. The rest went in unchanged, but in this
>> one, I made quite a few changes:
>>
>>       - Remove BR2_PACKAGE_TIPIDEE_CONFIGURATION, use empty value of
>>         BR2_PACKAGE_TIPIDEE_CONFIG_FILE to flag false.
>>       - Rename BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE to
>>         BR2_PACKAGE_TIPIDEE_CONFIG_FILE.
>>       - Default BR2_PACKAGE_TIPIDEE_CONFIG_FILE to empty.
> 
> Unfortunately, this approach causes autobuild failures because
> tipidee-config cannot work without a file:
> 
> 	http://autobuild.buildroot.org/?reason=tipidee-0.0.5.0
> 
> What's a good way to fix this?

  Oops, that's my bad, I should have qstrip'ed before the condition. I directly 
pushed the fix below.

  Regards,
  Arnout

     commit 27e7b0bf14cf2321e2aae64e490671f5cfa2281d (HEAD -> master)
     Author: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
     Date:   Fri Jul 19 20:03:53 2024

     package/tipidee: fix install without config file

     When the tipidee package was added in commit
     17deaf60f66fc08a796233920a104e5233b501e0, the committer refactored it so
     no separate boolean option is required to enable the config file.
     However, in doing so, the case where the config file is empty was not
     correctly handled: BR2_PACKAGE_TIPIDEE_CONFIG_FILE is never empty
     because even with the empty string it contains "".

     Fox by qstrip'ing before checking for empty.

     Signed-off-by: Arnout Vandecappelle <arnout@mind.be>

     diff --git a/package/tipidee/tipidee.mk b/package/tipidee/tipidee.mk
     index 1e15782aa4..915b4f84bd 100644
     --- a/package/tipidee/tipidee.mk
     +++ b/package/tipidee/tipidee.mk
     @@ -33,12 +33,13 @@ define TIPIDEE_INSTALL_TARGET_CMDS
             rm -f $(TARGET_DIR)/libexec/tipidee-config-preprocess
      endef

     -ifneq ($(BR2_PACKAGE_TIPIDEE_CONFIG_FILE),)
     +TIPIDEE_CONFIG_FILE = $(call qstrip, $(BR2_PACKAGE_TIPIDEE_CONFIG_FILE))
     +ifneq ($(TIPIDEE_CONFIG_FILE),)
      TIPIDEE_DEPENDENCIES += host-tipidee

      define TIPIDEE_INSTALL_CONFIG
             $(HOST_DIR)/bin/tipidee-config \
     -                -i $(call qstrip, $(BR2_PACKAGE_TIPIDEE_CONFIG_FILE)) \
     +               -i "$(TIPIDEE_CONFIG_FILE)" \
                     -o $(TARGET_DIR)/etc/tipidee.conf.cdb
      endef
      TIPIDEE_POST_INSTALL_TARGET_HOOKS += TIPIDEE_INSTALL_CONFIG
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 48ef1a6fdc..8f199b832b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2595,6 +2595,7 @@  endif
 	source "package/tinc/Config.in"
 	source "package/tinyproxy/Config.in"
 	source "package/tinyssh/Config.in"
+	source "package/tipidee/Config.in"
 	source "package/tor/Config.in"
 	source "package/traceroute/Config.in"
 	source "package/transmission/Config.in"
diff --git a/package/Config.in.host b/package/Config.in.host
index 9cdca62633..d1e3c0a45b 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -112,6 +112,7 @@  menu "Host utilities"
 	source "package/systemd/Config.in.host"
 	source "package/tegrarcm/Config.in.host"
 	source "package/ti-cgt-pru/Config.in.host"
+	source "package/tipidee/Config.in.host"
 	source "package/uboot-tools/Config.in.host"
 	source "package/util-linux/Config.in.host"
 	source "package/utp_com/Config.in.host"
diff --git a/package/tipidee/Config.in b/package/tipidee/Config.in
new file mode 100644
index 0000000000..cc1c91a47c
--- /dev/null
+++ b/package/tipidee/Config.in
@@ -0,0 +1,37 @@ 
+config BR2_PACKAGE_TIPIDEE
+	bool "tipidee"
+	depends on BR2_USE_MMU # skalibs
+	select BR2_PACKAGE_SKALIBS
+	help
+	  tipidee is a web server. It supports HTTP 1.0 and 1.1. It aims
+	  to be compliant with RFC 9112: while it only implements a very
+	  limited subset of the optional functionality in HTTP 1.1, it
+	  implements all the mandatory parts. It is usable with both
+	  HTTP and HTTPS.
+
+	  It runs under a super-server, e.g. inetd, s6-tcpserver, or
+	  s6-tlsserver (for HTTPS). Traditionally, inetd-mode web
+	  servers aren't considered performant, but tipidee aims to eke
+	  out every single drop of performance that is attainable with
+	  its programming model.
+
+	  https://skarnet.org/software/tipidee/
+
+if BR2_PACKAGE_TIPIDEE
+
+config BR2_PACKAGE_TIPIDEE_CONFIGURATION
+	bool "install a configuration file to /etc/tipidee.conf.cdb"
+	select BR2_PACKAGE_HOST_TIPIDEE
+	help
+	  Build a tipidee configuration and install it to the target.
+
+config BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE
+	string "configuration source file"
+	default "$(CONFIG_DIR)/tipidee.conf"
+	depends on BR2_PACKAGE_TIPIDEE_CONFIGURATION
+	help
+	  The configuration file in source (text) format, documented at:
+
+	  https://skarnet.org/software/tipidee/tipidee.conf.html
+
+endif
diff --git a/package/tipidee/Config.in.host b/package/tipidee/Config.in.host
new file mode 100644
index 0000000000..93e548df1e
--- /dev/null
+++ b/package/tipidee/Config.in.host
@@ -0,0 +1,8 @@ 
+config BR2_HOST_PACKAGE_TIPIDEE
+	bool "host tipidee"
+	depends on BR2_USE_MMU # skalibs
+	select BR2_PACKAGE_SKALIBS
+	help
+	  This package builds the tipidee-config tool for the host.
+
+	  https://skarnet.org/software/tipidee/
diff --git a/package/tipidee/tipidee.hash b/package/tipidee/tipidee.hash
new file mode 100644
index 0000000000..ecc1ab34b4
--- /dev/null
+++ b/package/tipidee/tipidee.hash
@@ -0,0 +1,3 @@ 
+# Locally generated
+sha256  d9e91fc719879a43d54329b99b02c6649c54e428e77bc96a0573506b52bf1422  tipidee-0.0.5.0.tar.gz
+sha256  8feb7933c6e6506a7f20fbfc03fd37df3caff4becdf3b7a0ffad5016277e441e  COPYING
diff --git a/package/tipidee/tipidee.mk b/package/tipidee/tipidee.mk
new file mode 100644
index 0000000000..2fde75b87d
--- /dev/null
+++ b/package/tipidee/tipidee.mk
@@ -0,0 +1,72 @@ 
+################################################################################
+#
+# tipidee
+#
+################################################################################
+
+TIPIDEE_VERSION = 0.0.5.0
+TIPIDEE_SITE = https://skarnet.org/software/tipidee
+TIPIDEE_LICENSE = ISC
+TIPIDEE_LICENSE_FILES = COPYING
+TIPIDEE_INSTALL_STAGING = YES
+TIPIDEE_DEPENDENCIES = skalibs
+
+TIPIDEE_CONF_OPTS = \
+	--prefix=/ \
+	--with-sysdeps=$(STAGING_DIR)/lib/skalibs/sysdeps \
+	--with-include=$(STAGING_DIR)/include \
+	--with-dynlib=$(STAGING_DIR)/lib \
+	--with-lib=$(STAGING_DIR)/lib/skalibs \
+	$(if $(BR2_STATIC_LIBS),,--disable-allstatic) \
+	$(SHARED_STATIC_LIBS_OPTS)
+
+define TIPIDEE_CONFIGURE_CMDS
+	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure $(TIPIDEE_CONF_OPTS))
+endef
+
+define TIPIDEE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define TIPIDEE_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+	rm -f $(TARGET_DIR)/bin/tipidee-config
+	rm -f $(TARGET_DIR)/libexec/tipidee-config-preprocess
+endef
+
+ifeq ($(BR2_PACKAGE_TIPIDEE_CONFIGURATION),y)
+TIPIDEE_DEPENDENCIES += host-tipidee
+
+define TIPIDEE_INSTALL_CONFIG
+	$(HOST_DIR)/bin/tipidee-config -i $(BR2_PACKAGE_TIPIDEE_CONFIGURATION_FILE) \
+		-o $(TARGET_DIR)/etc/tipidee.conf.cdb
+endef
+TIPIDEE_POST_INSTALL_TARGET_HOOKS += TIPIDEE_INSTALL_CONFIG
+
+endif
+
+HOST_TIPIDEE_DEPENDENCIES = host-skalibs
+
+HOST_TIPIDEE_CONF_OPTS = \
+	--prefix=$(HOST_DIR) \
+	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
+	--with-include=$(HOST_DIR)/include \
+	--with-dynlib=$(HOST_DIR)/lib \
+	--disable-static \
+	--enable-shared \
+	--disable-allstatic
+
+define HOST_TIPIDEE_CONFIGURE_CMDS
+	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_TIPIDEE_CONF_OPTS))
+endef
+
+define HOST_TIPIDEE_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define HOST_TIPIDEE_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install-dynlib install-bin install-libexec
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))