stunnel.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. ##
  2. ## stunnel.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 information
  24. Name: stunnel
  25. Summary: SSL/TLS Tunneling Tool
  26. URL: http://www.stunnel.org/
  27. Vendor: Michal Trojnara
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: SSL
  32. License: GPL
  33. Version: 4.34
  34. Release: 20110323
  35. # package options
  36. %option with_fsl yes
  37. %option with_wrap no
  38. # list of sources
  39. Source0: ftp://ftp.stunnel.org/stunnel/stunnel-%{version}.tar.gz
  40. Source1: stunnel.pem
  41. Source2: rc.stunnel
  42. Source3: fsl.stunnel
  43. Source4: stunnel.conf
  44. Patch0: stunnel.patch
  45. # build information
  46. BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make
  47. PreReq: OpenPKG, openpkg >= 20100101
  48. BuildPreReq: openssl
  49. PreReq: openssl
  50. %if "%{with_fsl}" == "yes"
  51. BuildPreReq: fsl
  52. PreReq: fsl
  53. %endif
  54. %if "%{with_wrap}" == "yes"
  55. BuildPreReq: tcpwrappers
  56. PreReq: tcpwrappers
  57. %endif
  58. %description
  59. The Stunnel program is designed to work as SSL encryption wrapper
  60. between remote client and local (inetd-startable) or remote server.
  61. The concept is that having non-SSL aware daemons running on your
  62. system you can easily setup them to communicate with clients over
  63. secure SSL channel. Stunnel can be used to add SSL functionality
  64. to commonly used inetd daemons like POP-2, POP-3 and IMAP servers
  65. without any changes in the programs' code.
  66. %track
  67. prog stunnel = {
  68. version = %{version}
  69. url = ftp://ftp.stunnel.org/stunnel/
  70. regex = stunnel-(\d+\.\d+(\.\d+)?)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q
  74. %patch -p0
  75. %build
  76. CC="%{l_cc}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. LDFLAGS="%{l_fsl_ldflags}" \
  79. LIBS="%{l_fsl_libs}" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --bindir=%{l_prefix}/sbin \
  83. --mandir=%{l_prefix}/man \
  84. --with-ssl=%{l_prefix} \
  85. --with-threads=fork \
  86. %if "%{with_wrap}" != "yes"
  87. --disable-libwrap \
  88. %endif
  89. --disable-shared
  90. %{l_make} %{l_mflags -O}
  91. %install
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/var/stunnel
  94. %{l_shtool} subst \
  95. -e 's;uname | grep SunOS;false;g' \
  96. tools/Makefile
  97. %{l_make} %{l_mflags} install \
  98. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" </dev/null
  99. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  100. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/lib
  101. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  102. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/stunnel.*.8
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf-sample
  104. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  105. %{SOURCE stunnel.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/
  106. %{l_shtool} install -c -m 600 \
  107. %{SOURCE stunnel.pem} $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/
  108. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  109. # install run-command script
  110. %{l_shtool} mkdir -f -p -m 755 \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  112. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  113. %{SOURCE rc.stunnel} \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  115. # install OSSP fsl configuration
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  118. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  119. %{SOURCE fsl.stunnel} \
  120. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  121. # determine installation files
  122. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  123. %{l_files_std} \
  124. '%config %{l_prefix}/etc/stunnel/stunnel.*' \
  125. '%config %{l_prefix}/etc/fsl/fsl.stunnel' \
  126. '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/stunnel'
  127. %files -f files
  128. %clean