m4/m4.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 267
1eb3a915673d
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@267 1 ##
michael@267 2 ## m4.spec -- OpenPKG RPM Package Specification
michael@267 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@267 4 ##
michael@267 5 ## Permission to use, copy, modify, and distribute this software for
michael@267 6 ## any purpose with or without fee is hereby granted, provided that
michael@267 7 ## the above copyright notice and this permission notice appear in all
michael@267 8 ## copies.
michael@267 9 ##
michael@267 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@267 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@267 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@267 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@267 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@267 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@267 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@267 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@267 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@267 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@267 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@267 21 ## SUCH DAMAGE.
michael@267 22 ##
michael@267 23
michael@267 24 # package information
michael@267 25 Name: m4
michael@267 26 Summary: Macro Processing Language
michael@267 27 URL: http://www.gnu.org/software/m4/
michael@267 28 Vendor: Rene Seindal et al.
michael@267 29 Packager: OpenPKG Foundation e.V.
michael@267 30 Distribution: OpenPKG Community
michael@267 31 Class: CORE
michael@267 32 Group: MacroProcessor
michael@267 33 License: GPL
michael@267 34 Version: 1.4.15
michael@268 35 Release: 20101018
michael@267 36
michael@267 37 # list of sources
michael@267 38 Source0: ftp://ftp.gnu.org/gnu/m4/m4-%{version}.tar.gz
michael@267 39
michael@267 40 # build information
michael@268 41 Prefix: %{l_prefix}
michael@268 42 BuildRoot: %{l_buildroot}
michael@267 43 BuildPreReq: OpenPKG, openpkg >= 20100101, make
michael@267 44 PreReq: OpenPKG, openpkg >= 20100101
michael@267 45
michael@267 46 %description
michael@267 47 GNU m4 is an implementation of the traditional UNIX macro processor.
michael@267 48 It is mostly SVR4 compatible, although it has some extensions (for
michael@267 49 example, handling more than 9 positional parameters to macros).
michael@267 50 m4 also has builtin functions for including files, running shell
michael@267 51 commands, doing arithmetic, etc.
michael@267 52
michael@267 53 %track
michael@267 54 prog m4 = {
michael@267 55 version = %{version}
michael@267 56 url = ftp://ftp.gnu.org/gnu/m4/
michael@267 57 regex = m4-(__VER__)\.tar\.gz
michael@267 58 }
michael@267 59
michael@267 60 %prep
michael@267 61 %setup -q
michael@267 62
michael@267 63 %build
michael@267 64 # configure package
michael@267 65 CC="%{l_cc}" \
michael@267 66 CFLAGS="%{l_cflags -O}" \
michael@267 67 GREP="grep" \
michael@267 68 ./configure \
michael@267 69 --prefix=%{l_prefix} \
michael@267 70 --libdir=%{l_prefix}/lib/m4 \
michael@267 71 --datarootdir=%{l_prefix}
michael@267 72
michael@267 73 # build package
michael@267 74 %{l_make} %{l_mflags}
michael@267 75
michael@267 76 %install
michael@267 77
michael@267 78 # install package
michael@267 79 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@267 80
michael@267 81 # provide alternative GNU names
michael@267 82 ln $RPM_BUILD_ROOT%{l_prefix}/bin/m4 \
michael@267 83 $RPM_BUILD_ROOT%{l_prefix}/bin/gm4
michael@267 84 ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/m4.1 \
michael@267 85 $RPM_BUILD_ROOT%{l_prefix}/man/man1/gm4.1
michael@267 86
michael@267 87 # strip down installation
michael@267 88 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@267 89 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
michael@267 90 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/m4/charset.alias
michael@267 91 rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/m4 >/dev/null 2>&1 || true
michael@267 92
michael@267 93 # determine installation files
michael@267 94 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@267 95
michael@267 96 %files -f files
michael@267 97
michael@267 98 %clean
michael@268 99 rm -rf $RPM_BUILD_ROOT
michael@267 100

mercurial