gcrypt/gcrypt.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 284
33c60a6d7034
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@106 1 ##
michael@106 2 ## gcrypt.spec -- OpenPKG RPM Package Specification
michael@284 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@106 4 ##
michael@106 5 ## Permission to use, copy, modify, and distribute this software for
michael@106 6 ## any purpose with or without fee is hereby granted, provided that
michael@106 7 ## the above copyright notice and this permission notice appear in all
michael@106 8 ## copies.
michael@106 9 ##
michael@106 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@106 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@106 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@106 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@106 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@106 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@106 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@106 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@106 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@106 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@106 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@106 21 ## SUCH DAMAGE.
michael@106 22 ##
michael@106 23
michael@106 24 # package information
michael@106 25 Name: gcrypt
michael@106 26 Summary: Cryptography Library
michael@106 27 URL: ftp://ftp.gnupg.org/gcrypt/libgcrypt/
michael@106 28 Vendor: Werner Koch et al.
michael@106 29 Packager: OpenPKG Foundation e.V.
michael@106 30 Distribution: OpenPKG Community
michael@106 31 Class: PLUS
michael@106 32 Group: Cryptography
michael@106 33 License: LGPL
michael@284 34 Version: 1.4.6
michael@285 35 Release: 20101020
michael@107 36
michael@107 37 # package options
michael@107 38 %option with_idea no
michael@106 39
michael@106 40 # list of sources
michael@106 41 Source0: ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-%{version}.tar.gz
michael@107 42 Source1: idea.c
michael@107 43 Patch0: gcrypt.patch
michael@106 44
michael@106 45 # build information
michael@285 46 Prefix: %{l_prefix}
michael@285 47 BuildRoot: %{l_buildroot}
michael@284 48 BuildPreReq: OpenPKG, openpkg >= 20100101, gpg-error, make, gcc
michael@284 49 PreReq: OpenPKG, openpkg >= 20100101, gpg-error
michael@106 50
michael@106 51 %description
michael@106 52 GCrypt is the split-out cryptography library from GnuPG.
michael@106 53
michael@106 54 %track
michael@106 55 prog gcrypt = {
michael@106 56 version = %{version}
michael@106 57 url = ftp://ftp.gnupg.org/gcrypt/libgcrypt/
michael@106 58 regex = libgcrypt-(__VER__)\.tar\.gz
michael@106 59 }
michael@106 60
michael@106 61 %prep
michael@106 62 %setup -q -n libgcrypt-%{version}
michael@107 63 %patch -p0
michael@107 64 %if "%{with_idea}" == "yes"
michael@107 65 echo $PWD
michael@107 66 pwd
michael@107 67 echo `pwd`
michael@107 68 cp %{SOURCE idea.c} cipher/
michael@107 69 %{l_shtool} subst \
michael@107 70 -e 's;^\(EXTRA_libcipher_la_SOURCES =\);\1 idea.c;' \
michael@107 71 -e 's;^\(GCRYPT_MODULES = .*[^\ \t]\)[\ \t]*$;\1 idea.lo;' \
michael@107 72 -e 's;^\(GCRYPT_CIPHERS = .*[^\ \t]\)[\ \t]*$;\1 idea.lo;' \
michael@107 73 -e 's;^\(LIBGCRYPT_CIPHERS = .*[^\ \t]\)[\ \t]*$;\1 idea;' \
michael@107 74 cipher/Makefile.in
michael@107 75 %{l_shtool} subst \
michael@107 76 -e 's;^\(available_ciphers="arcfour [^"][^"]*\)";\1 idea";' \
michael@107 77 configure
michael@107 78 %endif
michael@106 79
michael@106 80 %build
michael@106 81 ( echo "ac_cv_lib_pthread_pthread_create=no"
michael@106 82 echo "ac_cv_lib_pth_pth_version=no"
michael@106 83 ) >config.cache
michael@106 84 CC="%{l_cc}" \
michael@106 85 CFLAGS="%{l_cflags -O}" \
michael@107 86 %if "%{with_idea}" == "yes"
michael@107 87 CPPFLAGS="-DUSE_IDEA $CPPFLAGS" \
michael@107 88 %endif
michael@106 89 GREP="grep" \
michael@106 90 ./configure \
michael@106 91 --cache-file=./config.cache \
michael@106 92 --prefix=%{l_prefix} \
michael@106 93 --mandir=%{l_prefix}/man \
michael@106 94 --infodir=%{l_prefix}/info \
michael@106 95 --disable-shared
michael@106 96 %{l_make} %{l_mflags -O}
michael@106 97
michael@106 98 %install
michael@285 99 rm -rf $RPM_BUILD_ROOT
michael@285 100 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@106 101 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
michael@106 102 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@106 103 %{l_files_std}
michael@106 104
michael@106 105 %files -f files
michael@106 106
michael@106 107 %clean
michael@285 108 rm -rf $RPM_BUILD_ROOT
michael@106 109

mercurial