pound.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. ##
  2. ## pound.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: pound
  27. Summary: HTTP/HTTPS Reverse Proxy
  28. URL: http://www.apsis.ch/pound/
  29. Vendor: APSIS
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Web
  33. License: GPL
  34. Version: 1.4
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://www.apsis.ch/pound/Pound-%{version}.tgz
  40. Source1: pound.cfg
  41. Source2: pound.pem
  42. Source3: rc.pound
  43. Source4: fsl.pound
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030415
  48. PreReq: OpenPKG, openpkg >= 20030415
  49. BuildPreReq: pcre, openssl, openssl::with_threads = yes
  50. PreReq: pcre, openssl, openssl::with_threads = yes
  51. BuildPreReq: pth, pth::with_pthread = yes
  52. PreReq: pth, pth::with_pthread = yes
  53. %if "%{with_fsl}" == "yes"
  54. BuildPreReq: fsl
  55. PreReq: fsl
  56. %endif
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. The Pound program is a reverse proxy, load balancer and HTTPS
  61. front-end for Web server(s). Pound was developed to enable
  62. distributing the load among several Web-servers and to allow for a
  63. convenient SSL wrapper for those Web servers that do not offer it
  64. natively.
  65. %prep
  66. %setup -q -n Pound-%{version}
  67. # force to use PCRE instead of vendor regex(3)
  68. %{l_shtool} subst \
  69. -e 's;regex\.h;pcreposix.h;' \
  70. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  71. configure
  72. %{l_shtool} subst \
  73. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  74. config.h.in
  75. %{l_shtool} subst \
  76. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  77. -e 's;<regex\.h>;<pcreposix.h>;' \
  78. pound.h
  79. # adjust hard-coded paths
  80. %{l_shtool} subst \
  81. -e 's;/usr/local/etc/pound/pound.cfg;%{l_prefix}/etc/pound/pound.cfg;' \
  82. -e 's;/var/run/pound.pid;%{l_prefix}/var/pound/pound.pid;' \
  83. Makefile.in pound.8 pound.c
  84. %build
  85. # configure package
  86. CC="%{l_cc}" \
  87. CFLAGS="%{l_cflags -O} `%{l_prefix}/bin/pthread-config --all --cflags`" \
  88. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/pthread-config --all --ldflags`" \
  89. LIBS="`%{l_prefix}/bin/pthread-config --all --libs` %{l_fsl_libs} -lpcreposix -lpcre" \
  90. ./configure \
  91. --prefix=%{l_prefix} \
  92. --sysconfdir=%{l_prefix}/etc/pound \
  93. --with-ssl=%{l_prefix}
  94. # build package
  95. %{l_make} %{l_mflags -O}
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. # create installation hierarchy
  99. %{l_shtool} mkdir -f -p -m 755 \
  100. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  101. $RPM_BUILD_ROOT%{l_prefix}/etc/pound \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  103. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  104. $RPM_BUILD_ROOT%{l_prefix}/var/pound
  105. # install program and manual page
  106. %{l_shtool} install -c -s -m 755 \
  107. pound $RPM_BUILD_ROOT%{l_prefix}/sbin/
  108. %{l_shtool} install -c -m 644 \
  109. pound.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  110. # install default configuration
  111. %{l_shtool} install -c -m 644 \
  112. -e 's;@l_prefix@;%{l_prefix};g' \
  113. -e 's;@l_nusr@;%{l_nusr};g' \
  114. -e 's;@l_ngrp@;%{l_ngrp};g' \
  115. %{SOURCE pound.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/pound/
  116. %{l_shtool} install -c -m 644 \
  117. %{SOURCE pound.pem} $RPM_BUILD_ROOT%{l_prefix}/etc/pound/
  118. # install run-command script
  119. %{l_shtool} install -c -m 755 \
  120. -e 's;@l_prefix@;%{l_prefix};g' \
  121. -e 's;@l_susr@;%{l_susr};g' \
  122. -e 's;@l_rusr@;%{l_rusr};g' \
  123. -e 's;@l_rgrp@;%{l_rgrp};g' \
  124. %{SOURCE rc.pound} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  125. # install OSSP fsl configuration
  126. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  127. %{l_shtool} install -c -m 644 \
  128. -e 's;@l_prefix@;%{l_prefix};g' \
  129. %{SOURCE fsl.pound} \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  131. # determine installation files
  132. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  133. %{l_files_std} \
  134. '%not %dir %{l_prefix}/etc/fsl' \
  135. '%config %{l_prefix}/etc/fsl/fsl.pound' \
  136. '%config %{l_prefix}/etc/pound/*'
  137. %files -f files
  138. %clean
  139. rm -rf $RPM_BUILD_ROOT