diff options
-rw-r--r-- | packaging/baselibs.conf | 15 | ||||
-rw-r--r-- | packaging/libgcc-x86.spec | 227 |
2 files changed, 161 insertions, 81 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index 13c8182..2a86b67 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -1,3 +1,12 @@ -arch i586 targets armv5tel:arm armv7l:arm armv7hl:arm armv7nhl:arm - - +arch i586 targets armv5tel:arm armv6l:arm armv7l:arm armv7hl:arm armv7nhl:arm +libgcc-x86 + targettype x86 block! + targettype 32bit block! + targettype arm autoreqprov off + targettype arm requires "libgcc" + targettype arm prefix /emul/ia32-linux + targettype arm extension -arm + targettype arm +/ + targettype arm -//usr/share/man + targettype arm -//usr/share/doc + targettype arm requires "tizen-accelerator" diff --git a/packaging/libgcc-x86.spec b/packaging/libgcc-x86.spec index 60dd269..a2a73da 100644 --- a/packaging/libgcc-x86.spec +++ b/packaging/libgcc-x86.spec @@ -1,47 +1,58 @@ %define __strip /bin/true -%define _build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.dontuse.rpm -# meta spec file for cross-chroot setup +%define _build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.vanish.rpm +# meta spec file for cross-chroot setup # -# Copyright (c) 2010 Jan-Simon Möller (jsmoeller@linuxfoundation.org) +# Copyright (c) 2009-2011 Martin Mohring (martin.mohring@opensuse.org) +# Copyright (c) 2011 5eEcoSystems (info@5eecosystems.com) # # All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the +# remain the property of the copyright owners, unless otherwise agreed +# upon. The cross build accelerators as is, and modifications +# and additions to the it, are licensed under the GPLv2. +# In addition, the cross build accelerators are licensed together with +# a package where they will be contained in +# under the license of the prestine package (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -## README -## -## In this file: -## 1) define name of original package (see oldname) -## -## File binaries_to_prepare: -## 2) fill in the binaries which need to be available to the foreign chroot -## e.g. /bin/bash - this will make a i586 bash available -## -## File libraries_to_prepare: -## 3) fill in the libraries which need special treatment by patchelf -## -## File special_script: -## 4) fill in the special scrit to call, if needed - - #\/\/\/\/\/\/\/\/\/\/ ### only changes here + # # The original package name %define oldname libgcc + # # The architectures this meta package is built on %define myexclusive i586 + # -### no changes needed below this line -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# The required package for building this package +# This can be distribution dependent. Good start is: +# e.g. rpm grep tar sed patchelf +# +BuildRequires: rpm grep tar sed patchelf +# +# Additional required packages needed in addition to those of original package +# e.g. (usually empty) for an accelerator to be 100% compatible +# +#Requires: <usuallyemptlylist> +# For a real accelerator, also the old packge is required for compatibility +# pls change this only if you know what you do +Requires: %oldname + +# +# Release under which to put the accelerator +# e.g. 1 or higher +# +Release: 8.3 + +### no changes needed below this line +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ### no changes needed # @@ -62,6 +73,7 @@ # # New rpath to add to files on request %define newrpath "/emul/ia32-linux/lib:/emul/ia32-linux/usr/lib" +%define newinterpreter /emul/ia32-linux/lib/ld-linux.so.2 # # Some automatic checks for availability # binaries_to_prepare @@ -71,20 +83,19 @@ %define files_to_ignore %{expand:%(test -e %{_sourcedir}/files_to_ignore && echo 1 || echo 0)} # ### no changes needed below this line +%define nodebug 1 + Name: %newname Version: %newversion -Release: 1 AutoReqProv: 0 Provides: %newname -BuildRequires: rpm grep tar patchelf sed BuildRequires: %oldname -Requires: %oldname # no auto requirements - they're generated License: %newlicense Group: %newgroup ExclusiveArch: %myexclusive -Summary: %newsummary +Summary: Dont use %newsummary ! BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %binaries_to_prepare Source10: binaries_to_prepare @@ -95,11 +106,14 @@ Source20: libraries_to_prepare %if %special_script Source30: special_script %endif +%if %files_to_ignore +Source40: files_to_ignore +%endif Source100: baselibs.conf %description This is a meta-package providing %name. -It is not intended to be used in a normal System! +It is not intended to be used on a normal system/device! Original description: %{expand:%(rpm -q --qf '[%{description}]' %oldname)} @@ -110,44 +124,95 @@ Original description: %build %install +%if %nodebug set +x +%endif mkdir -p %buildroot rpm -ql %oldname > filestoinclude1 + +# ignore files - construct sed script +sedtmp="sedtmp.$$" +echo "s#^%{_docdir}.*##" >> $sedtmp +echo "s#^%{_mandir}.*##" >> $sedtmp +echo "s#^%{_infodir}.*##" >> $sedtmp + +# evaluate files_to_ignore %if %files_to_ignore for i in `cat %{_sourcedir}/files_to_ignore`; do echo "Ignoring file: $i" - sed -e "s#^${i}.*##" -i filestoinclude1 + echo "s#^${i}.*##" >> $sedtmp done %endif -tar -T filestoinclude1 -cpf - | ( cd %buildroot && tar -xvpf - ) + +# ignore default filesystem files +for i in `rpm -ql filesystem`; do + echo "s#^${i}\$##" >> $sedtmp +done + +#finish up +echo "/^\$/d" >> $sedtmp + +#execute +sed -f $sedtmp -i filestoinclude1 + +# tar copy to buildroot +tar -T filestoinclude1 -cpf - | ( cd %buildroot && tar -xpf - ) +rm filestoinclude1 + +# Todo: refractor +# no directories, in filelist find %buildroot > filestoinclude2 -cat filestoinclude2 | sed -e "s#%{buildroot}##g" | uniq | sort > filestoinclude +cat filestoinclude2 | sed -e "s#%{buildroot}##g" | uniq | sort > filestoinclude1 +for i in `cat filestoinclude1`; do +# no directories + if ! test -d %buildroot/$i ; then + # + echo "$i" >> filestoinclude + fi +done +rm filestoinclude1 +rm filestoinclude2 + +# patchelf the binaries %if %binaries_to_prepare echo "" echo "[ .oO Preparing binaries Oo. ]" echo "" -mkdir %buildroot/%{_prefix}/share/applybinary/ -set -x +mkdir -p %buildroot/%{_prefix}/share/applybinary/ for binary in `cat %{_sourcedir}/binaries_to_prepare` ; do echo "Processing binary: $binary" -# deps=$(for i in `readelf -a "$binary" | grep "(NEEDED)" | sed -e "s/.*\[//g" -e "s/\].*//g" ` ; do rpm -q --whatprovides "$i" ; done) - ldd /bin/rpm | grep -v "ld-linux" | grep -v "linux-gate" | sed -e "s#=.*##g" -e "s#^\t*##g" > 1 - deps=$(for i in `cat 1` ; do rpm -q --whatprovides "$i" | grep -v "no package"; done) - cleandeps=$(echo "$cleandeps" "$deps" | sort | uniq | sed -e "s/-[0-9].*//g") - patchelf --debug --set-rpath %newrpath %buildroot/$binary - patchelf --debug --set-interpreter /emul/ia32-linux/lib/ld-linux.so.2 %buildroot/$binary - patchelf --print-rpath %buildroot/$binary - patchelf --print-interpreter %buildroot/$binary + tmp="tmp.$$" +%if %nodebug + debug= +%else + debug="--debug" +%endif + if file $binary | grep -q dynamic; then + ldd $binary | grep -v "ld-linux" | grep -v "linux-gate" | sed -e "s#=.*##g" -e "s#^\t*##g" > $tmp + deps=$(for i in `cat $tmp` ; do rpm -q --whatprovides "$i" | grep -v "no package"; done) + cleandeps=$(echo "$cleandeps" "$deps" | sort | uniq | sed -e "s/-[0-9].*//g") + patchelf $debug --set-rpath %newrpath %buildroot/$binary + patchelf $debug --set-interpreter %newinterpreter %buildroot/$binary + patchelf $debug --set-rpath %newrpath %buildroot/$binary + patchelf $debug --set-interpreter %newinterpreter %buildroot/$binary + if test -n "$debug"; then + patchelf --print-rpath %buildroot/$binary + patchelf --print-interpreter %buildroot/$binary + fi + fi echo "$binary" >> %buildroot/%{_prefix}/share/applybinary/%name echo "" done -set +x %endif + +# stub %if %libraries_to_prepare echo "" echo "[ .oO Preparing libraries Oo. ]" echo "" %endif + +# stub %if %special_script echo "" echo "[ .oO Executing special script Oo. ]" @@ -168,71 +233,66 @@ shellquote() done } + echo "Creating baselibs_new.conf" echo "" rm -rRf /tmp/baselibs_new.conf || true + shellquote "%{name}" >> /tmp/baselibs_new.conf shellquote " targettype x86 block!" >> /tmp/baselibs_new.conf shellquote " targettype 32bit block!" >> /tmp/baselibs_new.conf shellquote " targettype arm autoreqprov off" >> /tmp/baselibs_new.conf + +# automagically fill in basic requirements for i in $cleandeps ; do shellquote " targettype arm requires \"${i}-x86-arm\"" >> /tmp/baselibs_new.conf done + +# we require the native version shellquote " targettype arm requires \"%{oldname}\" " >> /tmp/baselibs_new.conf shellquote " targettype arm prefix /emul/ia32-linux" >> /tmp/baselibs_new.conf shellquote " targettype arm extension -arm" >> /tmp/baselibs_new.conf shellquote " targettype arm +/" >> /tmp/baselibs_new.conf -shellquote " targettype arm -%{_mandir}" >> /tmp/baselibs_new.conf -shellquote " targettype arm -%{_docdir}" >> /tmp/baselibs_new.conf + +# safe space and download time +shellquote " targettype arm -/%{_mandir}" >> /tmp/baselibs_new.conf +shellquote " targettype arm -/%{_docdir}" >> /tmp/baselibs_new.conf shellquote " targettype arm requires \"tizen-accelerator\"" >> /tmp/baselibs_new.conf + +# replace native with x86 binaries as defined in file %if %binaries_to_prepare -#shellquote " targettype arm post \"replacenative() {\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" echo \"Replacing \${myfile}. Backup is \${myfile}.orig-arm.\" \"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" mv \${myfile} \${myfile}.orig-arm ; ln -s <prefix>\${myfile} \${myfile} \"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \"}\"" >> /tmp/baselibs_new.conf +# Todo: error handling if .orig-arm is present for binary in `cat %{_sourcedir}/binaries_to_prepare` ; do - shellquote " targettype arm post \" mv ${binary} ${binary}.orig-arm ; ln -s <prefix>${binary} ${binary} \"" >> /tmp/baselibs_new.conf + shellquote " targettype arm post \" if test -e ${binary}.orig-arm -a -h ${binary}; then \" " >> /tmp/baselibs_new.conf + shellquote " targettype arm post \" echo \"${binary}.orig-arm already present - skipping.\" \" " >> /tmp/baselibs_new.conf + shellquote " targettype arm post \" else \" " >> /tmp/baselibs_new.conf + shellquote " targettype arm post \" mv ${binary} ${binary}.orig-arm ; ln -s <prefix>${binary} ${binary} \"" >> /tmp/baselibs_new.conf + shellquote " targettype arm post \" fi \" " >> /tmp/baselibs_new.conf done -#shellquote " targettype arm post \"toreplace=\`rpm -ql <name>-<extension> \| grep applybinary/<name>\`\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \"if test x\${toreplace} != x ; then\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" files=\`cat \${toreplace}\`\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" for myfile in \${files}\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" do\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" #only replace files and nothing else by accident\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" #if test -f \${myfile}; then\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" replacenative \$myfile\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" #fi\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \" done\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm post \"fi\"" >> /tmp/baselibs_new.conf + shellquote " " >> /tmp/baselibs_new.conf for binary in `cat %{_sourcedir}/binaries_to_prepare` ; do - shellquote " targettype arm preun \" rm -f ${binary} ; mv ${binary}.orig-arm ${binary}\"" >> /tmp/baselibs_new.conf + + shellquote " targettype arm preun \" if test -e ${binary}.orig-arm ; then \"" >> /tmp/baselibs_new.conf + shellquote " targettype arm preun \" rm -f ${binary} ; mv ${binary}.orig-arm ${binary}\"" >> /tmp/baselibs_new.conf + shellquote " targettype arm preun \" fi \"" >> /tmp/baselibs_new.conf + done -#shellquote " targettype arm preun \"toreplace=\`rpm -ql <name>-<extension> \| grep applybinary/<name>\`\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \"if test x\${toreplace} != x ; then\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" files=\`cat \${toreplace}\`\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" for myfile in \${files}\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" do\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" #only replace files and nothing else by accident\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" if test -f \${myfile}; then\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" restorenative \$myfile\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" fi\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \" done\"" >> /tmp/baselibs_new.conf -#shellquote " targettype arm preun \"fi\"" >> /tmp/baselibs_new.conf %endif cat /tmp/baselibs_new.conf >> %{_sourcedir}/baselibs.conf - -echo "" +echo "################################################################################" echo "" echo "" echo "REQUIREMENTS:" -grep "requires" %{_sourcedir}/baselibs.conf -echo "" +grep "requires" %{_sourcedir}/baselibs.conf | sort | uniq | sed -e "s# targettype.*requires ##g" | while read k ; do + echo "CBinstall: $k" +done +echo "Runscripts: %{newname}-arm" echo "" echo "" -sleep 2 +echo "################################################################################" set -x %clean @@ -243,3 +303,14 @@ rm -rf $RPM_BUILD_ROOT %if %binaries_to_prepare /%{_prefix}/share/applybinary/%name %endif +%changelog +* Fri Jul 6 2012 UkJung Kim <ujkim@samsung.com> - 1.0 +- Added and updated OBS-Accelerator-0.1.tar.bz2 +* Sun Apr 24 2011 Jan-Simon Möller <jsmoeller@linuxfoundation.org> - 1.0 +- Add baselibs.conf to src.rpm +* Tue Jan 4 2011 Carsten Munk <carsten@maemo.org> - 1.0 +- Add armv7hl and armv7nhl support, part of fix for BMC#12112 +* Tue May 4 2010 Jan-Simon Möller <jsmoeller@linuxfoundation.org> - 1.0 +- Update to armv7 crossbuild. +* Wed Apr 21 2010 Jan-Simon Möller <jsmoeller@linuxfoundation.org> - 1.0 +- Initial version on meego.com |