gnupg.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## gnupg.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: gnupg
  26. Summary: GNU Privacy Guard
  27. URL: http://www.gnupg.org/
  28. Vendor: Werner Koch
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: BASE
  32. Group: Cryptography
  33. License: GPL
  34. Version: 1.4.5
  35. Release: 20060801
  36. # package options
  37. %option with_curl no
  38. %option with_idea no
  39. %option with_ldap no
  40. # list of sources
  41. Source0: ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-%{version}.tar.gz
  42. Source1: ftp://ftp.gnupg.dk/pub/contrib-dk/idea.c.gz
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  47. PreReq: OpenPKG, openpkg >= 20040130
  48. BuildPreReq: zlib, bzip2, readline
  49. PreReq: zlib, bzip2, readline
  50. %if "%{with_curl}" == "yes"
  51. BuildPreReq: curl, openssl
  52. PreReq: curl, openssl
  53. %endif
  54. %if "%{with_ldap}" == "yes"
  55. BuildPreReq: openldap, openssl
  56. PreReq: openldap, openssl
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. GnuPG (GNU Privacy Guard) is a GNU utility for encrypting data and
  62. creating digital signatures. GnuPG has advanced key management
  63. capabilities and is compliant with the proposed OpenPGP Internet
  64. standard described in RFC2440. Since GnuPG doesn't use any patented
  65. algorithm, it is not compatible with any version of PGP2 (PGP2.x
  66. uses only IDEA, patented worldwide).
  67. %track
  68. prog gnupg = {
  69. version = %{version}
  70. url = ftp://ftp.gnupg.org/gcrypt/gnupg/
  71. regex = gnupg-(__VER__)\.tar\.gz
  72. }
  73. %prep
  74. %setup -q
  75. %if "%{with_idea}" == "yes"
  76. %{l_gzip} -d -c %{SOURCE idea.c.gz} >cipher/idea.c
  77. %endif
  78. %build
  79. LIBS=""
  80. echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c
  81. for lib in termcap termlib curses ncurses; do
  82. rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1
  83. if [ $rc -eq 0 ]; then LIBS="$LIBS -l$lib"; break; fi
  84. done
  85. %if "%{with_ldap}" == "yes" || "%{with_curl}" == "yes"
  86. LIBS="$LIBS -lssl -lcrypto"
  87. %endif
  88. %if "%{with_curl}" == "yes"
  89. LIBS="$LIBS -lz"
  90. %endif
  91. CC="%{l_cc}" \
  92. CFLAGS="%{l_cflags -O}" \
  93. CPPFLAGS="%{l_cppflags}" \
  94. LDFLAGS="%{l_ldflags}" \
  95. LIBS="$LIBS" \
  96. ./configure \
  97. --prefix=%{l_prefix} \
  98. --with-zlib=%{l_prefix} \
  99. --with-bzip2=%{l_prefix} \
  100. --with-readline=%{l_prefix} \
  101. %if "%{with_curl}" == "yes"
  102. --with-libcurl=%{l_prefix} \
  103. %else
  104. --without-libcurl \
  105. %endif
  106. --enable-exec \
  107. --enable-keyserver-helpers \
  108. --with-mailprog="%{l_prefix}/sbin/sendmail" \
  109. %if "%{with_ldap}" == "yes"
  110. --enable-ldap \
  111. %else
  112. --disable-ldap \
  113. %endif
  114. --enable-finger \
  115. --enable-http \
  116. --enable-hkp \
  117. --disable-mailto \
  118. --disable-gnupg-iconv \
  119. --without-included-gettext \
  120. --disable-nls
  121. %{l_make} %{l_mflags}
  122. %install
  123. rm -rf $RPM_BUILD_ROOT
  124. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  125. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  126. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/gnupg/* 2>/dev/null || true
  127. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  128. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  129. %{l_files_std} \
  130. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg'
  131. %files -f files
  132. %clean
  133. rm -rf $RPM_BUILD_ROOT