haproxy.spec 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ##
  2. ## haproxy.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_major 1.4
  25. %define V_minor 11
  26. # package information
  27. Name: haproxy
  28. Summary: Hight-Availability TCP Proxy
  29. URL: http://haproxy.1wt.eu/
  30. Vendor: Willy Tarreau
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: BASE
  34. Group: Networking
  35. License: GPL/LGPL
  36. Version: %{V_major}.%{V_minor}
  37. Release: 20110211
  38. # package options
  39. %option with_fsl yes
  40. # list of sources
  41. Source0: http://haproxy.1wt.eu/download/%{V_major}/src/haproxy-%{version}.tar.gz
  42. Source1: haproxy.cfg
  43. Source2: fsl.haproxy
  44. Source3: rc.haproxy
  45. # build information
  46. BuildPreReq: OpenPKG, openpkg >= 20100101, make
  47. PreReq: OpenPKG, openpkg >= 20100101
  48. %if "%{with_fsl}" == "yes"
  49. BuildPreReq: fsl
  50. PreReq: fsl
  51. %endif
  52. BuildPreReq: pcre
  53. PreReq: pcre
  54. %description
  55. ?
  56. %track
  57. prog haproxy = {
  58. version = %{version}
  59. url = http://haproxy.1wt.eu/
  60. regex = haproxy-(__VER__)\.tar\.gz
  61. }
  62. %prep
  63. %setup -q
  64. %build
  65. # build program
  66. target="generic"
  67. case "%{l_platform -t}" in
  68. *-freebsd* ) target="freebsd" ;;
  69. *-linux* ) target="linux26" ;;
  70. *-sunos* ) target="solaris" ;;
  71. esac
  72. %{l_make} %{l_mflags} \
  73. TARGET=$target \
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags -O}" \
  76. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  77. ADDLIB="%{l_fsl_libs}" \
  78. USE_STATIC_PCRE=1
  79. %install
  80. # create installation hierarchy
  81. %{l_shtool} mkdir -f -p -m 755 \
  82. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  83. $RPM_BUILD_ROOT%{l_prefix}/man/cat1 \
  84. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/haproxy \
  87. $RPM_BUILD_ROOT%{l_prefix}/var/haproxy
  88. # install program
  89. %{l_shtool} install -c -s -m 755 \
  90. haproxy $RPM_BUILD_ROOT%{l_prefix}/sbin/
  91. %{l_shtool} install -c -m 644 \
  92. doc/configuration.txt $RPM_BUILD_ROOT%{l_prefix}/man/cat1/haproxy.1
  93. # install default configuration
  94. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  95. %{SOURCE haproxy.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/haproxy/
  96. # install run-command script
  97. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  98. %{SOURCE rc.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  99. # install OSSP fsl configuration
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE fsl.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  102. # determine installation files
  103. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  104. %{l_files_std} \
  105. '%config %{l_prefix}/etc/haproxy/*' \
  106. '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/haproxy'
  107. %files -f files
  108. %clean