michael@68: ## michael@68: ## binutils.spec -- OpenPKG RPM Package Specification michael@425: ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. michael@68: ## michael@68: ## Permission to use, copy, modify, and distribute this software for michael@68: ## any purpose with or without fee is hereby granted, provided that michael@68: ## the above copyright notice and this permission notice appear in all michael@68: ## copies. michael@68: ## michael@68: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@68: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@68: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@68: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@68: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@68: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@68: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@68: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@68: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@68: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@68: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@68: ## SUCH DAMAGE. michael@68: ## michael@68: michael@425: # package version michael@425: %define V_opkg 2.22 michael@425: %define V_base 2.22 michael@425: %define V_patch %nil michael@425: michael@68: # package information michael@68: Name: binutils michael@68: Summary: GNU Binary Utilities michael@68: URL: http://sources.redhat.com/binutils/ michael@68: Vendor: Free Software Foundation michael@68: Packager: OpenPKG Foundation e.V. michael@68: Distribution: OpenPKG Community michael@68: Class: CORE michael@68: Group: Compiler michael@68: License: GPL michael@425: Version: %{V_opkg} michael@426: Release: 20120800 michael@68: michael@68: # list of sources michael@425: Source0: ftp://sources.redhat.com/pub/binutils/releases/binutils-%{V_base}.tar.bz2 michael@68: Patch0: binutils.patch michael@68: michael@68: # build information michael@425: BuildPreReq: OpenPKG, openpkg >= 20100101, make michael@425: PreReq: OpenPKG, openpkg >= 20100101 michael@68: michael@68: %description michael@68: Binutils is a collection of binary utilities. It includes: ld michael@68: (the GNU linker), addr2line (converts addresses into filenames michael@68: and line numbers), as (the portable GNU assembler), ar (a utility michael@68: for creating, modifying and extracting from archives), nm (lists michael@68: symbols from object files), objcopy (copys and translates object michael@68: files), objdump (displays information from object files), ranlib michael@68: (generates an index to the contents of an archive), readelf michael@68: (displays information from any ELF format object file), size (lists michael@68: the section sizes of an object or archive file), strings (lists michael@68: printable strings from files), strip (discards symbols) and gprof michael@68: (displays profiling information). michael@68: michael@68: %track michael@68: prog binutils = { michael@425: version = %{V_base} michael@68: url = ftp://sources.redhat.com/pub/binutils/releases/ michael@68: regex = binutils-(__VER__)\.tar\.bz2 michael@68: } michael@68: michael@68: %prep michael@425: %setup -q -n binutils-%{V_base} michael@68: %patch -p0 michael@426: %{l_shtool} subst \ michael@426: -e 's;MULTIOSDIR =.*;MULTIOSDIR =;' \ michael@426: libiberty/Makefile.in michael@68: michael@68: %build michael@68: # configure package michael@68: CC="%{l_cc}"; export CC michael@68: CFLAGS="%{l_cflags}"; export CFLAGS michael@68: ARGS="" michael@68: case "%{l_platform -t}" in michael@68: *-freebsd* ) CFLAGS="$CFLAGS -DOPENPKG_OS_FREEBSD" ;; michael@68: *-linux* ) CFLAGS="$CFLAGS -DOPENPKG_OS_LINUX" ;; michael@68: *-sunos* ) CFLAGS="$CFLAGS -DOPENPKG_OS_SOLARIS" ;; michael@68: *-aix* ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;; michael@68: *-darwin* ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;; michael@68: esac michael@68: case "%{l_platform -t}" in michael@68: amd64-sunos* ) ARGS="$ARGS --enable-64-bit-bdf" ;; michael@68: esac michael@68: ( echo "#!/bin/sh" michael@68: echo "touch lex.yy.c" michael@68: echo "echo 'lex.sh:WARNING: local Lex wrapper unexpectedly called.' 1>&2" michael@68: ) >lex.sh && chmod a+x lex.sh michael@68: echo "ac_cv_prog_LEX=`pwd`/lex.sh" >ld/config.cache michael@68: INSTALL="%{l_shtool} install -c" \ michael@68: AR="%{l_ar}" \ michael@68: MAKE="%{l_make}" \ michael@68: CONFIG_SHELL="%{l_bash}" \ michael@68: ./configure \ michael@68: --prefix=%{l_prefix} \ michael@331: --mandir=%{l_prefix}/man \ michael@331: --infodir=%{l_prefix}/info \ michael@68: --includedir=%{l_prefix}/include/binutils \ michael@68: --libdir=%{l_prefix}/lib/binutils \ michael@68: --disable-werror \ michael@68: --disable-nls \ michael@68: $ARGS michael@68: michael@68: # build package michael@425: %{l_make} %{l_mflags} michael@68: michael@68: %install michael@426: # install package michael@68: %{l_make} %{l_mflags} install \ michael@68: prefix=$RPM_BUILD_ROOT%{l_prefix} \ michael@68: exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \ michael@331: mandir=$RPM_BUILD_ROOT%{l_prefix}/man \ michael@331: infodir=$RPM_BUILD_ROOT%{l_prefix}/info \ michael@68: includedir=$RPM_BUILD_ROOT%{l_prefix}/include/binutils \ michael@68: libdir=$RPM_BUILD_ROOT%{l_prefix}/lib/binutils michael@68: michael@68: # platform specific stripping down of installation: michael@68: # o GNU binutils strip(1) is broken on AIX, use of OS supplied michael@68: # /usr/bin/strip from bos.rte.bind_cmds is mandatory. michael@68: # o GNU binutils strip(1), ar(1) and ranlib(1) do not work under michael@68: # Mac OS X (aka Darwin), system versions have to be used. michael@68: case "%{l_platform -t}" in michael@68: *-aix* ) michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \ michael@68: $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1 michael@68: ;; michael@68: *-darwin* ) michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \ michael@68: $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1 michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ar \ michael@68: $RPM_BUILD_ROOT%{l_prefix}/man/man1/ar.1 michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ranlib \ michael@68: $RPM_BUILD_ROOT%{l_prefix}/man/man1/ranlib.1 michael@68: ;; michael@68: esac michael@68: michael@68: # strip down installation michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/standards.info michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/configure.info* michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++filt.1 michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/dlltool.1 michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/nlmconv.1 michael@68: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/windres.1 michael@331: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/windmc.1 michael@68: rm -rf $RPM_BUILD_ROOT%{l_prefix}/*-*-* michael@68: rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin/c++filt michael@68: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@68: michael@68: # determine installation files michael@68: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@68: michael@68: %files -f files michael@68: michael@68: %clean michael@68: