pound.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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: 20030628
  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, openssl, openssl::with_threads = yes, pth, pth::with_pthread = yes, pcre
  48. PreReq: OpenPKG, openpkg >= 20030415
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. The Pound program is a reverse proxy, load balancer and HTTPS
  57. front-end for Web server(s). Pound was developed to enable
  58. distributing the load among several Web-servers and to allow for a
  59. convenient SSL wrapper for those Web servers that do not offer it
  60. natively.
  61. %prep
  62. %setup -q -n Pound-%{version}
  63. # force to use PCRE instead of vendor regex(3)
  64. %{l_shtool} subst \
  65. -e 's;regex\.h;pcreposix.h;' \
  66. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  67. configure
  68. %{l_shtool} subst \
  69. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  70. config.h.in
  71. %{l_shtool} subst \
  72. -e 's;HAVE_REGEX_H;HAVE_PCREPOSIX_H;' \
  73. -e 's;<regex\.h>;<pcreposix.h>;' \
  74. pound.h
  75. # adjust hard-coded paths
  76. %{l_shtool} subst \
  77. -e 's;/usr/local/etc/pound/pound.cfg;%{l_prefix}/etc/pound/pound.cfg;' \
  78. -e 's;/var/run/pound.pid;%{l_prefix}/var/pound/pound.pid;' \
  79. Makefile.in pound.8 pound.c
  80. %build
  81. # configure package
  82. CC="%{l_cc}" \
  83. CFLAGS="%{l_cflags -O} `%{l_prefix}/bin/pthread-config --all --cflags`" \
  84. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/pthread-config --all --ldflags`" \
  85. LIBS="`%{l_prefix}/bin/pthread-config --all --libs` %{l_fsl_libs} -lpcreposix -lpcre" \
  86. ./configure \
  87. --prefix=%{l_prefix} \
  88. --sysconfdir=%{l_prefix}/etc/pound \
  89. --with-ssl=%{l_prefix}
  90. # build package
  91. %{l_make} %{l_mflags -O}
  92. %install
  93. rm -rf $RPM_BUILD_ROOT
  94. # create installation hierarchy
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  97. $RPM_BUILD_ROOT%{l_prefix}/etc/pound \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  99. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  100. $RPM_BUILD_ROOT%{l_prefix}/var/pound
  101. # install program and manual page
  102. %{l_shtool} install -c -s -m 755 \
  103. pound $RPM_BUILD_ROOT%{l_prefix}/sbin/
  104. %{l_shtool} install -c -m 644 \
  105. pound.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  106. # install default configuration
  107. %{l_shtool} install -c -m 644 \
  108. -e 's;@l_prefix@;%{l_prefix};g' \
  109. -e 's;@l_nusr@;%{l_nusr};g' \
  110. -e 's;@l_ngrp@;%{l_ngrp};g' \
  111. %{SOURCE pound.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/pound/
  112. %{l_shtool} install -c -m 644 \
  113. %{SOURCE pound.pem} $RPM_BUILD_ROOT%{l_prefix}/etc/pound/
  114. # install run-command script
  115. %{l_shtool} install -c -m 755 \
  116. -e 's;@l_prefix@;%{l_prefix};g' \
  117. -e 's;@l_susr@;%{l_susr};g' \
  118. -e 's;@l_rusr@;%{l_rusr};g' \
  119. -e 's;@l_rgrp@;%{l_rgrp};g' \
  120. %{SOURCE rc.pound} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  121. # OSSP fake syslog library
  122. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  123. %{l_shtool} install -c -m 644 \
  124. -e 's;@l_prefix@;%{l_prefix};g' \
  125. %{SOURCE fsl.%{name}} \
  126. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  127. # determine installation files
  128. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  129. %{l_files_std} \
  130. '%not %dir %{l_prefix}/etc/fsl' \
  131. '%config %{l_prefix}/etc/fsl/fsl.%{name}' \
  132. '%config %{l_prefix}/etc/pound/*'
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT