gnupg/gnupg.spec

Fri, 22 Oct 2010 23:20:14 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 22 Oct 2010 23:20:14 +0200
changeset 286
552d1939222f
parent 155
d02b8517b4af
child 287
c30c9dcebf8b
permissions
-rw-r--r--

Resynchronize with upstream package maintainer version.

     1 ##
     2 ##  gnupg.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2010 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 ##
    24 #   package information
    25 Name:         gnupg
    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:        PLUS
    32 Group:        PGP
    33 License:      GPL
    34 Version:      2.0.16
    35 Release:      20100719
    37 #   package options
    38 %option       with_curl  yes
    39 %option       with_ldap  no
    40 %option       with_idea  no
    42 #   list of sources
    43 Source0:      ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-%{version}.tar.bz2
    44 Patch0:       gnupg.patch
    46 #   build information
    47 BuildPreReq:  OpenPKG, openpkg >= 20100101, make
    48 PreReq:       OpenPKG, openpkg >= 20100101, pinentry
    49 BuildPreReq:  gcrypt >= 1.2.3, libksba >= 1.0.2, libassuan >= 2.0.0, gpg-error >= 1.4
    50 PreReq:       gcrypt >= 1.2.3, libksba >= 1.0.2, libassuan >= 2.0.0, gpg-error >= 1.4
    51 BuildPreReq:  zlib, bzip2, readline, pth, libiconv
    52 PreReq:       zlib, bzip2, readline, pth, libiconv
    53 %if "%{with_curl}" == "yes"
    54 BuildPreReq:  curl, openssl
    55 PreReq:       curl, openssl
    56 %endif
    57 %if "%{with_ldap}" == "yes"
    58 BuildPreReq:  openldap, openssl
    59 PreReq:       openldap, openssl
    60 %endif
    61 %if "%{with_idea}" == "yes"
    62 BuildPreReq:  gcrypt::with_idea
    63 PreReq:       gcrypt::with_idea
    64 %endif
    66 %description
    67     GnuPG (GNU Privacy Guard) is a GNU utility for encrypting data and
    68     creating digital signatures. GnuPG has advanced key management
    69     capabilities and is compliant with the proposed OpenPGP Internet
    70     standard described in RFC2440. Since GnuPG doesn't use any patented
    71     algorithm, it is not compatible with any version of PGP2 (PGP2.x
    72     uses only IDEA, patented worldwide).
    74 %track
    75     prog gnupg = {
    76         version   = %{version}
    77         url       = ftp://ftp.gnupg.org/gcrypt/gnupg/
    78         regex     = gnupg-(2\.__VER__)\.tar\.(gz|bz2)
    79     }
    81 %prep
    82     %setup -q -n gnupg-%{version}
    83     %patch -p0
    84     chmod a+rx scripts/install-sh
    85     %{l_shtool} subst \
    86         -e 's;PRINTABLE_OS_NAME;"%{l_openpkg_release}";g' \
    87         g10/armor.c
    89 %build
    90     #   configure program
    91     export LIBS=""
    92     case "%{l_platform -t}" in
    93         *-sunos* ) LIBS="$LIBS -lsocket -lnsl" ;;
    94     esac
    95     echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c
    96     for lib in termcap termlib curses ncurses; do
    97         rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1
    98         if [ $rc -eq 0 ]; then LIBS="$LIBS -l$lib"; break; fi
    99     done
   100 %if "%{with_curl}" == "yes" || "%{with_ldap}" == "yes"
   101     LIBS="$LIBS -lssl -lcrypto"
   102 %endif
   103 %if "%{with_curl}" == "yes"
   104     LIBS="$LIBS -lz"
   105 %endif
   106     LIBS="$LIBS -liconv"
   107     export CC="%{l_cc}"
   108     export CFLAGS="%{l_cflags -O}"
   109     export CPPFLAGS="%{l_cppflags}"
   110 %if "%{with_idea}" == "yes"
   111     export CPPFLAGS="-DUSE_IDEA $CPPFLAGS"
   112 %endif
   113     export LDFLAGS="%{l_ldflags}"
   114     ./configure \
   115         --prefix=%{l_prefix} \
   116         --libexecdir=%{l_prefix}/libexec/gnupg \
   117         --mandir=%{l_prefix}/man \
   118         --infodir=%{l_prefix}/info \
   119         --with-zlib=%{l_prefix} \
   120         --with-bzip2=%{l_prefix} \
   121         --with-readline=%{l_prefix} \
   122         --with-libiconv-prefix=%{l_prefix} \
   123         --with-gpg-error-prefix=%{l_prefix} \
   124         --with-libgcrypt-prefix=%{l_prefix} \
   125         --with-libassuan-prefix=%{l_prefix} \
   126         --with-ksba-prefix=%{l_prefix} \
   127         --with-pth-prefix=%{l_prefix} \
   128         --with-agent-pgm=%{l_prefix}/bin/gpg-agent \
   129         --with-pinentry-pgm=%{l_prefix}/bin/pinentry \
   130         --with-dirmngr-pgm=%{l_prefix}/bin/dirmngr \
   131 %if "%{with_curl}" == "yes"
   132         --with-libcurl=%{l_prefix} \
   133 %else
   134         --without-libcurl \
   135 %endif
   136         --without-libintl-prefix \
   137         --disable-nls \
   138         --disable-scdaemon \
   139         --enable-generic \
   140         --enable-finger \
   141         --enable-hkp \
   142 %if "%{with_ldap}" == "yes"
   143         --enable-ldap \
   144 %else
   145         --disable-ldap \
   146 %endif
   147 %if "%{with_curl}" == "yes"
   148         --with-libcurl=%{l_prefix} \
   149 %else
   150         --without-libcurl \
   151 %endif
   152         --enable-exec \
   153         --enable-keyserver-helpers \
   154         --with-mailprog="%{l_prefix}/sbin/sendmail" \
   155         --disable-mailto
   157     #   build program
   158     %{l_make} %{l_mflags}
   160 %install
   161     #   install program
   162     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   164     #   provide unversioned names
   165     ln  $RPM_BUILD_ROOT%{l_prefix}/bin/gpg2 \
   166         $RPM_BUILD_ROOT%{l_prefix}/bin/gpg
   167     ln  $RPM_BUILD_ROOT%{l_prefix}/bin/gpgv2 \
   168         $RPM_BUILD_ROOT%{l_prefix}/bin/gpgv
   169     ln  $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpg2.1 \
   170         $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpg.1
   171     ln  $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgv2.1 \
   172         $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgv.1
   174     #   strip down and post-adjust installation files
   175     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
   176     strip $RPM_BUILD_ROOT%{l_prefix}/libexec/gnupg/* 2>/dev/null || true
   177     rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
   178     rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/scdaemon.1
   179     mv $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert.sh \
   180        $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert
   181     mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.sh.1 \
   182        $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.1
   184     #   determine installation files
   185     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   186         %{l_files_std} \
   187         '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg' \
   188         '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg2'
   190 %files -f files
   192 %clean

mercurial