gnupg2.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ##
  2. ## gnupg2.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: gnupg2
  26. Summary: GNU Privacy Guard
  27. URL: http://www.gnupg.org/
  28. Vendor: Werner Koch
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: PGP
  33. License: GPL
  34. Version: 2.0.4
  35. Release: 20070509
  36. # package options
  37. %option with_curl yes
  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.bz2
  42. Source1: ftp://ftp.gnupg.dk/pub/contrib-dk/idea.c.gz
  43. Patch0: gnupg2.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  48. PreReq: OpenPKG, openpkg >= 20040130, pinentry
  49. BuildPreReq: gcrypt, libksba, libassuan, gpg-error, zlib, bzip2, readline, pth, libiconv
  50. PreReq: gcrypt, libksba, libassuan, gpg-error, zlib, bzip2, readline, pth, libiconv
  51. %if "%{with_curl}" == "yes"
  52. BuildPreReq: curl, openssl
  53. PreReq: curl, openssl
  54. %endif
  55. %if "%{with_ldap}" == "yes"
  56. BuildPreReq: openldap, openssl
  57. PreReq: openldap, openssl
  58. %endif
  59. AutoReq: no
  60. AutoReqProv: no
  61. %description
  62. GnuPG (GNU Privacy Guard) is a GNU utility for encrypting data and
  63. creating digital signatures. GnuPG has advanced key management
  64. capabilities and is compliant with the proposed OpenPGP Internet
  65. standard described in RFC2440. Since GnuPG doesn't use any patented
  66. algorithm, it is not compatible with any version of PGP2 (PGP2.x
  67. uses only IDEA, patented worldwide).
  68. %track
  69. prog gnupg2 = {
  70. version = %{version}
  71. url = ftp://ftp.gnupg.org/gcrypt/gnupg/
  72. regex = gnupg-(2\.__VER__)\.tar\.(gz|bz2)
  73. }
  74. %prep
  75. %setup -q -n gnupg-%{version}
  76. %if "%{with_idea}" == "yes"
  77. %{l_gzip} -d -c %{SOURCE idea.c.gz} >cipher/idea.c
  78. %endif
  79. %patch -p0
  80. %build
  81. # configure program
  82. export LIBS=""
  83. echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c
  84. for lib in termcap termlib curses ncurses; do
  85. rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1
  86. if [ $rc -eq 0 ]; then LIBS="$LIBS -l$lib"; break; fi
  87. done
  88. %if "%{with_curl}" == "yes" || "%{with_ldap}" == "yes"
  89. LIBS="$LIBS -lssl -lcrypto"
  90. %endif
  91. %if "%{with_curl}" == "yes"
  92. LIBS="$LIBS -lz"
  93. %endif
  94. LIBS="$LIBS -liconv"
  95. export CC="%{l_cc}"
  96. export CFLAGS="%{l_cflags -O}"
  97. export CPPFLAGS="%{l_cppflags}"
  98. export LDFLAGS="%{l_ldflags}"
  99. ./configure \
  100. --prefix=%{l_prefix} \
  101. --datadir=%{l_prefix}/share/gnupg2 \
  102. --mandir=%{l_prefix}/man \
  103. --infodir=%{l_prefix}/info \
  104. --with-zlib=%{l_prefix} \
  105. --with-bzip2=%{l_prefix} \
  106. --with-readline=%{l_prefix} \
  107. --with-libiconv-prefix=%{l_prefix} \
  108. --with-gpg-error-prefix=%{l_prefix} \
  109. --with-libgcrypt-prefix=%{l_prefix} \
  110. --with-libassuan-prefix=%{l_prefix} \
  111. --with-ksba-prefix=%{l_prefix} \
  112. --with-pth-prefix=%{l_prefix} \
  113. --with-agent-pgm=%{l_prefix}/bin/gpg-agent \
  114. --with-pinentry-pgm=%{l_prefix}/bin/pinentry \
  115. --with-dirmngr-pgm=%{l_prefix}/bin/dirmngr \
  116. --with-included-regex \
  117. %if "%{with_curl}" == "yes"
  118. --with-libcurl=%{l_prefix} \
  119. %else
  120. --without-libcurl \
  121. %endif
  122. --without-included-gettext \
  123. --without-libintl-prefix \
  124. --disable-nls \
  125. --disable-scdaemon \
  126. --enable-generic \
  127. --enable-finger \
  128. --enable-hkp \
  129. %if "%{with_ldap}" == "yes"
  130. --enable-ldap \
  131. %else
  132. --disable-ldap \
  133. %endif
  134. %if "%{with_curl}" == "yes"
  135. --with-libcurl=%{l_prefix} \
  136. %else
  137. --without-libcurl \
  138. %endif
  139. --enable-exec \
  140. --enable-keyserver-helpers \
  141. --with-mailprog="%{l_prefix}/sbin/sendmail" \
  142. --disable-mailto
  143. # build program
  144. %{l_make} %{l_mflags}
  145. %install
  146. # install program
  147. rm -rf $RPM_BUILD_ROOT
  148. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  149. # strip down and post-adjust installation files
  150. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  151. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/gnupg/* 2>/dev/null || true
  152. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  153. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/scdaemon.1
  154. mv $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert.sh \
  155. $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert
  156. mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.sh.1 \
  157. $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.1
  158. # determine installation files
  159. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  160. %{l_files_std} \
  161. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg2'
  162. %files -f files
  163. %clean
  164. rm -rf $RPM_BUILD_ROOT