gnupg/gnupg.spec

Wed, 07 Jan 2009 22:13:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 07 Jan 2009 22:13:49 +0100
changeset 30
3839a3a70f72
child 31
bba786e365af
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

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

mercurial