openssl.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. ##
  2. ## openssl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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: openssl
  26. Summary: Cryptography and SSL/TLS Toolkit
  27. URL: http://www.openssl.org/
  28. Vendor: The OpenSSL Project
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: CORE
  32. Group: SSL
  33. License: BSD-style
  34. Version: 0.9.8e
  35. Release: 20070223
  36. # package options
  37. %option with_zlib no
  38. %option with_idea no
  39. %option with_threads no
  40. %option with_pic no
  41. # list of sources
  42. Source0: ftp://ftp.openssl.org/source/openssl-%{version}.tar.gz
  43. Patch0: openssl.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, make, gcc
  48. PreReq: OpenPKG, openpkg >= 20040130
  49. %if "%{with_zlib}" == "yes"
  50. BuildPreReq: zlib
  51. PreReq: zlib
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. The OpenSSL Project is a collaborative effort to develop a robust,
  57. commercial-grade, full-featured, and Open Source toolkit implementing the
  58. Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
  59. protocols with full-strength cryptography world-wide. The project is
  60. managed by a worldwide community of volunteers that use the Internet to
  61. communicate, plan, and develop the OpenSSL tookit and its related
  62. documentation.
  63. %track
  64. prog openssl = {
  65. version = %{version}
  66. url = ftp://ftp.openssl.org/source/
  67. regex = openssl-(\d+\.\d+\.\d+[a-z]?)\.tar\.gz
  68. }
  69. %prep
  70. %setup -q
  71. %patch -p0
  72. %{l_shtool} subst \
  73. -e 's;-m486;-march=i486;g' \
  74. -e 's;-DZLIB;%{l_cppflags} -DZLIB;' \
  75. -e 's;-lz;%{l_ldflags} -lz;' \
  76. Configure
  77. %{l_shtool} subst \
  78. -e 's;BN_LLONG *;;' \
  79. Configure
  80. %{l_shtool} subst \
  81. -e 's;test "$OSTYPE" = msdosdjgpp;true;' \
  82. util/point.sh
  83. %{l_shtool} subst \
  84. -e 's;^\(#define DEVRANDOM_EGD\);\1 "%{l_prefix}/var/prngd/prngd.socket",;' \
  85. e_os.h
  86. %build
  87. %{l_prefix}/bin/perl util/perlpath.pl %{l_prefix}/bin/perl
  88. options="no-shared no-dso"
  89. %if "%{with_pic}" == "yes"
  90. options="$options -fPIC"
  91. case "%{l_platform -t}" in
  92. amd64-* ) options="$options no-asm" ;;
  93. sparc64-freebsd* ) options="$options no-asm" ;;
  94. esac
  95. %else
  96. case "%{l_platform -t}" in
  97. amd64-* ) options="$options -fPIC no-asm" ;;
  98. ia64-* ) options="$options -fPIC" ;;
  99. sparc64-freebsd* ) options="$options -fPIC no-asm" ;;
  100. esac
  101. %endif
  102. %if "%{with_zlib}" == "yes"
  103. options="$options zlib"
  104. %else
  105. options="$options no-zlib"
  106. %endif
  107. %if "%{with_idea}" != "yes"
  108. options="$options no-idea"
  109. %endif
  110. %if "%{with_threads}" == "yes"
  111. options="$options threads"
  112. %else
  113. options="$options no-threads"
  114. %endif
  115. PERL=%{l_prefix}/bin/perl \
  116. ./config \
  117. --prefix=%{l_prefix} \
  118. --openssldir=%{l_prefix}/etc/openssl \
  119. $options
  120. %{l_make} %{l_mflags}
  121. %install
  122. rm -rf $RPM_BUILD_ROOT
  123. %{l_make} %{l_mflags} install INSTALL_PREFIX=$RPM_BUILD_ROOT
  124. strip $RPM_BUILD_ROOT%{l_prefix}/bin/openssl >/dev/null 2>&1 || true
  125. ( cd $RPM_BUILD_ROOT%{l_prefix}
  126. rm -f bin/c_rehash
  127. rmdir lib/engines
  128. rm -rf etc/openssl/private
  129. rm -rf etc/openssl/certs
  130. rm -rf etc/openssl/misc
  131. rm -rf etc/openssl/lib
  132. mv etc/openssl/man man
  133. cd man
  134. for dir in man[1-9]; do
  135. for file in `cd $dir; echo *`; do
  136. mv $dir/$file $dir/openssl_$file
  137. done
  138. done
  139. ) || exit $?
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  141. %{l_files_std} \
  142. '%config %{l_prefix}/etc/openssl/openssl.cnf' \
  143. '%not %dir %{l_prefix}/lib/pkgconfig'
  144. %files -f files
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT