GithubHelp home page GithubHelp logo

dbezemer / rpm-haproxy Goto Github PK

View Code? Open in Web Editor NEW
158.0 14.0 110.0 176 KB

HAproxy RPM spec and builds for CentOS/RHEL 6/7/8

Home Page: http://www.haproxy.org/

License: GNU General Public License v3.0

Makefile 44.48% Shell 28.00% Roff 27.52%
haproxy load balancer proxy rpm centos amazon-linux

rpm-haproxy's Introduction

Github All Releases Build RPMs

This repository contains build artifacts of HAproxy that are provided with no support and no expectation of stability. The recommended way of using the repository is to build and test your own packages. Latest Work-in-Progress builds can be found under release label "WiP RPM Build".

RPM Specs for HAproxy on CentOS / RHEL / Amazon Linux with syslog logging to separate output files

Contributing

When you like to see a specific feature added RPM build process, or support other RPM based Operating Systems please create a Pull Request if you have the knowledge to develop this yourself, I will verify the build process with these changes and merge in upstream when finished. If you don't have the knowledge feel free to create an Issue with the "enhancement" label added. There should be no expectation of when/if this will be added but will allow for tracking what features are of public interest.

Perform the following steps on a build box as a regular user.

Install Prerequisites for RPM Creation

sudo yum groupinstall 'Development Tools'

Checkout this repository

cd /opt
git clone https://github.com/DBezemer/rpm-haproxy.git
cd ./rpm-haproxy
git checkout dev

Build using makefile and latest point release of haproxy

Basic building, no additional components

make

Build forcing minor version 2.6 of haproxy, no additional components. Any valid release version can be specified.

make MAINVERSION=2.6

With Lua support

make USE_LUA=1

With custom Lua version

make USE_LUA=1 LUA_VERSION=5.4.6

With Prometheus Module support

make USE_PROMETHEUS=1

Without sudo for yum (for building in Docker)

make NO_SUDO=1

With a custom release iteration, e.g. '2' (default '1'):

make RELEASE=2

With a custom target CPU, e.g. armv81

make CPU=armv81

Custom CFLAGS, e.g. '-O0' to disable optimization for debug:

make EXTRA_CFLAGS=-O0

Resulting RPMs will be in /opt/rpm-haproxy/rpmbuild/RPMS/x86_64/

Build using Docker

make run-docker

Resulting RPMs will be in ./RPMS/ When updating any of the files that are included in the build phase, ensure that you also bump the release number, like so: make USE_PROMETHEUS=1 RELEASE=3 run-docker

Credits

Based on the Red Hat 6.4 RPM spec for haproxy 1.4 combined with work done by

Additional logging inspired by https://www.percona.com/blog/2014/10/03/haproxy-give-me-some-logs-on-centos-6-5/

rpm-haproxy's People

Contributors

azilber avatar beni-andrews avatar bugfood avatar cbschuld avatar davasny avatar dbezemer avatar exp-xliang avatar gelkayam avatar izzyleung avatar jazzl0ver avatar jdaigle avatar jlamoree avatar kenstir-unity avatar khdevel avatar khorsmann avatar kxseven avatar martijn avatar n2aws avatar resmo avatar thedoc31 avatar wrightlaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpm-haproxy's Issues

Error building haproxy 2.4.4. using USE_LUA=1

Hi
I am trying to build haproxy 2.4.4. using the flag USE_LUA=1 on CentOS 8.
I have been using this CentOS 8 system previously to successfully build versions from the haproxy 2.2 branch.
It seems that the linker fails to link haproxy against lua:

# make USE_LUA=1
sudo yum install -y pcre-devel make gcc openssl-devel rpm-build systemd-devel curl sed zlib-devel
Last metadata expiration check: 0:11:46 ago on Fr 10 Sep 2021 14:59:23 CEST.
Package pcre-devel-8.42-4.el8.x86_64 is already installed.
Package make-1:4.2.1-10.el8.x86_64 is already installed.
Package gcc-8.4.1-1.el8.x86_64 is already installed.
Package openssl-devel-1:1.1.1g-15.el8_3.x86_64 is already installed.
Package rpm-build-4.14.3-14.el8_4.x86_64 is already installed.
Package systemd-devel-239-45.el8_4.3.x86_64 is already installed.
Package curl-7.61.1-18.el8.x86_64 is already installed.
Package sed-4.5-2.el8.x86_64 is already installed.
Package zlib-devel-1.2.11-17.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
rm -f ./SOURCES/haproxy-2.4.4.tar.gz
rm -rf ./rpmbuild
mkdir -p ./rpmbuild/SPECS/ ./rpmbuild/SOURCES/ ./rpmbuild/RPMS/ ./rpmbuild/SRPMS/
rm -rf ./lua-5.4.3*
curl -o  ./SOURCES/haproxy-2.4.4.tar.gz http://www.haproxy.org/download/2.4/src/haproxy-2.4.4.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3503k  100 3503k    0     0  9005k      0 --:--:-- --:--:-- --:--:-- 8982k
sudo yum install -y readline-devel
Last metadata expiration check: 0:11:50 ago on Fr 10 Sep 2021 14:59:23 CEST.
Package readline-devel-7.0-10.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
curl -O https://www.lua.org/ftp/lua-5.4.3.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  349k  100  349k    0     0  1300k      0 --:--:-- --:--:-- --:--:-- 1300k
tar xzf lua-5.4.3.tar.gz
cd lua-5.4.3
make -C lua-5.4.3 clean
make[1]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
make[2]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
rm -f liblua.a lua luac lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o  lua.o luac.o
make[2]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
make[1]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
make -C lua-5.4.3 MYCFLAGS=-fPIC linux test  # MYCFLAGS=-fPIC is required during linux ld
make[1]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
make[2]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
make[3]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lapi.o lapi.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC  -c lcode.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lctype.o lctype.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ldebug.o ldebug.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ldo.o ldo.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ldump.o ldump.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lfunc.o lfunc.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lgc.o lgc.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC  -c llex.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lmem.o lmem.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lobject.o lobject.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lopcodes.o lopcodes.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC  -c lparser.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lstate.o lstate.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lstring.o lstring.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ltable.o ltable.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ltm.o ltm.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lundump.o lundump.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lvm.o lvm.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lzio.o lzio.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lauxlib.o lauxlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lbaselib.o lbaselib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lcorolib.o lcorolib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ldblib.o ldblib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o liolib.o liolib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lmathlib.o lmathlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o loadlib.o loadlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o loslib.o loslib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lstrlib.o lstrlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o ltablib.o ltablib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lutf8lib.o lutf8lib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
ranlib liblua.a
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o lua.o lua.c
gcc -std=gnu99 -o lua   lua.o liblua.a -lm -Wl,-E -ldl
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX -fPIC   -c -o luac.o luac.c
gcc -std=gnu99 -o luac   luac.o liblua.a -lm -Wl,-E -ldl
make[3]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
make[2]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
make[2]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
./lua -v
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio
make[2]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3/src'
make[1]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
make -C lua-5.4.3 install
make[1]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.4 /usr/local/lib/lua/5.4
cd src && install -p -m 0755 lua luac /usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp /usr/local/include
cd src && install -p -m 0644 liblua.a /usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1
make[1]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/lua-5.4.3'
cp -r ./SPECS/* ./rpmbuild/SPECS/ || true
cp -r ./SOURCES/* ./rpmbuild/SOURCES/ || true
rpmbuild -ba SPECS/haproxy.spec \
--define "mainversion 2.4" \
--define "version 2.4.4" \
--define "release 1" \
--define "_extra_cflags 0" \
--define "_topdir %(pwd)/rpmbuild" \
--define "_builddir %{_topdir}/BUILD" \
--define "_buildroot %{_topdir}/BUILDROOT" \
--define "_rpmdir %{_topdir}/RPMS" \
--define "_srcrpmdir %{_topdir}/SRPMS" \
--define "_use_lua 1" \
--define "_use_prometheus 0"
warning: bogus date in %changelog: Sat May 30 2021 David Bezemer <[email protected]>
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.saeMb4
+ umask 022
+ cd /opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD
+ cd /opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD
+ rm -rf haproxy-2.4.4
+ /usr/bin/gzip -dc /opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/SOURCES/haproxy-2.4.4.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd haproxy-2.4.4
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.PtA2x4
+ umask 022
+ cd /opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD
+ cd haproxy-2.4.4
+ regparm_opts=
+ regparm_opts=USE_REGPARM=1
++ /usr/bin/nproc
+ RPM_BUILD_NCPUS=2
+ systemd_opts=
+ pcre_opts=USE_PCRE=1
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ USE_TFO=
+ USE_NS=
+ systemd_opts=USE_SYSTEMD=1
+ pcre_opts='USE_PCRE=1 USE_PCRE_JIT=1'
+ USE_TFO=1
+ USE_NS=1
+ USE_LUA=USE_LUA=1
+ /usr/bin/make -j2 -j2 USE_LUA=1 CPU=generic TARGET=linux-glibc USE_SYSTEMD=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1 USE_REGPARM=1 'ADDINC=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' USE_LINUX_TPROXY=1 USE_THREAD=1 USE_TFO=1 USE_NS=1 'ADDLIB=-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
make[1]: Entering directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4'
  CC      src/ev_poll.o
  CC      src/ev_epoll.o
  CC      src/cpuset.o
  CC      src/ssl_sample.o
  CC      src/ssl_sock.o
  CC      src/ssl_crtlist.o
  CC      src/ssl_ckch.o
  CC      src/ssl_utils.o
  CC      src/cfgparse-ssl.o
  CC      src/hlua.o
  CC      src/hlua_fcn.o
  CC      src/namespace.o
  CC      src/mux_h2.o
  CC      src/mux_fcgi.o
  CC      src/http_ana.o
  CC      src/mux_h1.o
  CC      src/stream.o
  CC      src/tcpcheck.o
  CC      src/stats.o
  CC      src/flt_spoe.o
  CC      src/server.o
  CC      src/tools.o
  CC      src/sample.o
  CC      src/log.o
  CC      src/backend.o
  CC      src/stick_table.o
  CC      src/cfgparse.o
  CC      src/peers.o
  CC      src/cli.o
  CC      src/pattern.o
  CC      src/resolvers.o
  CC      src/proxy.o
  CC      src/http_htx.o
  CC      src/check.o
  CC      src/cache.o
  CC      src/cfgparse-listen.o
  CC      src/haproxy.o
  CC      src/http_act.o
  CC      src/stream_interface.o
  CC      src/http_fetch.o
  CC      src/listener.o
  CC      src/dns.o
  CC      src/connection.o
  CC      src/tcp_rules.o
  CC      src/debug.o
  CC      src/sink.o
  CC      src/payload.o
  CC      src/mux_pt.o
  CC      src/filters.o
  CC      src/fcgi-app.o
  CC      src/server_state.o
  CC      src/vars.o
  CC      src/map.o
  CC      src/cfgparse-global.o
  CC      src/task.o
  CC      src/flt_http_comp.o
  CC      src/session.o
  CC      src/sock.o
  CC      src/flt_trace.o
  CC      src/acl.o
  CC      src/trace.o
  CC      src/http_rules.o
  CC      src/queue.o
  CC      src/mjson.o
  CC      src/h2.o
  CC      src/h1.o
  CC      src/mworker.o
  CC      src/lb_chash.o
  CC      src/ring.o
  CC      src/activity.o
  CC      src/tcp_sample.o
  CC      src/proto_tcp.o
  CC      src/htx.o
  CC      src/h1_htx.o
  CC      src/extcheck.o
  CC      src/channel.o
  CC      src/proto_sockpair.o
  CC      src/fd.o
  CC      src/compression.o
  CC      src/mqtt.o
  CC      src/tcp_act.o
  CC      src/raw_sock.o
  CC      src/frontend.o
  CC      src/http_conv.o
  CC      src/xprt_handshake.o
  CC      src/pool.o
  CC      src/applet.o
  CC      src/mailers.o
  CC      src/lb_fwrr.o
  CC      src/lb_fwlc.o
  CC      src/lb_fas.o
  CC      src/proto_uxst.o
  CC      src/http.o
  CC      src/action.o
  CC      src/protocol.o
  CC      src/thread.o
  CC      src/sock_unix.o
  CC      src/proto_udp.o
  CC      src/lb_map.o
  CC      src/sock_inet.o
  CC      src/lru.o
  CC      src/cfgparse-tcp.o
  CC      src/cfgdiag.o
  CC      src/proto_uxdg.o
  CC      src/ev_select.o
  CC      src/cfgparse-unix.o
  CC      src/uri_normalizer.o
  CC      src/ebmbtree.o
  CC      src/sha1.o
  CC      src/time.o
  CC      src/signal.o
  CC      src/mworker-prog.o
  CC      src/hpack-dec.o
  CC      src/fix.o
  CC      src/arg.o
  CC      src/eb64tree.o
  CC      src/chunk.o
  CC      src/shctx.o
  CC      src/regex.o
  CC      src/fcgi.o
  CC      src/eb32tree.o
  CC      src/eb32sctree.o
  CC      src/dynbuf.o
  CC      src/uri_auth.o
  CC      src/hpack-tbl.o
  CC      src/ebimtree.o
  CC      src/auth.o
  CC      src/ebsttree.o
  CC      src/ebistree.o
  CC      src/base64.o
  CC      src/wdt.o
  CC      src/pipe.o
  CC      src/http_acl.o
  CC      src/hpack-enc.o
  CC      src/dict.o
  CC      src/dgram.o
  CC      src/init.o
  CC      src/hpack-huff.o
  CC      src/freq_ctr.o
  CC      src/ebtree.o
  CC      src/hash.o
  CC      src/version.o
  CC      dev/flags/flags.o
  LD      haproxy
src/hlua.o: In function `hlua_fetches_new':
/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:3464: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_converters_new':
/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:3596: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_applet_tcp_new':
/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:3739: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_txn_new':
/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:5502: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_http_new':
/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:4966: undefined reference to `lua_newuserdatauv'
src/hlua.o:/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4/src/hlua.c:2840: more undefined references to `lua_newuserdatauv' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:939: haproxy] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/opt/rpm-haproxy/2.4.4/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.4'
error: Bad exit status from /var/tmp/rpm-tmp.PtA2x4 (%build)


RPM build errors:
    bogus date in %changelog: Sat May 30 2021 David Bezemer <[email protected]>
    Bad exit status from /var/tmp/rpm-tmp.PtA2x4 (%build)
make: *** [Makefile:59: build] Error 1

Is there a way to successfully build haproxy 2.4. with LUA?

Does not seem to work on Centos 7.9

First of all thanks for the great work here.
I have been trying to build RPM on centos 7.9 with LUA and keep hitting the below issue:

+ /usr/bin/make -j1 USE_LUA=1 CPU=generic TARGET=linux-glibc USE_SYSTEMD=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1 USE_REGPARM=1 'ADDINC=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1  -m64 -mtune=generic' USE_LINUX_TPROXY=1 USE_THREAD=1 USE_TFO=1 USE_NS=1 'ADDLIB=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
make[1]: Entering directory `/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12'
  CC      src/ev_poll.o
  CC      src/ev_epoll.o
  CC      src/cpuset.o
  CC      src/ssl_sample.o
  CC      src/ssl_sock.o
  CC      src/ssl_crtlist.o
  CC      src/ssl_ckch.o
  CC      src/ssl_utils.o
  CC      src/cfgparse-ssl.o
  CC      src/hlua.o
  CC      src/hlua_fcn.o
  CC      src/namespace.o
  CC      src/mux_h2.o
  CC      src/mux_fcgi.o
  CC      src/http_ana.o
  CC      src/mux_h1.o
  CC      src/stream.o
  CC      src/tcpcheck.o
  CC      src/stats.o
  CC      src/flt_spoe.o
  CC      src/server.o
  CC      src/tools.o
  CC      src/sample.o
  CC      src/log.o
  CC      src/backend.o
  CC      src/stick_table.o
  CC      src/cfgparse.o
  CC      src/peers.o
  CC      src/cli.o
  CC      src/pattern.o
  CC      src/resolvers.o
  CC      src/proxy.o
  CC      src/http_htx.o
  CC      src/check.o
  CC      src/cache.o
  CC      src/cfgparse-listen.o
  CC      src/haproxy.o
  CC      src/http_act.o
  CC      src/stream_interface.o
  CC      src/http_fetch.o
  CC      src/listener.o
  CC      src/dns.o
  CC      src/connection.o
  CC      src/tcp_rules.o
  CC      src/debug.o
  CC      src/sink.o
  CC      src/payload.o
  CC      src/mux_pt.o
  CC      src/filters.o
  CC      src/fcgi-app.o
  CC      src/server_state.o
  CC      src/vars.o
  CC      src/map.o
  CC      src/cfgparse-global.o
  CC      src/task.o
  CC      src/flt_http_comp.o
  CC      src/session.o
  CC      src/sock.o
  CC      src/flt_trace.o
  CC      src/acl.o
  CC      src/trace.o
  CC      src/http_rules.o
  CC      src/queue.o
  CC      src/mjson.o
  CC      src/h2.o
  CC      src/h1.o
  CC      src/mworker.o
  CC      src/lb_chash.o
  CC      src/ring.o
  CC      src/activity.o
  CC      src/tcp_sample.o
  CC      src/proto_tcp.o
  CC      src/htx.o
  CC      src/h1_htx.o
  CC      src/extcheck.o
  CC      src/channel.o
  CC      src/proto_sockpair.o
  CC      src/fd.o
  CC      src/compression.o
  CC      src/mqtt.o
  CC      src/tcp_act.o
  CC      src/raw_sock.o
  CC      src/frontend.o
  CC      src/http_conv.o
  CC      src/xprt_handshake.o
  CC      src/pool.o
  CC      src/applet.o
  CC      src/mailers.o
  CC      src/lb_fwrr.o
  CC      src/lb_fwlc.o
  CC      src/lb_fas.o
  CC      src/proto_uxst.o
  CC      src/http.o
  CC      src/action.o
  CC      src/protocol.o
  CC      src/thread.o
  CC      src/sock_unix.o
  CC      src/proto_udp.o
  CC      src/lb_map.o
  CC      src/sock_inet.o
  CC      src/lru.o
  CC      src/cfgparse-tcp.o
  CC      src/cfgdiag.o
  CC      src/proto_uxdg.o
  CC      src/ev_select.o
  CC      src/cfgparse-unix.o
  CC      src/uri_normalizer.o
  CC      src/ebmbtree.o
  CC      src/sha1.o
  CC      src/time.o
  CC      src/signal.o
  CC      src/mworker-prog.o
  CC      src/hpack-dec.o
  CC      src/fix.o
  CC      src/arg.o
  CC      src/eb64tree.o
  CC      src/chunk.o
  CC      src/shctx.o
  CC      src/regex.o
  CC      src/fcgi.o
  CC      src/eb32tree.o
  CC      src/eb32sctree.o
  CC      src/dynbuf.o
  CC      src/uri_auth.o
  CC      src/hpack-tbl.o
  CC      src/ebimtree.o
  CC      src/auth.o
  CC      src/ebsttree.o
  CC      src/ebistree.o
  CC      src/base64.o
  CC      src/wdt.o
  CC      src/pipe.o
  CC      src/http_acl.o
  CC      src/hpack-enc.o
  CC      src/dict.o
  CC      src/dgram.o
  CC      src/init.o
  CC      src/hpack-huff.o
  CC      src/freq_ctr.o
  CC      src/ebtree.o
  CC      src/hash.o
  CC      src/version.o
  LD      haproxy
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_hook':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1238: undefined reference to `lua_isyieldable'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_load_state':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8309: undefined reference to `luaL_loadfilex'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8317: undefined reference to `lua_pcallk'
src/hlua.o: In function `hlua_prepend_path':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8411: undefined reference to `lua_getglobal'
src/hlua.o: In function `hlua_sleep_yield':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:6222: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_applet_tcp_recv_yield':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:3990: undefined reference to `lua_copy'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_txn_reply_add_header':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:6118: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_applet_http_addheader':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:4673: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_txn_reply_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:5940: undefined reference to `lua_tointegerx'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:6000: undefined reference to `lua_rotate'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:6004: undefined reference to `lua_rotate'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:6021: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_lua2arg':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:505: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_lua2smp':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:641: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_fetches_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:3434: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_converters_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:3566: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_applet_tcp_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:3709: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_txn_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:5472: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_http_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:4936: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_txn_forward_reply':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:5693: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_http_get_headers':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:5001: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_applet_http_recv_yield':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:4525: undefined reference to `lua_copy'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o:/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: more undefined references to `lua_yieldk' follow
src/hlua.o: In function `hlua_applet_http_send_response':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:4776: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_socket_connect':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:2656: undefined reference to `luaL_prepbuffsize'
src/hlua.o: In function `hlua_socket_receive_yield':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1982: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_socket_receive':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:2192: undefined reference to `lua_copy'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:2181: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_socket_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:2843: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_applet_http_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:4121: undefined reference to `lua_newuserdatauv'
src/hlua.o: In function `hlua_action':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:7009: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_init_state':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8849: undefined reference to `lua_setglobal'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8872: undefined reference to `lua_setglobal'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:8918: undefined reference to `lua_setglobal'
src/hlua.o: In function `hlua_yieldk':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua.c:1071: undefined reference to `lua_yieldk'
src/hlua_fcn.o: In function `hlua_concat_new':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:441: undefined reference to `lua_newuserdatauv'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:445: undefined reference to `lua_newuserdatauv'
src/hlua_fcn.o: In function `hlua_regex_comp':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:1573: undefined reference to `lua_newuserdatauv'
src/hlua_fcn.o: In function `hlua_parse_addr':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:1490: undefined reference to `lua_newuserdatauv'
src/hlua_fcn.o: In function `hlua_stktable_dump':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:716: undefined reference to `lua_rawlen'
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:741: undefined reference to `lua_tointegerx'
src/hlua_fcn.o: In function `hlua_concat_add':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:406: undefined reference to `lua_newuserdatauv'
src/hlua_fcn.o: In function `hlua_fcn_post_init':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:1385: undefined reference to `lua_getglobal'
src/hlua_fcn.o: In function `hlua_fcn_reg_core_fcn':
/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12/src/hlua_fcn.c:1706: undefined reference to `lua_setglobal'
collect2: error: ld returned 1 exit status
make[1]: *** [haproxy] Error 1
make[1]: Leaving directory `/root/rpm-haproxy/rpmbuild/BUILD/haproxy-2.4.12'
error: Bad exit status from /var/tmp/rpm-tmp.CvRZ68 (%build)


RPM build errors:
    bogus date in %changelog: Sat May 30 2021 David Bezemer <[email protected]>
    Bad exit status from /var/tmp/rpm-tmp.CvRZ68 (%build)
make: *** [build] Error 1

I tried using different versions of proxy in Make and different versions of LUA. Nothing seems to help. Any help would be greatly appreciated.
Thanks
Agi

Lua support needs root to create RPM

This seems to be happening because of the make install step in Lua installation.

make[1]: Entering directory `/home/user/repos/haproxy_testing/rpm-haproxy/lua-5.3.5'
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.3 /usr/local/lib/lua/5.3
mkdir: cannot create directory ‘/usr/local/man/man1’: Permission denied
mkdir: cannot create directory ‘/usr/local/share/lua’: Permission denied
mkdir: cannot create directory ‘/usr/local/lib/lua’: Permission denied
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/user/repos/haproxy_testing/rpm-haproxy/lua-5.3.5'
make: *** [build_lua] Error 2

2.4: bad date in changelog

  • Sat May 30 2021
  • May 29, 2021 was Saturday
  • May 30, 2021 was Sunday
    Also see a similar error on 2.3 branch

Compile option USE_PTHREAD_PSHARED=1

Hi
Looking at the resulting haproxy binary, it appears that the option "USE_PTHREAD_PSHARED" is not available.
I wonder if it would make sense to add it, as I would expect that under high load conditions, it may be beneficial.

I tried adding the option to the file SPECS/haproxy.spec:
%{__make} -j$RPM_BUILD_NCPUS %{?_smp_mflags} ${USE_LUA} CPU="generic" TARGET="linux-glibc" ${systemd_opts} ${pcre_opts} USE_OPENSSL=1 USE_ZLIB=1 ${regparm_opts} ADDINC="%{optflags}" USE_LINUX_TPROXY=1 USE_THREAD=1 USE_PTHREAD_PSHARED=1 USE_TFO=${USE_TFO} USE_NS=${USE_NS} ADDLIB="%{__global_ldflags}"

I tested the rpm creation, installation and running the resulting haproxy on CentOS 7 and CentOS 8.
However, I did not perform a load test yet.

Log lines appearing with wrong prefix

I don't know if this is a bug or change in HAProxy, or something I've done wrong, but I thought I'd check here first because this repo is what I've used to build my binaries. I'm wondering if perhaps there is a build option that affects the following behaviour.


Upgrading recently from some old 1.x version of HAProxy to version 2.5.1 (and leaving the config file unchanged) I noticed my log files have lost the haproxy[%pid] prefix and instead have an empty space:

So with this directive:

log-format "[%[date,ltime(%Y-%m-%dT%H:%M:%S%z)]] %{+Q}o %{-Q}ci %r %ST"

I now get a line like this with a blank space:

 [2022-02-09T07:27:48+0000] 127.0.0.1 "GET / HTTP/1.1" 301
^

I can add the prefix back in with this:

 log-format "haproxy[%pid]: [%[date,ltime(%Y-%m-%dT%H:%M:%S%z)]] %{+Q}o %{-Q}ci %r %ST"

But I still get the blank space.

Any idea what's going on?

Update: Casting my mind back it looks like I must have modified your Makefile to bump the version up to 2.5. Although I don't remember doing this, I must have done because I see your releases only go up to 2.4. Is this likely related?

`make run-docker` fails on a chcon

2.2 branch. I call make run-docker, it errors out with:

 ---> Running in b3f62f9c7f8b
Removing intermediate container b3f62f9c7f8b
 ---> 53aca031e4e8
Successfully built 53aca031e4e8
Successfully tagged haproxy-rpm-builder:latest
mkdir -p RPMS
chcon -Rt svirt_sandbox_file_t RPMS
chcon: can't apply partial context to unlabeled file 'RPMS'
make: *** [Makefile:50: run-docker] Error 1

centos 7 - HSTS

first of all, great job!
I tried the rpm on mine virtual machine with CentOS 7 and SCL repos.
the proxy from the repo is 1.8.24 and facing issue about HSTS set header on frontend, same in your 2.2.4-de45672 release.
which the way to set-up haproxy redirect HTTPS with #http-response set-header Strict-Transport-Security

thanks,
Albert

Add support for Prometheus Exporter

The Prometheus Exporter PROMEX is an optional module that allows the collection of metrics by Prometheus.
This feature is supported in versions 2.0 onwards. To build it, the make command has to use an additional variable: EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o". Adding support for this should be a relatively minor change that safe us from having to edit the spec file by hand for each build.

Please add an option to build haproxy 2.0/2.1 with support for PROMEX.

VERSION selection should filter for MAINVERSION

When building 1.8, I came across the case where the VERSION returned is xceliance-20100614 instead of 1.8.30.

I would like to suggest that the pipeline include a grep "^${MAINVERSION}" before the sort -rV to limit responses to just the intended MAINVERSION. This is what I'm doing in a fork and it seems to be working as intended.

Thank you for providing this repo which has saved me so much time.

Invalid Makefile

Hi!

It seems that the latest Makefile in the default branch (2.4) has a syntax error, compilation won't start, because make throws an error:

$ make
Makefile:57: *** multiple target patterns.  Stop.

The problem is clearly caused by invalid indentation (tabs vs. spaces) at the beginning of the mentioned line.

2.2 does not build on centos 7

I get the error:

/usr/bin/install: cannot stat '/home/chickey/rpm-haproxy/rpmbuild/SOURCES/haproxy.syslog.el7.centos': No such file or directory

This is because:

%if 0%{?rhel} > 6 && 0%{!?amzn2}
    %define dist %{expand:%%(/usr/lib/rpm/redhat/dist.sh --dist)}
%endif

and:

Source4: %{name}.syslog%{?dist}

On centos 7, %{dist} is .el7.centos.

$ cat /etc/rpm/macros.dist 
# dist macros.

%centos_ver 7
%centos 7
%rhel 7
%dist .el7.centos
%el7 1

The code is from: 6e607db

According to my testing, the !? form never seems to expand to anything, at least not without a default, e.g. %{!?amzn2:foo}.

$ rpm --eval '0%{?rhel}' # this is set for me
07
$ rpm --eval '0%{!?rhel}' # this does not expand
0
$ rpm --eval '0%{?amzn2}' # this is not set for me
0
$ rpm --eval '0%{!?amzn2}' # this does not expand either
0

I can't tell what the original intent was, though. Is amzn2 supposed to have dist.sh or not?

Thanks,
Corey

Support for HAProxy 1.8.1

Do you have any idea how to support version 1.8.1?

The file haproxy-systemd-wrapper is no longer available in 1.8.1. I removed the install and chmod step in the build for it. With that I was able to build the package. However starting /usr/sbin/haproxy directly doesn't seem to work:

/usr/lib/systemd/system/haproxy.service

[Unit]
Description=HAProxy Load Balancer
After=syslog.target network.target

[Service]
ExecStart=/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed

[Install]
WantedBy=multi-user.target

backend server ssl health fails with backend server running tls v1.3

haproxy.cfg:
global
log /dev/log local0
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats

ssl-default-bind-ciphers PROFILE=SYSTEM
ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-server-ciphers ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES256:ECDH+AES128:!aNULL:!SHA1:!AESCCM
tune.ssl.default-dh-param 2048

defaults
default-server ca-file /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
log global
mode http
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout check 10s

resolvers local_resolv
parse-resolv-conf
hold valid 10s

frontend main
bind *:443 ssl crt /etc/ssl/certs/fcm.googleapis.com.pem
mode http
default_backend fcm

backend fcm
mode http
server fcm fcm.googleapis.com:443 resolvers local_resolv resolve-prefer ipv4 check ssl verify required

ha log:
[NOTICE] (27649) : New worker #1 (27651) forked
[WARNING] (27651) : Server fcm/fcm is DOWN, reason: Layer6 invalid response, info: "SSL handshake failure", check duration: 20ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[NOTICE] (27651) : haproxy version is 2.4.17-9f97155
[NOTICE] (27651) : path to executable is /usr/sbin/haproxy
[ALERT] (27651) : backend 'fcm' has no server available!

The problem can be bypassed by setting verify required to verify none. However, this does not meet our security standard.

curl -v gives:
:::

  • SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
    :::

but including the cipher suite TLS_AES_256_GCM_SHA384 and cipher ECDH+AES256 did not help.

The problem does not exist on EL7 which does not only use TLS 1.2.

wget unable to use https based proxies - swap to curl?

Would it be possible to swap to using curl rather than wget for downloads? Reason being that wget (or at least the version that's default on CentOS 7 boxes) does not seem to be capable of using https based proxy servers (i.e. http_proxy=https://whatever:3128 / https_proxy=https://whatever:3128

If this would be acceptable, I'm more than happy to submit a pull request with what I'm using locally!

Thanks for the excellent work!

yum install - Unknown operation 'try-reload-or-restart'

Hi

When I try to install my compiled haproxy 2.2.1 rpm packet on a CentOS 7 system, the packet is installing, but I am getting a warning in the post installation hook.

These are the warnings:

Unknown operation 'try-reload-or-restart'.
warning: %post(haproxy-2.2.1-1.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package haproxy-2.2.1-1.el7.x86_64

Am I doing something wrong?

# yum install haproxy-2.2.1-1.el7.x86_64.rpm
Loaded plugins: auto-update-debuginfo, fastestmirror, rhnplugin, tmprepo
This system is receiving updates from RHN Classic or Red Hat Satellite.
Examining haproxy-2.2.1-1.el7.x86_64.rpm: haproxy-2.2.1-1.el7.x86_64
Marking haproxy-2.2.1-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package haproxy.x86_64 0:2.2.1-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================
 Package                                   Arch                                     Version                                          Repository                                                     Size
=========================================================================================================================================================================================================
Installing:
 haproxy                                   x86_64                                   2.2.1-1.el7                                      /haproxy-2.2.1-1.el7.x86_64                                   4.9 M

Transaction Summary
=========================================================================================================================================================================================================
Install  1 Package

Total size: 4.9 M
Installed size: 4.9 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : haproxy-2.2.1-1.el7.x86_64                                                                                                                                                            1/1
Unknown operation 'try-reload-or-restart'.
warning: %post(haproxy-2.2.1-1.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package haproxy-2.2.1-1.el7.x86_64
  Verifying  : haproxy-2.2.1-1.el7.x86_64                                                                                                                                                            1/1

Installed:
  haproxy.x86_64 0:2.2.1-1.el7

Complete!

CentOS 7 is latest, and fully patched:

# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.