libpri/libpri.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
child 381
8ddd39bcf2ec
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@240 1 ##
michael@240 2 ## libpri.spec -- OpenPKG RPM Package Specification
michael@240 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@240 4 ##
michael@240 5 ## Permission to use, copy, modify, and distribute this software for
michael@240 6 ## any purpose with or without fee is hereby granted, provided that
michael@240 7 ## the above copyright notice and this permission notice appear in all
michael@240 8 ## copies.
michael@240 9 ##
michael@240 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@240 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@240 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@240 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@240 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@240 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@240 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@240 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@240 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@240 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@240 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@240 21 ## SUCH DAMAGE.
michael@240 22 ##
michael@240 23
michael@240 24 # package information
michael@240 25 Name: libpri
michael@240 26 Summary: Primary Rate ISDN Logic
michael@240 27 URL: http://www.asterisk.org/
michael@240 28 Vendor: Mark Spencer et al.
michael@240 29 Packager: Michael Schloh von Bennewitz
michael@240 30 Distribution: Michael Schloh von Bennewitz
michael@240 31 Class: EVAL
michael@240 32 Group: VoIP
michael@240 33 License: GPL
michael@240 34 Version: 1.4.10.2
michael@240 35 Release: 20091110
michael@240 36
michael@240 37 # list of sources
michael@240 38 Source0: http://downloads.asterisk.org/pub/telephony/libpri/libpri-%{version}.tar.gz
michael@240 39
michael@240 40 # build information
michael@240 41 Prefix: %{l_prefix}
michael@240 42 BuildRoot: %{l_buildroot}
michael@240 43 BuildPreReq: OpenPKG, openpkg >= 20040130
michael@240 44 PreReq: OpenPKG, openpkg >= 20040130
michael@240 45 AutoReq: no
michael@240 46 AutoReqProv: no
michael@240 47
michael@240 48 %description
michael@240 49 libpri is a C implementation of the Primary Rate ISDN specification.
michael@240 50 It was based on the Bellcore specification SR-NWT-002343 for National
michael@240 51 ISDN. As of May 12, 2001, it has been tested work with NI-2, Nortel
michael@240 52 DMS-100, and Lucent 5E Custom protocols on switches from Nortel and
michael@240 53 Lucent.
michael@240 54
michael@240 55 %track
michael@240 56 prog libpri = {
michael@240 57 version = %{version}
michael@240 58 url = http://downloads.asterisk.org/pub/telephony/libpri/
michael@240 59 regex = libpri-(__VER__)\.tar\.gz
michael@240 60 }
michael@240 61
michael@240 62 %prep
michael@240 63 %setup -q
michael@240 64
michael@240 65 # apply corrections
michael@240 66 %{l_shtool} subst \
michael@240 67 -e 's;INSTALL_BASE=/usr;INSTALL_BASE=;g' \
michael@240 68 Makefile
michael@240 69
michael@240 70 %build
michael@240 71 # build package
michael@240 72 %{l_make} %{l_mflags -O}
michael@240 73
michael@240 74 %install
michael@240 75 rm -rf $RPM_BUILD_ROOT
michael@240 76
michael@240 77 # install package
michael@240 78 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT%{l_prefix}
michael@240 79
michael@240 80 # remove dynamic libraries
michael@240 81 rm -f $RPM_BUILD_ROOT/%{l_prefix}/lib/libpri.so*
michael@240 82
michael@240 83 # determine installation files
michael@240 84 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@240 85
michael@240 86 %files -f files
michael@240 87
michael@240 88 %clean
michael@240 89 rm -rf $RPM_BUILD_ROOT
michael@240 90

mercurial