binutils/binutils.spec

changeset 68
49e9fb8edd05
child 69
84180bd0cb45
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/binutils/binutils.spec	Mon Jan 12 14:38:36 2009 +0100
     1.3 @@ -0,0 +1,157 @@
     1.4 +##
     1.5 +##  binutils.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package information
    1.28 +Name:         binutils
    1.29 +Summary:      GNU Binary Utilities
    1.30 +URL:          http://sources.redhat.com/binutils/
    1.31 +Vendor:       Free Software Foundation
    1.32 +Packager:     OpenPKG Foundation e.V.
    1.33 +Distribution: OpenPKG Community
    1.34 +Class:        CORE
    1.35 +Group:        Compiler
    1.36 +License:      GPL
    1.37 +Version:      2.18
    1.38 +Release:      20080101
    1.39 +
    1.40 +#   list of sources
    1.41 +Source0:      ftp://sources.redhat.com/pub/binutils/releases/binutils-%{version}.tar.bz2
    1.42 +Patch0:       binutils.patch
    1.43 +
    1.44 +#   build information
    1.45 +Prefix:       %{l_prefix}
    1.46 +BuildRoot:    %{l_buildroot}
    1.47 +BuildPreReq:  OpenPKG, openpkg >= 20060419, make
    1.48 +PreReq:       OpenPKG, openpkg >= 20060419
    1.49 +AutoReq:      no
    1.50 +AutoReqProv:  no
    1.51 +
    1.52 +%description
    1.53 +    Binutils is a collection of binary utilities. It includes: ld
    1.54 +    (the GNU linker), addr2line (converts addresses into filenames
    1.55 +    and line numbers), as (the portable GNU assembler), ar (a utility
    1.56 +    for creating, modifying and extracting from archives), nm (lists
    1.57 +    symbols from object files), objcopy (copys and translates object
    1.58 +    files), objdump (displays information from object files), ranlib
    1.59 +    (generates an index to the contents of an archive), readelf
    1.60 +    (displays information from any ELF format object file), size (lists
    1.61 +    the section sizes of an object or archive file), strings (lists
    1.62 +    printable strings from files), strip (discards symbols) and gprof
    1.63 +    (displays profiling information).
    1.64 +
    1.65 +%track
    1.66 +    prog binutils = {
    1.67 +        version   = %{version}
    1.68 +        url       = ftp://sources.redhat.com/pub/binutils/releases/
    1.69 +        regex     = binutils-(__VER__)\.tar\.bz2
    1.70 +    }
    1.71 +
    1.72 +%prep
    1.73 +    %setup -q
    1.74 +    %patch -p0
    1.75 +
    1.76 +%build
    1.77 +    #   configure package
    1.78 +    CC="%{l_cc}"; export CC
    1.79 +    CFLAGS="%{l_cflags}"; export CFLAGS
    1.80 +    ARGS=""
    1.81 +    case "%{l_platform -t}" in
    1.82 +        *-freebsd* ) CFLAGS="$CFLAGS -DOPENPKG_OS_FREEBSD" ;;
    1.83 +        *-linux*   ) CFLAGS="$CFLAGS -DOPENPKG_OS_LINUX"   ;;
    1.84 +        *-sunos*   ) CFLAGS="$CFLAGS -DOPENPKG_OS_SOLARIS" ;;
    1.85 +        *-aix*     ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;;
    1.86 +        *-darwin*  ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;;
    1.87 +    esac
    1.88 +    case "%{l_platform -t}" in
    1.89 +        amd64-sunos* ) ARGS="$ARGS --enable-64-bit-bdf" ;;
    1.90 +    esac
    1.91 +    ( echo "#!/bin/sh"
    1.92 +      echo "touch lex.yy.c"
    1.93 +      echo "echo 'lex.sh:WARNING: local Lex wrapper unexpectedly called.' 1>&2"
    1.94 +    ) >lex.sh && chmod a+x lex.sh
    1.95 +    echo "ac_cv_prog_LEX=`pwd`/lex.sh" >ld/config.cache
    1.96 +    INSTALL="%{l_shtool} install -c" \
    1.97 +    AR="%{l_ar}" \
    1.98 +    MAKE="%{l_make}" \
    1.99 +    CONFIG_SHELL="%{l_bash}" \
   1.100 +    ./configure \
   1.101 +        --prefix=%{l_prefix} \
   1.102 +        --includedir=%{l_prefix}/include/binutils \
   1.103 +        --libdir=%{l_prefix}/lib/binutils \
   1.104 +        --disable-werror \
   1.105 +        --disable-nls \
   1.106 +        $ARGS
   1.107 +
   1.108 +    #   build package
   1.109 +    %{l_make} %{l_mflags}
   1.110 +
   1.111 +%install
   1.112 +    rm -rf $RPM_BUILD_ROOT
   1.113 +
   1.114 +    #   build package
   1.115 +    %{l_make} %{l_mflags} install \
   1.116 +        prefix=$RPM_BUILD_ROOT%{l_prefix} \
   1.117 +        exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
   1.118 +        includedir=$RPM_BUILD_ROOT%{l_prefix}/include/binutils \
   1.119 +        libdir=$RPM_BUILD_ROOT%{l_prefix}/lib/binutils
   1.120 +
   1.121 +    #   platform specific stripping down of installation:
   1.122 +    #   o   GNU binutils strip(1) is broken on AIX, use of OS supplied
   1.123 +    #       /usr/bin/strip from bos.rte.bind_cmds is mandatory.
   1.124 +    #   o   GNU binutils strip(1), ar(1) and ranlib(1) do not work under
   1.125 +    #       Mac OS X (aka Darwin), system versions have to be used.
   1.126 +    case "%{l_platform -t}" in
   1.127 +        *-aix* )
   1.128 +            rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \
   1.129 +                  $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1
   1.130 +            ;;
   1.131 +        *-darwin* )
   1.132 +            rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \
   1.133 +                  $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1
   1.134 +            rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ar \
   1.135 +                  $RPM_BUILD_ROOT%{l_prefix}/man/man1/ar.1
   1.136 +            rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ranlib \
   1.137 +                  $RPM_BUILD_ROOT%{l_prefix}/man/man1/ranlib.1
   1.138 +            ;;
   1.139 +    esac
   1.140 +
   1.141 +    #   strip down installation
   1.142 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
   1.143 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/info/standards.info
   1.144 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/info/configure.info*
   1.145 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++filt.1
   1.146 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/dlltool.1
   1.147 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/nlmconv.1
   1.148 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/windres.1
   1.149 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/*-*-*
   1.150 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin/c++filt
   1.151 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.152 +
   1.153 +    #   determine installation files
   1.154 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   1.155 +
   1.156 +%files -f files
   1.157 +
   1.158 +%clean
   1.159 +    rm -rf $RPM_BUILD_ROOT
   1.160 +

mercurial