## ## haproxy.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. ## ## 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_major 1.4 %define V_minor 10 # package information Name: haproxy Summary: Hight-Availability TCP Proxy URL: http://haproxy.1wt.eu/ Vendor: Willy Tarreau Packager: OpenPKG Foundation e.V. Distribution: OpenPKG Community Class: BASE Group: Networking License: GPL/LGPL Version: %{V_major}.%{V_minor} Release: 20101129 # package options %option with_fsl yes # list of sources Source0: http://haproxy.1wt.eu/download/%{V_major}/src/haproxy-%{version}.tar.gz Source1: haproxy.cfg Source2: fsl.haproxy Source3: rc.haproxy # build information BuildPreReq: OpenPKG, openpkg >= 20100101, make PreReq: OpenPKG, openpkg >= 20100101 %if "%{with_fsl}" == "yes" BuildPreReq: fsl PreReq: fsl %endif BuildPreReq: pcre PreReq: pcre %description ? %track prog haproxy = { version = %{version} url = http://haproxy.1wt.eu/ regex = haproxy-(__VER__)\.tar\.gz } %prep %setup -q %build # build program target="generic" case "%{l_platform -t}" in *-freebsd* ) target="freebsd" ;; *-linux* ) target="linux26" ;; *-sunos* ) target="solaris" ;; esac %{l_make} %{l_mflags} \ TARGET=$target \ CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \ LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ ADDLIB="%{l_fsl_libs}" \ USE_STATIC_PCRE=1 %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 # 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 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' %files -f files %clean