libassuan/libassuan.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 277
127aa6d21f52
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@277 1 ##
michael@277 2 ## libassuan.spec -- OpenPKG RPM Package Specification
michael@277 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@277 4 ##
michael@277 5 ## Permission to use, copy, modify, and distribute this software for
michael@277 6 ## any purpose with or without fee is hereby granted, provided that
michael@277 7 ## the above copyright notice and this permission notice appear in all
michael@277 8 ## copies.
michael@277 9 ##
michael@277 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@277 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@277 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@277 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@277 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@277 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@277 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@277 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@277 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@277 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@277 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@277 21 ## SUCH DAMAGE.
michael@277 22 ##
michael@277 23
michael@277 24 # package version
michael@277 25 %define V_assuan2 2.0.1
michael@277 26 %define V_assuan1 1.0.5
michael@277 27
michael@277 28 # package information
michael@277 29 Name: libassuan
michael@277 30 Summary: GnuPG IPC Library
michael@277 31 URL: http://www.gnupg.org/related_software/libassuan/
michael@277 32 Vendor: Werner Koch et al.
michael@277 33 Packager: OpenPKG Foundation e.V.
michael@277 34 Distribution: OpenPKG Community
michael@277 35 Class: PLUS
michael@277 36 Group: Libraries
michael@277 37 License: GPL/LGPL
michael@277 38 Version: %{V_assuan2}
michael@278 39 Release: 20101020
michael@277 40
michael@277 41 # list of sources
michael@277 42 Source0: ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-%{V_assuan1}.tar.bz2
michael@277 43 Source1: ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-%{V_assuan2}.tar.bz2
michael@277 44 Patch0: libassuan.patch
michael@277 45
michael@277 46 # build information
michael@278 47 Prefix: %{l_prefix}
michael@278 48 BuildRoot: %{l_buildroot}
michael@277 49 BuildPreReq: OpenPKG, openpkg >= 20100101
michael@277 50 PreReq: OpenPKG, openpkg >= 20100101
michael@277 51 BuildPreReq: pth, gpg-error
michael@277 52 PreReq: pth, gpg-error
michael@277 53
michael@277 54 %description
michael@277 55 Libassuan is the IPC library used by some GnuPG related software.
michael@277 56
michael@277 57 %track
michael@277 58 prog libassuan:libassuan1 = {
michael@277 59 version = %{V_assuan1}
michael@277 60 url = ftp://ftp.gnupg.org/gcrypt/libassuan/
michael@277 61 regex = libassuan-(1\.\d+\.\d+)\.tar\.bz2
michael@277 62 }
michael@277 63 prog libassuan:libassuan2 = {
michael@277 64 version = %{V_assuan2}
michael@277 65 url = ftp://ftp.gnupg.org/gcrypt/libassuan/
michael@277 66 regex = libassuan-(2\.\d+\.\d+)\.tar\.bz2
michael@277 67 }
michael@277 68
michael@277 69 %prep
michael@277 70 %setup -q -c
michael@277 71 %setup -q -D -a 1
michael@277 72 %patch -p0
michael@277 73
michael@277 74 %build
michael@277 75 ( cd libassuan-%{V_assuan1}
michael@277 76 CC="%{l_cc}" \
michael@277 77 CFLAGS="%{l_cflags -O}" \
michael@277 78 CPPFLAGS="%{l_cppflags pth .}" \
michael@277 79 LDFLAGS="%{l_ldflags}" \
michael@277 80 ./configure \
michael@277 81 --prefix=%{l_prefix} \
michael@277 82 --infodir=%{l_prefix}/info \
michael@277 83 --mandir=%{l_prefix}/man \
michael@277 84 --with-pth-prefix=%{l_prefix} \
michael@277 85 --disable-shared
michael@277 86 %{l_make} %{l_mflags -O}
michael@277 87 ) || exit $?
michael@277 88 ( cd libassuan-%{V_assuan2}
michael@277 89 CC="%{l_cc}" \
michael@277 90 CFLAGS="%{l_cflags -O}" \
michael@277 91 CPPFLAGS="%{l_cppflags pth .}" \
michael@277 92 LDFLAGS="%{l_ldflags}" \
michael@277 93 ./configure \
michael@277 94 --prefix=%{l_prefix} \
michael@277 95 --infodir=%{l_prefix}/info \
michael@277 96 --mandir=%{l_prefix}/man \
michael@277 97 --with-pth-prefix=%{l_prefix} \
michael@277 98 --disable-shared
michael@277 99 %{l_make} %{l_mflags -O}
michael@277 100 ) || exit $?
michael@277 101
michael@277 102 %install
michael@278 103 rm -rf $RPM_BUILD_ROOT
michael@277 104 ( cd libassuan-%{V_assuan1}
michael@277 105 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@277 106 mv $RPM_BUILD_ROOT%{l_prefix}/bin/libassuan-config \
michael@277 107 $RPM_BUILD_ROOT%{l_prefix}/bin/libassuan1-config
michael@277 108 %{l_shtool} subst \
michael@277 109 -e 's;-lassuan;-lassuan1;g' \
michael@277 110 $RPM_BUILD_ROOT%{l_prefix}/bin/libassuan1-config
michael@277 111 mv $RPM_BUILD_ROOT%{l_prefix}/include/assuan.h \
michael@277 112 $RPM_BUILD_ROOT%{l_prefix}/include/assuan1.h
michael@277 113 mv $RPM_BUILD_ROOT%{l_prefix}/info/assuan.info \
michael@277 114 $RPM_BUILD_ROOT%{l_prefix}/info/assuan1.info
michael@277 115 mv $RPM_BUILD_ROOT%{l_prefix}/lib/libassuan.a \
michael@277 116 $RPM_BUILD_ROOT%{l_prefix}/lib/libassuan1.a
michael@277 117 mv $RPM_BUILD_ROOT%{l_prefix}/lib/libassuan-pth.a \
michael@277 118 $RPM_BUILD_ROOT%{l_prefix}/lib/libassuan1-pth.a
michael@277 119 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libassuan.la
michael@277 120 mv $RPM_BUILD_ROOT%{l_prefix}/share/aclocal/libassuan.m4 \
michael@277 121 $RPM_BUILD_ROOT%{l_prefix}/share/aclocal/libassuan1.m4
michael@277 122 ) || exit $?
michael@277 123 ( cd libassuan-%{V_assuan2}
michael@277 124 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@277 125 ) || exit $?
michael@277 126 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
michael@277 127 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@277 128
michael@277 129 %files -f files
michael@277 130
michael@277 131 %clean
michael@278 132 rm -rf $RPM_BUILD_ROOT
michael@277 133

mercurial