gnupg/gnupg.spec

Fri, 03 Aug 2012 16:34:12 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 03 Aug 2012 16:34:12 +0200
changeset 462
63f79f03cb7f
parent 373
b8e8f9dbbfd3
permissions
-rw-r--r--

Update to new versions of vendor software and generally modernize,
breaking with the tradition of supporting parallel GnuPG v1 and v2.

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

mercurial