mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] haproxy: new package
@ 2020-06-09 15:18 Bastian Krause
  2020-06-10 11:56 ` Bastian Krause
  0 siblings, 1 reply; 2+ messages in thread
From: Bastian Krause @ 2020-06-09 15:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Krause

HAProxy consists of a GPL core and GPL modules while exportable include
files are licensed under LGPL.

Some options (e.g. lua, pcre) are not yet configurable, this can be
extended if someone needs them.

A minimalistic config is provided to be able to test it, for everything
else an adjusted config must be installed. As HAProxy's config examples
expect some custom files in /etc/haproxy install_alternative_tree is
used to install custom configuration files and more easily.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
---
 projectroot/etc/haproxy/haproxy.cfg |  24 +++++++
 rules/haproxy.in                    |  25 +++++++
 rules/haproxy.make                  | 100 ++++++++++++++++++++++++++++
 3 files changed, 149 insertions(+)
 create mode 100644 projectroot/etc/haproxy/haproxy.cfg
 create mode 100644 rules/haproxy.in
 create mode 100644 rules/haproxy.make

diff --git a/projectroot/etc/haproxy/haproxy.cfg b/projectroot/etc/haproxy/haproxy.cfg
new file mode 100644
index 000000000..0f9c28d9c
--- /dev/null
+++ b/projectroot/etc/haproxy/haproxy.cfg
@@ -0,0 +1,24 @@
+global
+	log /dev/log	local0
+	log /dev/log	local1 notice
+	stats socket	/run/haproxy-admin.sock mode 660 level admin
+	stats timeout 30s
+	user www
+	group www
+	daemon
+
+defaults
+	log	global
+	mode	http
+	option	httplog
+	option	dontlognull
+	timeout connect 5000
+	timeout client  50000
+	timeout server  50000
+	#errorfile 400 /etc/haproxy/errors/400.http
+	#errorfile 403 /etc/haproxy/errors/403.http
+	#errorfile 408 /etc/haproxy/errors/408.http
+	#errorfile 500 /etc/haproxy/errors/500.http
+	#errorfile 502 /etc/haproxy/errors/502.http
+	#errorfile 503 /etc/haproxy/errors/503.http
+	#errorfile 504 /etc/haproxy/errors/504.http
diff --git a/rules/haproxy.in b/rules/haproxy.in
new file mode 100644
index 000000000..9972f4132
--- /dev/null
+++ b/rules/haproxy.in
@@ -0,0 +1,25 @@
+## SECTION=networking
+
+menuconfig HAPROXY
+	tristate
+	prompt "haproxy                       "
+	select LIBC_CRYPT
+	select LIBC_DL
+	select LIBC_PTHREAD
+	select LIBC_RT
+	select OPENSSL
+	select ZLIB
+	help
+	  Reliable, High Performance TCP/HTTP Load Balancer
+
+if HAPROXY
+
+config HAPROXY_OPENSSL
+	bool
+	prompt "enable OpenSSL support"
+
+config HAPROXY_SYSTEMD_UNIT
+	bool
+	prompt "install systemd service files"
+
+endif
diff --git a/rules/haproxy.make b/rules/haproxy.make
new file mode 100644
index 000000000..a0146cbf3
--- /dev/null
+++ b/rules/haproxy.make
@@ -0,0 +1,100 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Bastian Krause <bst@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_HAPROXY) += haproxy
+
+#
+# Paths and names
+#
+HAPROXY_VERSION		:= 2.1.6
+HAPROXY_MD5		:= 95ffd25fc6b57b4f1650322a7587f972
+HAPROXY			:= haproxy-$(HAPROXY_VERSION)
+HAPROXY_SUFFIX		:= tar.gz
+HAPROXY_URL		:= https://www.haproxy.org/download/$(basename $(HAPROXY_VERSION))/src/$(HAPROXY).$(HAPROXY_SUFFIX)
+HAPROXY_SOURCE		:= $(SRCDIR)/$(HAPROXY).$(HAPROXY_SUFFIX)
+HAPROXY_DIR		:= $(BUILDDIR)/$(HAPROXY)
+HAPROXY_LICENSE		:= GPL-2.0-or-later AND LGPL-2.1-or-later
+HAPROXY_LICENSE_FILES	:= \
+	file://doc/gpl.txt;md5=892f569a555ba9c07a568a7c0c4fa63a \
+	file://doc/lgpl.txt;md5=fbc093901857fcd118f065f900982c24
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HAPROXY_CONF_TOOL	:= NO
+HAPROXY_MAKE_OPT	:= \
+	CC=$(CROSS_CC) \
+	PREFIX=/usr \
+	TARGET=linux-glibc \
+	USE_GZIP=1 \
+	USE_LUA= \
+	USE_OPENSSL=$(call ptx/ifdef,PTXCONF_HAPROXY_OPENSSL,1,) \
+	USE_PCRE= \
+	USE_RT=1 \
+	USE_SLZ= \
+	USE_SYSTEMD=$(call ptx/ifdef,PTXCONF_INITMETHOD_SYSTEMD,1,) \
+	USE_ZLIB=1
+
+HAPROXY_INSTALL_OPT	:= \
+	PREFIX=/usr \
+	install
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/haproxy.compile:
+	@$(call targetinfo)
+	@$(call world/compile, HAPROXY)
+	@$(call compile, HAPROXY, -C contrib/systemd $(HAPROXY_MAKE_OPT))
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/haproxy.install:
+	@$(call targetinfo)
+	@$(call world/install, HAPROXY)
+	@install -v -D -m644 $(HAPROXY_DIR)/contrib/systemd/haproxy.service \
+		$(HAPROXY_PKGDIR)/usr/lib/systemd/system/haproxy.service
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/haproxy.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, haproxy)
+	@$(call install_fixup, haproxy,PRIORITY,optional)
+	@$(call install_fixup, haproxy,SECTION,base)
+	@$(call install_fixup, haproxy,AUTHOR,"Bastian Krause <bst@pengutronix.de>")
+	@$(call install_fixup, haproxy,DESCRIPTION,missing)
+
+	@$(call install_copy, haproxy, 0, 0, 0755, -, /usr/sbin/haproxy)
+
+	@$(call install_alternative_tree, haproxy, 0, 0, /etc/haproxy)
+
+ifdef PTXCONF_HAPROXY_SYSTEMD_UNIT
+	@$(call install_copy, haproxy, 0, 0, 0644, -, \
+		/usr/lib/systemd/system/haproxy.service)
+	@$(call install_link, haproxy, ../haproxy.service, \
+		/usr/lib/systemd/system/multi-user.target.wants/haproxy.service)
+endif
+
+	@$(call install_finish, haproxy)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.27.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] haproxy: new package
  2020-06-09 15:18 [ptxdist] [PATCH] haproxy: new package Bastian Krause
@ 2020-06-10 11:56 ` Bastian Krause
  0 siblings, 0 replies; 2+ messages in thread
From: Bastian Krause @ 2020-06-10 11:56 UTC (permalink / raw)
  To: ptxdist

On 6/9/20 5:18 PM, Bastian Krause wrote:
> HAProxy consists of a GPL core and GPL modules while exportable include
> files are licensed under LGPL.
> 
> Some options (e.g. lua, pcre) are not yet configurable, this can be
> extended if someone needs them.
> 
> A minimalistic config is provided to be able to test it, for everything
> else an adjusted config must be installed. As HAProxy's config examples
> expect some custom files in /etc/haproxy install_alternative_tree is
> used to install custom configuration files and more easily.
> 
> Signed-off-by: Bastian Krause <bst@pengutronix.de>
> ---
>  projectroot/etc/haproxy/haproxy.cfg |  24 +++++++
>  rules/haproxy.in                    |  25 +++++++
>  rules/haproxy.make                  | 100 ++++++++++++++++++++++++++++
>  3 files changed, 149 insertions(+)
>  create mode 100644 projectroot/etc/haproxy/haproxy.cfg
>  create mode 100644 rules/haproxy.in
>  create mode 100644 rules/haproxy.make
> 
> diff --git a/projectroot/etc/haproxy/haproxy.cfg b/projectroot/etc/haproxy/haproxy.cfg
> new file mode 100644
> index 000000000..0f9c28d9c
> --- /dev/null
> +++ b/projectroot/etc/haproxy/haproxy.cfg
> @@ -0,0 +1,24 @@
> +global
> +	log /dev/log	local0
> +	log /dev/log	local1 notice
> +	stats socket	/run/haproxy-admin.sock mode 660 level admin
> +	stats timeout 30s
> +	user www
> +	group www
> +	daemon
> +
> +defaults
> +	log	global
> +	mode	http
> +	option	httplog
> +	option	dontlognull
> +	timeout connect 5000
> +	timeout client  50000
> +	timeout server  50000
> +	#errorfile 400 /etc/haproxy/errors/400.http
> +	#errorfile 403 /etc/haproxy/errors/403.http
> +	#errorfile 408 /etc/haproxy/errors/408.http
> +	#errorfile 500 /etc/haproxy/errors/500.http
> +	#errorfile 502 /etc/haproxy/errors/502.http
> +	#errorfile 503 /etc/haproxy/errors/503.http
> +	#errorfile 504 /etc/haproxy/errors/504.http
> diff --git a/rules/haproxy.in b/rules/haproxy.in
> new file mode 100644
> index 000000000..9972f4132
> --- /dev/null
> +++ b/rules/haproxy.in
> @@ -0,0 +1,25 @@
> +## SECTION=networking
> +
> +menuconfig HAPROXY
> +	tristate
> +	prompt "haproxy                       "
> +	select LIBC_CRYPT
> +	select LIBC_DL
> +	select LIBC_PTHREAD
> +	select LIBC_RT
> +	select OPENSSL

haproxy uses libsystemd in case USE_SYSTEMD=1 is set, so add:

select SYSTEMD if INITMETHOD_SYSTEMD

Will send a v2.

Regards,
Bastian

> +	select ZLIB
> +	help
> +	  Reliable, High Performance TCP/HTTP Load Balancer
> +
> +if HAPROXY
> +
> +config HAPROXY_OPENSSL
> +	bool
> +	prompt "enable OpenSSL support"
> +
> +config HAPROXY_SYSTEMD_UNIT
> +	bool
> +	prompt "install systemd service files"
> +
> +endif
> diff --git a/rules/haproxy.make b/rules/haproxy.make
> new file mode 100644
> index 000000000..a0146cbf3
> --- /dev/null
> +++ b/rules/haproxy.make
> @@ -0,0 +1,100 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2020 by Bastian Krause <bst@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_HAPROXY) += haproxy
> +
> +#
> +# Paths and names
> +#
> +HAPROXY_VERSION		:= 2.1.6
> +HAPROXY_MD5		:= 95ffd25fc6b57b4f1650322a7587f972
> +HAPROXY			:= haproxy-$(HAPROXY_VERSION)
> +HAPROXY_SUFFIX		:= tar.gz
> +HAPROXY_URL		:= https://www.haproxy.org/download/$(basename $(HAPROXY_VERSION))/src/$(HAPROXY).$(HAPROXY_SUFFIX)
> +HAPROXY_SOURCE		:= $(SRCDIR)/$(HAPROXY).$(HAPROXY_SUFFIX)
> +HAPROXY_DIR		:= $(BUILDDIR)/$(HAPROXY)
> +HAPROXY_LICENSE		:= GPL-2.0-or-later AND LGPL-2.1-or-later
> +HAPROXY_LICENSE_FILES	:= \
> +	file://doc/gpl.txt;md5=892f569a555ba9c07a568a7c0c4fa63a \
> +	file://doc/lgpl.txt;md5=fbc093901857fcd118f065f900982c24
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +HAPROXY_CONF_TOOL	:= NO
> +HAPROXY_MAKE_OPT	:= \
> +	CC=$(CROSS_CC) \
> +	PREFIX=/usr \
> +	TARGET=linux-glibc \
> +	USE_GZIP=1 \
> +	USE_LUA= \
> +	USE_OPENSSL=$(call ptx/ifdef,PTXCONF_HAPROXY_OPENSSL,1,) \
> +	USE_PCRE= \
> +	USE_RT=1 \
> +	USE_SLZ= \
> +	USE_SYSTEMD=$(call ptx/ifdef,PTXCONF_INITMETHOD_SYSTEMD,1,) \
> +	USE_ZLIB=1
> +
> +HAPROXY_INSTALL_OPT	:= \
> +	PREFIX=/usr \
> +	install
> +
> +# ----------------------------------------------------------------------------
> +# Compile
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/haproxy.compile:
> +	@$(call targetinfo)
> +	@$(call world/compile, HAPROXY)
> +	@$(call compile, HAPROXY, -C contrib/systemd $(HAPROXY_MAKE_OPT))
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/haproxy.install:
> +	@$(call targetinfo)
> +	@$(call world/install, HAPROXY)
> +	@install -v -D -m644 $(HAPROXY_DIR)/contrib/systemd/haproxy.service \
> +		$(HAPROXY_PKGDIR)/usr/lib/systemd/system/haproxy.service
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/haproxy.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, haproxy)
> +	@$(call install_fixup, haproxy,PRIORITY,optional)
> +	@$(call install_fixup, haproxy,SECTION,base)
> +	@$(call install_fixup, haproxy,AUTHOR,"Bastian Krause <bst@pengutronix.de>")
> +	@$(call install_fixup, haproxy,DESCRIPTION,missing)
> +
> +	@$(call install_copy, haproxy, 0, 0, 0755, -, /usr/sbin/haproxy)
> +
> +	@$(call install_alternative_tree, haproxy, 0, 0, /etc/haproxy)
> +
> +ifdef PTXCONF_HAPROXY_SYSTEMD_UNIT
> +	@$(call install_copy, haproxy, 0, 0, 0644, -, \
> +		/usr/lib/systemd/system/haproxy.service)
> +	@$(call install_link, haproxy, ../haproxy.service, \
> +		/usr/lib/systemd/system/multi-user.target.wants/haproxy.service)
> +endif
> +
> +	@$(call install_finish, haproxy)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-10 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 15:18 [ptxdist] [PATCH] haproxy: new package Bastian Krause
2020-06-10 11:56 ` Bastian Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox