openssl.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ##
  2. ## openssl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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
  30. Distribution: OpenPKG
  31. Class: CORE
  32. Group: Cryptography
  33. License: BSD-style
  34. Version: 0.9.8c
  35. Release: 20060905
  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. esac
  94. %else
  95. case "%{l_platform -t}" in
  96. amd64-* ) options="$options -fPIC no-asm" ;;
  97. ia64-* ) options="$options -fPIC" ;;
  98. esac
  99. %endif
  100. %if "%{with_zlib}" == "yes"
  101. options="$options zlib"
  102. %else
  103. options="$options no-zlib"
  104. %endif
  105. %if "%{with_idea}" != "yes"
  106. options="$options no-idea"
  107. %endif
  108. %if "%{with_threads}" == "yes"
  109. options="$options threads"
  110. %else
  111. options="$options no-threads"
  112. %endif
  113. PERL=%{l_prefix}/bin/perl \
  114. ./config \
  115. --prefix=%{l_prefix} \
  116. --openssldir=%{l_prefix}/etc/openssl \
  117. $options
  118. %{l_make} %{l_mflags}
  119. %install
  120. rm -rf $RPM_BUILD_ROOT
  121. %{l_make} %{l_mflags} install INSTALL_PREFIX=$RPM_BUILD_ROOT
  122. strip $RPM_BUILD_ROOT%{l_prefix}/bin/openssl >/dev/null 2>&1 || true
  123. ( cd $RPM_BUILD_ROOT%{l_prefix}
  124. rm -f bin/c_rehash
  125. rmdir lib/engines
  126. rm -rf etc/openssl/private
  127. rm -rf etc/openssl/certs
  128. rm -rf etc/openssl/misc
  129. rm -rf etc/openssl/lib
  130. mv etc/openssl/man man
  131. cd man
  132. for dir in man[1-9]; do
  133. for file in `cd $dir; echo *`; do
  134. mv $dir/$file $dir/openssl_$file
  135. done
  136. done
  137. ) || exit $?
  138. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  139. %{l_files_std} \
  140. '%config %{l_prefix}/etc/openssl/openssl.cnf' \
  141. '%not %dir %{l_prefix}/lib/pkgconfig'
  142. %files -f files
  143. %clean
  144. rm -rf $RPM_BUILD_ROOT