You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
5.6 KiB

16 years ago
##
## haproxy.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2020 OpenPKG Project <http://openpkg.org/>
16 years ago
##
## 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.1.3
%define V_dist 2.1.3
%define V_major 2.1
16 years ago
# package information
Name: haproxy
10 years ago
Summary: High-Availability TCP Proxy
URL: http://www.haproxy.org/
16 years ago
Vendor: Willy Tarreau
Packager: OpenPKG Project
16 years ago
Distribution: OpenPKG Community
Class: BASE
Group: Networking
License: GPL/LGPL
Version: %{V_opkg}
Release: 20200213
16 years ago
# 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
16 years ago
# 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
16 years ago
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101, make
PreReq: OpenPKG, openpkg >= 20160101
16 years ago
%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
16 years ago
%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.
16 years ago
%track
prog haproxy = {
version = %{V_dist}
url = http://www.haproxy.org/
16 years ago
regex = haproxy-(__VER__)\.tar\.gz
}
%prep
%setup -q -n haproxy-%{V_dist}
%patch -p0
16 years ago
%build
# build program
target="generic"
case "%{l_platform -t}" in
*-freebsd* ) target="freebsd" ;;
*-linux* ) target="linux2628" ;;
*-sunos* ) target="solaris" ;;
16 years ago
esac
%{l_make} %{l_mflags} \
TARGET=$target \
CC="%{l_cc} %{l_cflags -O}" \
ADDINC="%{l_cppflags}" \
13 years ago
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 \
16 years ago
USE_STATIC_PCRE=1
%endif
16 years ago
%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
16 years ago
# 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
16 years ago
# 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/*'
16 years ago
%files -f files
%clean