Index: contrib/crossrpms/freebsd6.2/.cvsignore
===================================================================
--- contrib/crossrpms/freebsd6.2/.cvsignore	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/.cvsignore	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: contrib/crossrpms/freebsd6.2/Makefile.am
===================================================================
--- contrib/crossrpms/freebsd6.2/Makefile.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/Makefile.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,3 @@
+# $Id$
+
+SUBDIRS = i586
Index: contrib/crossrpms/freebsd6.2/binutils.am
===================================================================
--- contrib/crossrpms/freebsd6.2/binutils.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/binutils.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,30 @@
+EXTRA_DIST += binutils-sources.add
+
+BINUTILS_OPTS =
+
+BINUTILS_SUBPACKAGES = $(top_srcdir)/common/common.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/binutils.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/prep.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/build.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/install.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/rpm-install.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/common/clean.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/target-binutils.add
+BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/base-binutils.add
+
+$(TARGET)-binutils.spec.in: $(BINUTILS_SUBPACKAGES) Makefile.am $(srcdir)/binutils-sources.add
+	cat $(BINUTILS_SUBPACKAGES) | sed \
+	  -e "/[@]SOURCES[@]/r $(srcdir)/binutils-sources.add" \
+	  -e "/[@]SOURCES[@]/d" \
+	  -e "s/[@]BINUTILS_VERS[@]/$(BINUTILS_VERS)/g" \
+	  -e "s/[@]BINUTILS_PKGVERS[@]/$(BINUTILS_PKGVERS)/g" \
+	  -e "s/[@]BINUTILS_RPMREL[@]/$(BINUTILS_RPMREL)/g" \
+	  | $(MKSPEC0) > $(TARGET)-binutils.spec.in
+CLEANFILES += $(TARGET)-binutils.spec.in
+
+@rpmprefix@$(TARGET)-binutils.spec: $(TARGET)-binutils.spec.in
+	$(MKSPEC) $(TARGET)-binutils.spec.in | $(SPECSTRIP) $(BINUTILS_OPTS) > $@
+CLEANFILES += @rpmprefix@$(TARGET)-binutils.spec
+noinst_DATA += @rpmprefix@$(TARGET)-binutils.spec
+
+EXTRA_DIST += $(BINUTILS_SUBPACKAGES)
Index: contrib/crossrpms/freebsd6.2/gcc.am
===================================================================
--- contrib/crossrpms/freebsd6.2/gcc.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/gcc.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,40 @@
+EXTRA_DIST += $(srcdir)/../gcc-prep.add
+EXTRA_DIST += $(srcdir)/gcc-sources.add
+
+GCC_OPTS =
+
+GCC_SUBPACKAGES = $(top_srcdir)/common/common.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/gccnewlib.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/prep.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/build.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/install.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/rpm-install.add
+GCC_SUBPACKAGES += $(top_srcdir)/common/clean.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-gcc.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/base-gcc.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-c++.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-gfortran.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/base-gfortran.add
+GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-objc.add
+
+$(TARGET)-gcc.spec.in: $(GCC_SUBPACKAGES) Makefile.am $(srcdir)/gcc-sources.add $(srcdir)/../gcc-prep.add
+	cat $(GCC_SUBPACKAGES) | sed \
+	  -e "/[@]SOURCES[@]/r $(srcdir)/gcc-sources.add" \
+	  -e "/[@]SOURCES[@]/d" \
+	  -e "/[@]PREP[@]/r $(srcdir)/../gcc-prep.add" \
+	  -e "/[@]PREP[@]/d" \
+	  -e "s/[@]GCC_VERS[@]/$(GCC_VERS)/g" \
+	  -e "s/[@]GCC_PKGVERS[@]/$(GCC_PKGVERS)/g" \
+	  -e "s/[@]GCC_RPMREL[@]/$(GCC_RPMREL)/g" \
+	  -e "/[@]tool_target[@]-newlib/d" \
+	  -e "/[@]tool_target[@]-w32api-sys-root/d" \
+	  -e "/--with-newlib/d" \
+	  | $(MKSPEC0) > $(TARGET)-gcc.spec.in
+CLEANFILES += $(TARGET)-gcc.spec.in
+
+@rpmprefix@$(TARGET)-gcc.spec: $(TARGET)-gcc.spec.in
+	$(MKSPEC) $(TARGET)-gcc.spec.in | $(SPECSTRIP) $(GCC_OPTS) > $@
+CLEANFILES += @rpmprefix@$(TARGET)-gcc.spec
+noinst_DATA += @rpmprefix@$(TARGET)-gcc.spec
+
+EXTRA_DIST += $(GCC_SUBPACKAGES)
Index: contrib/crossrpms/freebsd6.2/i586/.cvsignore
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/.cvsignore	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/.cvsignore	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.spec
+*.spec.in
Index: contrib/crossrpms/freebsd6.2/i586/Makefile.am
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/Makefile.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/Makefile.am	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,42 @@
+# $Id$
+
+TARGET = i586-pc-freebsd6.2
+
+include $(top_srcdir)/mkspec.am
+
+FREEBSD_VERS = 6.2
+FREEBSD_RPMREL = @VERSION@
+EXTRA_DIST += libs.add
+EXTRA_DIST += target-libs.add
+
+LIBS_SUBPACKAGES = $(top_srcdir)/common/common.add
+LIBS_SUBPACKAGES += $(srcdir)/libs.add
+LIBS_SUBPACKAGES += $(top_srcdir)/gcc/rpm-install.add
+LIBS_SUBPACKAGES += $(top_srcdir)/common/clean.add
+LIBS_SUBPACKAGES += $(srcdir)/target-libs.add
+
+$(TARGET)-libs.spec.in: $(LIBS_SUBPACKAGES) Makefile.am
+	cat $(LIBS_SUBPACKAGES) | sed \
+	  -e "s/[@]FREEBSD_VERS[@]/$(FREEBSD_VERS)/g" \
+	  -e "s/[@]FREEBSD_RPMREL[@]/$(FREEBSD_RPMREL)/g" \
+	  -e "s,%{gcc_rpmvers},%{freebsd_rpmvers},g" \
+	> $(TARGET)-libs.spec.in
+CLEANFILES += $(TARGET)-libs.spec.in
+	                      
+@rpmprefix@$(TARGET)-libs.spec: $(TARGET)-libs.spec.in
+	$(MKSPEC) $(TARGET)-libs.spec.in | $(SPECSTRIP) > $@
+CLEANFILES += @rpmprefix@$(TARGET)-libs.spec
+noinst_DATA += @rpmprefix@$(TARGET)-libs.spec
+
+
+BINUTILS_VERS = 2.17
+BINUTILS_PKGVERS = $(BINUTILS_VERS)
+BINUTILS_RPMREL = @VERSION@
+include ../binutils.am
+BINUTILS_OPTS +=
+
+GCC_VERS = 4.1.2
+GCC_PKGVERS = $(GCC_VERS)
+GCC_RPMREL = @VERSION@
+include ../gcc.am
+GCC_OPTS += --languages=c,cxx,f95,objc
Index: contrib/crossrpms/freebsd6.2/i586/binutils-sources.add
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/binutils-sources.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/binutils-sources.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,5 @@
+Source0:	ftp://ftp.gnu.org/pub/binutils/binutils-%{binutils_pkgvers}.tar.bz2
+%{?_without_sources:NoSource:	0}
+%if "%{binutils_version}" == "2.16.1"
+Patch0:		binutils-2.16.1-rtems-20050708.diff
+%endif
Index: contrib/crossrpms/freebsd6.2/i586/gcc-sources.add
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/gcc-sources.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/gcc-sources.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,33 @@
+Source0: 	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
+@PATCH0@
+%{?_without_sources:NoSource:	0}
+
+%if %build_cxx
+Source1: 	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2
+@PATCH1@
+%{?_without_sources:NoSource:	1}
+
+%endif
+%if %build_f95
+Source2:	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-fortran-%{gcc_pkgvers}.tar.bz2
+@PATCH2@
+%{?_without_sources:NoSource:	2}
+
+%endif
+%if %build_gcj
+Source3:	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-java-%{gcc_pkgvers}.tar.bz2
+@PATCH3@
+%{?_without_sources:NoSource:	3}
+
+%endif
+%if %build_gnat
+Source4:	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-ada-%{gcc_pkgvers}.tar.bz2
+@PATCH4@
+%{?_without_sources:NoSource:	4}
+
+%endif
+%if %build_objc
+Source5:	ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-objc-%{gcc_pkgvers}.tar.bz2
+@PATCH5@
+%{?_without_sources:NoSource:	5}
+%endif
Index: contrib/crossrpms/freebsd6.2/i586/libs.add
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/libs.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/libs.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,93 @@
+%define freebsd_version @FREEBSD_VERS@
+%define freebsd_rpmvers %{expand:%(echo @FREEBSD_VERS@ | tr - _)}
+
+%define _use_internal_dependency_generator 0
+%define __debug_install_post %{nil}
+
+Name:		@rpmprefix@@tool_target@
+Release:	@FREEBSD_RPMREL@%{?dist}
+License:	FreeBSD
+Group:		Development/Tools
+
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch:	noarch
+BuildRequires:	/usr/bin/star
+
+Version:      	%freebsd_rpmvers
+Summary:      	@tool_target@ Libraries
+
+Source0:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.aa
+Source1:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ab
+Source2:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ac
+Source3:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ad
+Source4:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ae
+Source5:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.af
+Source6:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ag
+Source7:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ah
+Source8:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ai
+Source9:  ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.aj
+Source10: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ak
+Source11: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.al
+Source12: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.am
+Source13: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.an
+Source14: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ao
+Source15: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ap
+Source16: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.aq
+Source17: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ar
+Source18: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.as
+Source19: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.at
+Source20: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.au
+Source21: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.av
+Source22: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.aw
+Source23: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ax
+Source24: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ay
+Source25: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.az
+Source26: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.ba
+Source27: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.bb
+Source28: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.bc
+Source29: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/@FREEBSD_VERS@-RELEASE/base/base.bd
+
+%description
+@tool_target@ libraries.
+
+%prep
+%setup -q -c -T -n %{name}-%{version}
+
+  cat \
+ %SOURCE0 %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 \
+ %SOURCE5 %SOURCE6 %SOURCE7 %SOURCE8 %SOURCE9 \
+ %SOURCE10 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE14 \
+ %SOURCE15 %SOURCE16 %SOURCE17 %SOURCE18 %SOURCE19 \
+ %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24 \
+ %SOURCE25 %SOURCE26 %SOURCE27 %SOURCE28 %SOURCE29 \
+ | /usr/bin/star xzf - lib usr/lib usr/include
+
+%build
+  # Setup sys-root (Usable for gcc >= 3.4)
+  mkdir -p @tool_target@/sys-root
+  %{__tar} cf - lib usr/lib usr/include | ( cd @tool_target@/sys-root ; %{__tar} xf -)
+
+  pushd @tool_target@/sys-root/usr/lib > /dev/null
+  # missing files
+  rm -f lib*_p.*
+  # not needed
+  rm -rf aout compat
+
+  # Fix up symlinks
+  find -type l -exec ls -l {} \; | \
+    while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
+    case $aA in
+    /lib* ) # link
+       rm $a8;
+       b=`basename $aA`
+       ln -s ../../lib/$b $a8
+       ;;
+    esac
+  done
+  popd > /dev/null
+
+%install
+  rm -rf $RPM_BUILD_ROOT
+  mkdir -p $RPM_BUILD_ROOT%{_prefix}
+  cp -a @tool_target@ $RPM_BUILD_ROOT%{_prefix}
+
Index: contrib/crossrpms/freebsd6.2/i586/target-libs.add
===================================================================
--- contrib/crossrpms/freebsd6.2/i586/target-libs.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
+++ contrib/crossrpms/freebsd6.2/i586/target-libs.add	(revision 2aa2177a229c19e6e7ffd057fe681191c7bf549b)
@@ -0,0 +1,11 @@
+%package sys-root
+Group: Development/Tools
+Summary: @tool_target@ target files for gcc >= 3.4
+
+%description sys-root
+@tool_target@ target files for gcc >= 3.4
+
+%files sys-root
+%defattr(-,root,root,-)
+%dir %{_prefix}/@tool_target@
+%{_prefix}/@tool_target@/sys-root
