stunnel.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. Source4: stunnel.conf
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  48. PreReq: OpenPKG, openpkg >= 20040130
  49. BuildPreReq: openssl
  50. PreReq: openssl
  51. %if "%{with_fsl}" == "yes"
  52. BuildPreReq: fsl >= 1.2.0
  53. PreReq: fsl >= 1.2.0
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. The Stunnel program is designed to work as SSL encryption wrapper
  59. between remote client and local (inetd-startable) or remote server.
  60. The concept is that having non-SSL aware daemons running on your
  61. system you can easily setup them to communicate with clients over
  62. secure SSL channel. Stunnel can be used to add SSL functionality
  63. to commonly used inetd daemons like POP-2, POP-3 and IMAP servers
  64. without any changes in the programs' code.
  65. %track
  66. prog stunnel = {
  67. version = %{version}
  68. url = http://www.stunnel.org/download/stunnel/src/
  69. regex = stunnel-(__VER__)\.tar\.gz
  70. }
  71. %prep
  72. %setup -q
  73. %build
  74. # FIXME: disable Pthread usage to workaround segfaults
  75. # at configure time under at least FreeBSD 5.2
  76. echo "ac_cv_header_pthread_h=no" >config.cache
  77. %{l_shtool} subst \
  78. -e 's;-lpthread;-lnotexisting;g' \
  79. configure
  80. CC="%{l_cc}" \
  81. CFLAGS="%{l_cflags -O}" \
  82. LDFLAGS="%{l_fsl_ldflags}" \
  83. LIBS="%{l_fsl_libs}" \
  84. ./configure \
  85. --cache-file=./config.cache \
  86. --prefix=%{l_prefix} \
  87. --with-ssl=%{l_prefix} \
  88. --disable-shared
  89. cp %{SOURCE stunnel.pem} tools/
  90. %{l_make} %{l_mflags}
  91. %install
  92. rm -rf $RPM_BUILD_ROOT
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/var/stunnel
  95. %{l_make} %{l_mflags} install prefix=$RPM_BUILD_ROOT%{l_prefix}
  96. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  97. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/stunnel.*.8
  99. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf-sample
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE stunnel.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/
  102. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  103. # install run-command script
  104. %{l_shtool} mkdir -f -p -m 755 \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  106. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  107. %{SOURCE rc.stunnel} \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  109. # install OSSP fsl configuration
  110. %{l_shtool} mkdir -f -p -m 755 \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  112. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  113. %{SOURCE fsl.stunnel} \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  115. # determine installation files
  116. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  117. %{l_files_std} \
  118. '%not %dir %{l_prefix}/etc/fsl' \
  119. '%config %{l_prefix}/etc/stunnel/stunnel.*' \
  120. '%config %{l_prefix}/etc/fsl/fsl.stunnel' \
  121. '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/stunnel'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT