stunnel.spec 4.9 KB

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