nepim/nepim.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 189
1a7b9c850a13
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@104 1 ##
michael@104 2 ## nepim.spec -- OpenPKG RPM Package Specification
michael@104 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@104 4 ##
michael@104 5 ## Permission to use, copy, modify, and distribute this software for
michael@104 6 ## any purpose with or without fee is hereby granted, provided that
michael@104 7 ## the above copyright notice and this permission notice appear in all
michael@104 8 ## copies.
michael@104 9 ##
michael@104 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@104 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@104 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@104 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@104 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@104 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@104 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@104 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@104 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@104 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@104 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@104 21 ## SUCH DAMAGE.
michael@104 22 ##
michael@104 23
michael@104 24 # package information
michael@104 25 Name: nepim
michael@104 26 Summary: Network Pipemeter
michael@104 27 URL: http://www.nongnu.org/nepim/
michael@104 28 Vendor: Everton da Silva Marques
michael@104 29 Packager: Michael Schloh von Bennewitz
michael@104 30 Distribution: Europalab Production
michael@104 31 Class: EVAL
michael@104 32 Group: Network
michael@104 33 License: GPL
michael@104 34 Version: 0.53
michael@308 35 Release: 20110300
michael@104 36
michael@104 37 # list of sources
michael@308 38 Source0: http://download.savannah.gnu.org/releases/nepim/nepim-%{version}.tar.gz
michael@104 39
michael@104 40 # build information
michael@104 41 Prefix: %{l_prefix}
michael@104 42 BuildRoot: %{l_buildroot}
michael@104 43 BuildPreReq: OpenPKG, openpkg >= 20040130, make, pkgconfig
michael@104 44 PreReq: OpenPKG, openpkg >= 20040130
michael@104 45 BuildPreReq: liboop
michael@104 46 PreReq: liboop
michael@104 47 AutoReq: no
michael@104 48 AutoReqProv: no
michael@104 49
michael@104 50 %description
michael@104 51 Nepim stands for network pipemeter, a tool for measuring available
michael@104 52 bandwidth between hosts or generating network traffic for testing
michael@104 53 purposes. Nepim operates in client/server mode, is able to handle
michael@104 54 multiple parallel traffic streams, reports periodic partial
michael@104 55 statistics along the testing, accepts rich tuning from the command
michael@104 56 line, and supports multicast and IPv6.
michael@104 57
michael@104 58 %track
michael@104 59 prog nepim = {
michael@104 60 version = %{version}
michael@104 61 url = http://www.very-clever.com/download/nongnu/nepim/
michael@104 62 regex = nepim-(__VER__)\.tar\.gz
michael@104 63 }
michael@104 64
michael@104 65 %prep
michael@104 66 %setup -q
michael@104 67 %{l_shtool} subst \
michael@104 68 -e 's;\(\t*\$(CC).*\);\1 $(LIBS);' \
michael@104 69 -e 's;\(\t*-DHAVE_.*\)\$(SPARC64);\1-DHAVE_GROUP_SOURCE_REQ;' \
michael@104 70 -e 's; *\$(SPARC64);;g' \
michael@104 71 -e 's;\$(DEBUG);;g' \
michael@104 72 -e 's;-ggdb;;g' \
michael@104 73 -e 's;-g;;g' \
michael@104 74 src/Makefile
michael@104 75
michael@104 76 %build
michael@104 77 loclibs='-ldl'
michael@104 78 case "%{l_platform -t}" in
michael@104 79 *-sunos* ) loclibs="$loclibs -lsocket -lnsl" ;;
michael@104 80 esac
michael@104 81 cd src
michael@104 82 %{l_make} %{l_mflags -O} \
michael@104 83 CC="%{l_cc}" \
michael@104 84 CPPFLAGS="%{l_cppflags}" \
michael@104 85 LDFLAGS="%{l_ldflags}" \
michael@104 86 LIBS="$loclibs `pkg-config liboop --libs-only-l`" \
michael@104 87 OOP_BASE=%{l_prefix}
michael@104 88
michael@104 89 %install
michael@104 90 rm -rf $RPM_BUILD_ROOT
michael@104 91 %{l_shtool} mkdir -f -p -m 755 \
michael@104 92 $RPM_BUILD_ROOT%{l_prefix}/bin
michael@189 93 %{l_shtool} install -c -s -m 755 \
michael@104 94 src/nepim \
michael@104 95 $RPM_BUILD_ROOT%{l_prefix}/bin/
michael@104 96 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@104 97
michael@104 98 %files -f files
michael@104 99
michael@104 100 %clean
michael@104 101 rm -rf $RPM_BUILD_ROOT
michael@104 102

mercurial