gpg-error/gpg-error.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 275
34ad7324825b
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@275 1 ##
michael@275 2 ## gpg-error.spec -- OpenPKG RPM Package Specification
michael@275 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@275 4 ##
michael@275 5 ## Permission to use, copy, modify, and distribute this software for
michael@275 6 ## any purpose with or without fee is hereby granted, provided that
michael@275 7 ## the above copyright notice and this permission notice appear in all
michael@275 8 ## copies.
michael@275 9 ##
michael@275 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@275 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@275 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@275 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@275 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@275 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@275 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@275 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@275 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@275 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@275 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@275 21 ## SUCH DAMAGE.
michael@275 22 ##
michael@275 23
michael@275 24 # package information
michael@275 25 Name: gpg-error
michael@275 26 Summary: GnuPG Error Library
michael@275 27 URL: ftp://ftp.gnupg.org/gcrypt/libgpg-error/
michael@275 28 Vendor: g10 Code GmbH
michael@275 29 Packager: OpenPKG Foundation e.V.
michael@275 30 Distribution: OpenPKG Community
michael@275 31 Class: PLUS
michael@275 32 Group: Cryptography
michael@275 33 License: LGPL
michael@275 34 Version: 1.9
michael@276 35 Release: 20101020
michael@275 36
michael@275 37 # list of sources
michael@276 38 Prefix: %{l_prefix}
michael@276 39 BuildRoot: %{l_buildroot}
michael@275 40 Source0: ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-%{version}.tar.gz
michael@275 41 Patch0: gpg-error.patch
michael@275 42
michael@275 43 # build information
michael@275 44 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gawk
michael@275 45 PreReq: OpenPKG, openpkg >= 20100101
michael@275 46
michael@275 47 %description
michael@275 48 This is a library that defines common error values for all GnuPG
michael@275 49 components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
michael@275 50 pinentry, SmartCard Daemon and possibly more in the future.
michael@275 51
michael@275 52 %track
michael@275 53 prog gpg-error = {
michael@275 54 version = %{version}
michael@275 55 url = ftp://ftp.gnupg.org/gcrypt/libgpg-error/
michael@275 56 regex = gpg-error-(__VER__)\.tar\.gz
michael@275 57 }
michael@275 58
michael@275 59 %prep
michael@275 60 %setup -q -n libgpg-error-%{version}
michael@275 61 %patch -p0
michael@275 62
michael@275 63 %build
michael@275 64 CC="%{l_cc}" \
michael@275 65 CXX="%{l_cxx}" \
michael@275 66 CFLAGS="%{l_cflags -O}" \
michael@275 67 CXXFLAGS="%{l_cxxflags -O}" \
michael@275 68 CPPFLAGS="%{l_cppflags}" \
michael@275 69 LDFLAGS="%{l_ldflags}" \
michael@275 70 ./configure \
michael@275 71 --prefix=%{l_prefix} \
michael@275 72 --disable-nls \
michael@275 73 --enable-shared=no
michael@275 74 %{l_make} %{l_mflags -O}
michael@275 75
michael@275 76 %install
michael@276 77 rm -rf $RPM_BUILD_ROOT
michael@275 78 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@275 79 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@275 80 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@275 81 %{l_files_std}
michael@275 82
michael@275 83 %files -f files
michael@275 84
michael@275 85 %clean
michael@276 86 rm -rf $RPM_BUILD_ROOT
michael@275 87

mercurial