stunnel.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ##
  2. ## stunnel.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: stunnel
  26. Summary: SSL/TLS Tunneling Tool
  27. URL: http://www.stunnel.org/
  28. Vendor: Michal Trojnara
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: BASE
  32. Group: Network
  33. License: GPL
  34. Version: 4.08
  35. Release: 20050413
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://www.stunnel.org/download/stunnel/src/stunnel-%{version}.tar.gz
  40. Source1: stunnel.pem
  41. Source2: rc.stunnel
  42. Source3: fsl.stunnel
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  47. PreReq: OpenPKG, openpkg >= 20040130
  48. BuildPreReq: openssl
  49. PreReq: openssl
  50. %if "%{with_fsl}" == "yes"
  51. BuildPreReq: fsl >= 1.2.0
  52. PreReq: fsl >= 1.2.0
  53. %endif
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. The Stunnel program is designed to work as SSL encryption wrapper
  58. between remote client and local (inetd-startable) or remote server.
  59. The concept is that having non-SSL aware daemons running on your
  60. system you can easily setup them to communicate with clients over
  61. secure SSL channel. Stunnel can be used to add SSL functionality
  62. to commonly used inetd daemons like POP-2, POP-3 and IMAP servers
  63. without any changes in the programs' code.
  64. %track
  65. prog stunnel = {
  66. version = %{version}
  67. url = http://www.stunnel.org/download/stunnel/src/
  68. regex = stunnel-(__VER__)\.tar\.gz
  69. }
  70. %prep
  71. %setup -q
  72. %build
  73. # FIXME: disable Pthread usage to workaround segfaults
  74. # at configure time under at least FreeBSD 5.2
  75. echo "ac_cv_header_pthread_h=no" >config.cache
  76. %{l_shtool} subst \
  77. -e 's;-lpthread;-lnotexisting;g' \
  78. configure
  79. CC="%{l_cc}" \
  80. CFLAGS="%{l_cflags -O}" \
  81. LDFLAGS="%{l_fsl_ldflags}" \
  82. LIBS="%{l_fsl_libs}" \
  83. ./configure \
  84. --cache-file=./config.cache \
  85. --prefix=%{l_prefix} \
  86. --with-ssl=%{l_prefix} \
  87. --disable-shared
  88. cp %{SOURCE stunnel.pem} tools/
  89. %{l_make} %{l_mflags}
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/var/stunnel
  94. %{l_make} %{l_mflags} install prefix=$RPM_BUILD_ROOT%{l_prefix}
  95. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  96. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/stunnel.*.8
  97. mv $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf-sample \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf
  99. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  100. # install run-command script
  101. %{l_shtool} mkdir -f -p -m 755 \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  103. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  104. %{SOURCE rc.stunnel} \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  106. # install OSSP fsl configuration
  107. %{l_shtool} mkdir -f -p -m 755 \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. %{SOURCE fsl.stunnel} \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  112. # determine installation files
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  114. %{l_files_std} \
  115. '%not %dir %{l_prefix}/etc/fsl' \
  116. '%config %{l_prefix}/etc/stunnel/stunnel.*' \
  117. '%config %{l_prefix}/etc/fsl/fsl.stunnel'
  118. %files -f files
  119. %clean
  120. rm -rf $RPM_BUILD_ROOT