## ## haproxy.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2022 OpenPKG Project ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # package version %define V_opkg 2.5.0 %define V_dist 2.5.0 %define V_major 2.5 # package information Name: haproxy Summary: High-Availability TCP Proxy URL: http://www.haproxy.org/ Vendor: Willy Tarreau Packager: OpenPKG Project Distribution: OpenPKG Community Class: BASE Group: Networking License: GPL/LGPL Version: %{V_opkg} Release: 20211123 # package options %option with_fsl yes %option with_ssl yes %option with_zlib yes %option with_lua yes %option with_pcre yes %option with_cli yes # list of sources Source0: http://www.haproxy.org/download/%{V_major}/src/haproxy-%{V_dist}.tar.gz Source1: haproxy-cli.sh Source2: haproxy.cfg Source3: fsl.haproxy Source4: rc.haproxy Patch0: haproxy.patch # build information BuildPreReq: OpenPKG, openpkg >= 20160101, make PreReq: OpenPKG, openpkg >= 20160101 %if "%{with_fsl}" == "yes" BuildPreReq: fsl PreReq: fsl %endif %if "%{with_ssl}" == "yes" BuildPreReq: openssl PreReq: openssl %endif %if "%{with_zlib}" == "yes" BuildPreReq: zlib PreReq: zlib %endif %if "%{with_lua}" == "yes" BuildPreReq: lua PreReq: lua %endif %if "%{with_pcre}" == "yes" BuildPreReq: pcre PreReq: pcre %endif %if "%{with_cli}" == "yes" PreReq: socat %endif %description HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. %track prog haproxy = { version = %{V_dist} url = http://www.haproxy.org/ regex = haproxy-(__VER__)\.tar\.gz } %prep %setup -q -n haproxy-%{V_dist} %patch -p0 %build # build program target="generic" case "%{l_platform -t}" in *-freebsd* ) target="freebsd" ;; *-linux* ) target="linux2628" ;; *-sunos* ) target="solaris" ;; esac %{l_make} %{l_mflags} \ TARGET=$target \ CC="%{l_cc} %{l_cflags -O}" \ ADDINC="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ ADDLIB="%{l_fsl_ldflags} %{l_fsl_libs}" \ %if "%{with_ssl}" == "yes" USE_OPENSSL=1 \ SSL_INC=%{l_prefix}/include \ SSL_LIB=%{l_prefix}/lib \ %endif %if "%{with_zlib}" == "yes" USE_ZLIB=1 \ ZLIB_INC=%{l_prefix}/include \ ZLIB_LIB=%{l_prefix}/lib \ %endif %if "%{with_lua}" == "yes" USE_LUA=1 \ LUA_INC=%{l_prefix}/include/lua \ LUA_LIB=%{l_prefix}/lib \ %endif %if "%{with_pcre}" == "yes" USE_PCRE=1 \ PCRE_INC=%{l_prefix}/include \ PCRE_LIB=%{l_prefix}/lib \ USE_STATIC_PCRE=1 %endif %install # create installation hierarchy %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/sbin \ $RPM_BUILD_ROOT%{l_prefix}/man/cat1 \ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ $RPM_BUILD_ROOT%{l_prefix}/etc/haproxy \ $RPM_BUILD_ROOT%{l_prefix}/var/haproxy/log \ $RPM_BUILD_ROOT%{l_prefix}/var/haproxy/run # install program %{l_shtool} install -c -s -m 755 \ haproxy $RPM_BUILD_ROOT%{l_prefix}/sbin/ %{l_shtool} install -c -m 644 \ doc/configuration.txt $RPM_BUILD_ROOT%{l_prefix}/man/cat1/haproxy.1 # install cli %if "%{with_cli}" == "yes" %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE haproxy-cli.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/haproxy-cli %endif # install default configuration %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE haproxy.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/haproxy/ # install run-command script %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE rc.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ # install OSSP fsl configuration %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE fsl.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%config %{l_prefix}/etc/haproxy/*' \ '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/haproxy' \ '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/haproxy/*' %files -f files %clean