Skip to content
Browse files

Update rpm machinery

  • Loading branch information...
1 parent 28a26f4 commit a7ad179251ad051c1e7ee47035555a0db7c53af6 @atgreen committed
View
2 BUILDNUM
@@ -1 +1 @@
-99
+126
View
2 build.xml
@@ -596,7 +596,7 @@
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
- <arg value="(cd build/rtems; ../../rtems/configure --target=moxie-rtems --disable-tests --prefix=`(cd ../../root/usr; pwd)`)"/>
+ <arg value="(cd build/rtems; ../../rtems/configure --enable-testsuites=samples --target=moxie-rtems --prefix=`(cd ../../root/usr; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
View
60 scripts/mkrpms.sh
@@ -1,46 +1,40 @@
#!/bin/sh
-
+set -x
# For this to work, the mock config file for $TARGET must point to the
# local yum repo at $REPO.
-#CPU=x86_64
-CPU=i686
+CPU=x86_64
+#CPU=i686
-TARGET=fedora-12-i386
+TAG=fc15
+TARGET=fedora-15-$CPU
RESULTDIR=/var/lib/mock/$TARGET/result
-REPO=dist/MoxieLogic/$CPU
+REPO=dist/MoxieLogic/$TAG
mkdir -p $REPO/RPMS/$CPU/debuginfo
mkdir -p $REPO/RPMS/noarch
mkdir -p $REPO/SRPMS
createrepo $REPO
-mock -r $TARGET dist/moxie-elf-binutils-*src.rpm
-mv $RESULTDIR/moxie-elf-binutils-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo
-mv $RESULTDIR/moxie-elf-binutils-*src.rpm $REPO/SRPMS
-mv $RESULTDIR/moxie-elf-binutils-*.rpm $REPO/RPMS/$CPU
-createrepo $REPO
+for i in moxie-elf-binutils moxie-elf-gcc moxie-elf-newlib moxie-elf-gdb moxie-elf-qemu moxie-rtems-binutils moxie-rtems-newlib moxie-rtems-gcc moxie-rtems; do
+ mock -r $TARGET dist/$i-[0-9]*src.rpm;
+ FILE=`ls $RESULTDIR/$i-*.rpm | head -1`
+ if test x$FILE != "x"; then
+ rm $REPO/RPMS/noarch/$i-[0-9]*.rpm
+ mv $RESULTDIR/$i-*src.rpm $REPO/SRPMS;
+ case `ls $RESULTDIR/$i-*.rpm` in
+ *noarch*)
+ rm $REPO/RPMS/noarch/$i-[0-9]*.rpm
+ mv $RESULTDIR/$i-*.rpm $REPO/RPMS/noarch;
+ ;;
+ *)
+ rm $REPO/RPMS/$CPU/debuginfo/$i-debuginfo*.rpm
+ rm $REPO/RPMS/$CPU/$i-[0-9]*.rpm
+ mv $RESULTDIR/$i-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo;
+ mv $RESULTDIR/$i-*.rpm $REPO/RPMS/$CPU;
+ ;;
+ esac
+ createrepo $REPO;
+ fi;
+done
-mock -r $TARGET dist/moxie-elf-gcc-*src.rpm
-mv $RESULTDIR/moxie-elf-gcc-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo
-mv $RESULTDIR/moxie-elf-gcc-*src.rpm $REPO/SRPMS
-mv $RESULTDIR/moxie-elf-gcc-*.rpm $REPO/RPMS/$CPU
-createrepo $REPO
-
-mock -r $TARGET dist/moxie-elf-newlib-*src.rpm
-mv $RESULTDIR/moxie-elf-newlib-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo
-mv $RESULTDIR/moxie-elf-newlib-*src.rpm $REPO/SRPMS
-mv $RESULTDIR/moxie-elf-newlib-*.rpm $REPO/RPMS/$CPU
-createrepo $REPO
-
-mock -r $TARGET dist/moxie-elf-gdb-*src.rpm
-mv $RESULTDIR/moxie-elf-gdb-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo
-mv $RESULTDIR/moxie-elf-gdb-*src.rpm $REPO/SRPMS
-mv $RESULTDIR/moxie-elf-gdb-*.rpm $REPO/RPMS/$CPU
-createrepo $REPO
-
-mock -r $TARGET dist/moxie-elf-qemu-*src.rpm
-mv $RESULTDIR/moxie-elf-qemu-debuginfo*.rpm $REPO/RPMS/$CPU/debuginfo
-mv $RESULTDIR/moxie-elf-qemu-*src.rpm $REPO/SRPMS
-mv $RESULTDIR/moxie-elf-qemu-*.rpm $REPO/RPMS/$CPU
-createrepo $REPO
View
111 scripts/mksrpm.sh
@@ -16,34 +16,66 @@ fi
rm -f dist/*.spec
rm -f dist/*.rpm
-cp scripts/moxie-elf-binutils.spec.in dist/moxie-elf-binutils.spec
-sed -i "s/@VERSION@/$BINUTILS_VERSION/g" dist/moxie-elf-binutils.spec
-sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-binutils.spec
-cp scripts/moxie-elf-gdb.spec.in dist/moxie-elf-gdb.spec
-sed -i "s/@VERSION@/$GDB_VERSION/g" dist/moxie-elf-gdb.spec
-sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-gdb.spec
-cp scripts/moxie-elf-gcc.spec.in dist/moxie-elf-gcc.spec
-sed -i "s/@VERSION@/$GCC_VERSION/g" dist/moxie-elf-gcc.spec
-sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-gcc.spec
-cp scripts/moxie-elf-newlib.spec.in dist/moxie-elf-newlib.spec
-sed -i "s/@VERSION@/$NEWLIB_VERSION/g" dist/moxie-elf-newlib.spec
-sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-newlib.spec
+for i in elf rtems; do
+ cp scripts/moxie-$i-binutils.spec.in dist/moxie-$i-binutils.spec
+ sed -i "s/@VERSION@/$BINUTILS_VERSION/g" dist/moxie-$i-binutils.spec
+ sed -i "s/@DATE@/$DATE/g" dist/moxie-$i-binutils.spec
+ cp scripts/moxie-$i-gcc.spec.in dist/moxie-$i-gcc.spec
+ sed -i "s/@VERSION@/$GCC_VERSION/g" dist/moxie-$i-gcc.spec
+ sed -i "s/@DATE@/$DATE/g" dist/moxie-$i-gcc.spec
+ cp scripts/moxie-$i-newlib.spec.in dist/moxie-$i-newlib.spec
+ sed -i "s/@VERSION@/$NEWLIB_VERSION/g" dist/moxie-$i-newlib.spec
+ sed -i "s/@DATE@/$DATE/g" dist/moxie-$i-newlib.spec
+
+ sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-$i-binutils.spec
+ sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-$i-gcc.spec
+ sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-$i-newlib.spec
+done;
+
+cp scripts/moxie-rtems.spec.in dist/moxie-rtems.spec
+sed -i "s/@VERSION@/4.10.99.0/g" dist/moxie-rtems.spec
+sed -i "s/@DATE@/$DATE/g" dist/moxie-rtems.spec
+sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-rtems.spec
+
cp scripts/moxie-elf-qemu.spec.in dist/moxie-elf-qemu.spec
sed -i "s/@VERSION@/$QEMU_VERSION/g" dist/moxie-elf-qemu.spec
sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-qemu.spec
-cp scripts/kernel.spec.in dist/kernel.spec
-
-sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-binutils.spec
-sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-gdb.spec
-sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-gcc.spec
-sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-newlib.spec
sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-qemu.spec
+cp scripts/moxie-elf-gdb.spec.in dist/moxie-elf-gdb.spec
+sed -i "s/@VERSION@/$GDB_VERSION/g" dist/moxie-elf-gdb.spec
+sed -i "s/@DATE@/$DATE/g" dist/moxie-elf-gdb.spec
+sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/moxie-elf-gdb.spec
+
+#cp scripts/kernel.spec.in dist/kernel.spec
+#sed -i "s/@DATE@/$DATE/g" dist/kernel.spec
+
+#sed -i "s/@BUILDNUM@/$BUILDNUM/g" dist/kernel.spec
(cd qemu; make clean > /dev/null 2>&1)
tar -czf dist/moxie-elf-qemu.tar.gz qemu
rpmbuild --nodeps --define "VERSION $QEMU_VERSION" --define "_sourcedir dist" --define "_srcrpmdir dist" -bs dist/moxie-elf-qemu.spec
+
+tar \
+--exclude CVS \
+--exclude src/libgloss \
+--exclude src/newlib \
+--exclude src/gas \
+--exclude src/binutils \
+--exclude src/ld \
+--exclude src/gold \
+--exclude src/gprof \
+-czf dist/moxie-gdb.tar.gz src
+
+rpmbuild \
+--define "_sourcedir dist" \
+--define "_srcrpmdir dist" \
+--define "VERSION $BINUTILS_VERSION" \
+-bs dist/moxie-elf-gdb.spec
+
+for i in elf rtems; do
+
(cd gcc; ./contrib/gcc_update --touch)
tar \
--exclude .svn \
@@ -60,9 +92,9 @@ tar \
--exclude libobjc \
--exclude ppl \
--exclude cloog-ppl \
--czf dist/moxie-elf-gcc.tar.gz gcc
+-czf dist/moxie-gcc.tar.gz gcc
-rpmbuild --nodeps --define "VERSION $GCC_VERSION" --define "_sourcedir dist" --define "_srcrpmdir dist" -bs dist/moxie-elf-gcc.spec
+rpmbuild --nodeps --define "VERSION $GCC_VERSION" --define "_sourcedir dist" --define "_srcrpmdir dist" -bs dist/moxie-$i-gcc.spec
tar \
--exclude CVS \
@@ -73,30 +105,13 @@ tar \
--exclude src/readline \
--exclude src/libdecnumber \
--exclude src/gold \
--czf dist/moxie-elf-binutils.tar.gz src
+-czf dist/moxie-binutils.tar.gz src
rpmbuild \
--define "_sourcedir dist" \
--define "_srcrpmdir dist" \
--define "VERSION $BINUTILS_VERSION" \
--bs dist/moxie-elf-binutils.spec
-
-tar \
---exclude CVS \
---exclude src/libgloss \
---exclude src/newlib \
---exclude src/gas \
---exclude src/binutils \
---exclude src/ld \
---exclude src/gold \
---exclude src/gprof \
--czf dist/moxie-elf-gdb.tar.gz src
-
-rpmbuild \
---define "_sourcedir dist" \
---define "_srcrpmdir dist" \
---define "VERSION $BINUTILS_VERSION" \
--bs dist/moxie-elf-gdb.spec
+-bs dist/moxie-$i-binutils.spec
tar \
--exclude CVS \
@@ -124,17 +139,27 @@ tar \
--exclude src/readline \
--exclude src/sim \
--exclude src/texinfo \
--czf dist/moxie-elf-newlib.tar.gz src
+-czf dist/moxie-newlib.tar.gz src
rpmbuild --nodeps \
--define "_sourcedir dist" \
--define "_srcrpmdir dist" \
--bs dist/moxie-elf-newlib.spec
+-bs dist/moxie-$i-newlib.spec
+
+done;
tar \
--czf dist/linux-2.6.tar.gz linux-2.6
+-czf dist/rtems.tar.gz rtems
rpmbuild --nodeps \
--define "_sourcedir dist" \
--define "_srcrpmdir dist" \
--bs dist/kernel.spec
+-bs dist/moxie-rtems.spec
+
+#tar \
+#-czf dist/linux-2.6.tar.gz linux-2.6
+#
+#rpmbuild --nodeps \
+#--define "_sourcedir dist" \
+#--define "_srcrpmdir dist" \
+#-bs dist/kernel.spec
View
2 scripts/moxie-elf-binutils.spec.in
@@ -6,7 +6,7 @@ Summary: The GNU binutils for the moxie core
Group: Development/Tools
License: GPL
URL: http://moxielogic.com/blog
-Source0: moxie-elf-binutils.tar.gz
+Source0: moxie-binutils.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: texinfo bison flex
View
4 scripts/moxie-elf-gcc.spec.in
@@ -8,7 +8,7 @@ Summary: The GNU Compiler Collection targeting the moxie core
Group: Development
License: GPL
URL: http://moxielogic.com/blog
-Source0: moxie-elf-gcc.tar.gz
+Source0: moxie-gcc.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: moxie-elf-binutils flex bison texinfo gperf
@@ -89,7 +89,9 @@ cd build
--with-newlib \
%else
--enable-languages=c \
+ --without-newlib \
%endif
+ --disable-libquadmath \
--disable-libssp
make %{?_smp_mflags}
cd ..
View
9 scripts/moxie-elf-gdb.spec.in
@@ -6,7 +6,7 @@ Summary: The GNU gdb for the moxie core
Group: Development/Tools
License: GPL
URL: http://moxielogic.com/blog
-Source0: moxie-elf-gdb.tar.gz
+Source0: moxie-gdb.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: texinfo ncurses-devel zlib-devel flex bison dtc
@@ -41,6 +41,7 @@ CFLAGS="%optflags" ./configure \
--infodir=%_infodir \
--enable-shared \
--disable-gdbtk \
+ --with-gdb-datadir=%_datadir/%{name}-%{version} \
--target=moxie-elf
%__make tooldir=%_prefix all
@@ -58,16 +59,18 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
+%dir %_datadir/%{name}-%{version}
%{_bindir}/*
%exclude %{_bindir}/moxie-elf-run
%{_mandir}/man1/*
-%{_datadir}/gdb
+%_datadir/%{name}-%{version}/syscalls
+%_datadir/%{name}-%{version}/python
%doc COPYING*
%files sim
%defattr(-,root,root,-)
%{_bindir}/moxie-elf-run
-%{_datadir}/gdb-*
+%_datadir/%{name}-%{version}/dtb
%doc COPYING*
%changelog
View
8 scripts/moxie-elf-newlib.spec.in
@@ -1,3 +1,5 @@
+%define _binaries_in_noarch_packages_terminate_build 0
+
Name: moxie-elf-newlib
Version: @VERSION@
Release: 0.@BUILDNUM@
@@ -6,16 +8,14 @@ Summary: An embedded C runtime library
Group: Development/Tools
License: BSD
URL: http://moxielogic.org
-Source0: moxie-elf-newlib.tar.gz
+Source0: moxie-newlib.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: moxie-elf-gcc
BuildRequires: moxie-elf-gcc
-# This doesn't seem to be working anymore. Is it complaining about
-# the moxie elf files?
-#BuildArch: noarch
+BuildArch: noarch
%description
Newlib is a C library intended for use on embedded systems. It is a
View
1 scripts/moxie-elf-qemu.spec.in
@@ -37,6 +37,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_bindir}/*
+/usr/etc/qemu
%doc COPYING*
%changelog
View
70 scripts/moxie-rtems-binutils.spec.in
@@ -0,0 +1,70 @@
+Name: moxie-rtems-binutils
+Version: @VERSION@
+Release: 0.@BUILDNUM@
+Summary: The GNU binutils for the moxie core
+
+Group: Development/Tools
+License: GPL
+URL: http://moxielogic.com/blog
+Source0: moxie-binutils.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: texinfo bison flex
+
+%description
+binutils is a collection of binary utilities, including ar (for creating,
+modifying and extracting from archives), nm (for listing symbols from
+object files), objcopy (for copying and translating object files),
+objdump (for displaying information from object files), ranlib (for
+generating an index for the contents of an archive), size (for listing
+the section sizes of an object or archive file), strings (for listing
+printable strings from files), strip (for discarding symbols), c++filt
+(a filter for demangling encoded C++ symbols), addr2line (for converting
+addresses to file and line).
+
+%prep
+%setup -q -n src
+
+
+%build
+CFLAGS="%optflags" ./configure \
+ %_target_platform \
+ --prefix=%_prefix \
+ --exec-prefix=%_exec_prefix \
+ --bindir=%_bindir \
+ --sbindir=%_sbindir \
+ --sysconfdir=%_sysconfdir \
+ --datadir=%_datadir \
+ --includedir=%_includedir \
+ --libdir=%_libdir \
+ --libexecdir=%_libexecdir \
+ --localstatedir=%_localstatedir \
+ --sharedstatedir=%_sharedstatedir \
+ --mandir=%_mandir \
+ --infodir=%_infodir \
+ --enable-shared \
+ --target=moxie-rtems
+%__make tooldir=%_prefix all info
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT%_datadir/locale
+rm -rf $RPM_BUILD_ROOT%_infodir
+rm -rf $RPM_BUILD_ROOT%_libdir/*.a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/*
+%{_prefix}/moxie-rtems
+%{_prefix}/*/moxie-rtems
+%{_mandir}/man1/*
+%doc COPYING*
+
+
+%changelog
+* @DATE@ Anthony Green <green@moxielogic.com> @VERSION@-1
+- Created.
View
142 scripts/moxie-rtems-gcc.spec.in
@@ -0,0 +1,142 @@
+%define with_newlib 1
+
+Name: moxie-rtems-gcc
+Version: @VERSION@
+Release: 0.@BUILDNUM@
+Summary: The GNU Compiler Collection targeting the moxie core
+
+Group: Development
+License: GPL
+URL: http://moxielogic.com/blog
+Source0: moxie-gcc.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: moxie-rtems-binutils flex bison texinfo gperf
+BuildRequires: gmp-devel mpfr-devel libmpc-devel zlib-devel
+Requires: moxie-rtems-binutils
+%if %{with_newlib} == 1
+BuildRequires: moxie-rtems-newlib
+Requires: moxie-rtems-newlib
+%endif
+
+%description
+The GNU Compiler Collection targeting the moxie core.
+
+%if %{with_newlib} == 1
+%package c++
+Summary: GNU C++ compiler for the moxie core
+Group: Development
+Requires: moxie-elf-binutils moxie-elf-gcc
+
+%description c++
+GNU C++ compiler for the moxie core.
+
+%package libstdc++
+Summary: C++ runtime library for the moxie core
+Group: Development/Libraries
+Requires: moxie-rtems-gcc-c++
+
+%description libstdc++
+C++ runtime library for the moxie core.
+%endif
+
+%prep
+%setup -q -n gcc
+
+# Extract %%__os_install_post into os_install_post~
+cat << \EOF > os_install_post~
+%__os_install_post
+EOF
+
+# Generate customized brp-*scripts
+cat os_install_post~ | while read a x y; do
+case $a in
+# Prevent brp-strip* from trying to handle foreign binaries
+*/brp-strip*)
+ b=$(basename $a)
+ sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
+ chmod a+x $b
+ ;;
+esac
+done
+
+sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
+< os_install_post~ > os_install_post
+
+%build
+
+mkdir build
+cd build
+../configure \
+ %_target_platform \
+ --prefix=%_prefix \
+ --exec-prefix=%_exec_prefix \
+ --bindir=%_bindir \
+ --sbindir=%_sbindir \
+ --sysconfdir=%_sysconfdir \
+ --datadir=%_datadir \
+ --includedir=%_includedir \
+ --libdir=%_libdir \
+ --libexecdir=%_libexecdir \
+ --localstatedir=%_localstatedir \
+ --sharedstatedir=%_sharedstatedir \
+ --mandir=%_mandir \
+ --infodir=%_infodir \
+ --enable-shared \
+ --target=moxie-rtems \
+%if %{with_newlib} == 1
+ --enable-languages=c,c++ \
+ --with-newlib \
+%else
+ --enable-languages=c \
+ --without-newlib \
+%endif
+ --disable-libquadmath \
+ --disable-libssp
+make %{?_smp_mflags}
+cd ..
+
+%install
+rm -rf $RPM_BUILD_ROOT
+cd build
+make install DESTDIR=$RPM_BUILD_ROOT
+cd ..
+rm -rf $RPM_BUILD_ROOT%_datadir/locale
+rm -rf $RPM_BUILD_ROOT%_infodir
+rm $RPM_BUILD_ROOT%{_libdir}/*.a
+
+%define __os_install_post . ./os_install_post
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/*
+%if %{with_newlib} == 1
+%exclude %{_bindir}/moxie-rtems-c++
+%exclude %{_bindir}/moxie-rtems-g++
+%endif
+%{_libdir}/gcc/moxie-rtems
+%{_prefix}/libexec/gcc/moxie-rtems
+%{_mandir}/man1/*
+%{_mandir}/man7/*
+%doc COPYING*
+
+%if %{with_newlib} == 1
+%files c++
+%defattr(-,root,root,-)
+%{_bindir}/moxie-rtems-c++
+%{_bindir}/moxie-rtems-g++
+
+%files libstdc++
+%defattr(-,root,root,-)
+%{_prefix}/moxie-rtems
+%{_datadir}/gcc*
+%endif
+
+%changelog
+* @DATE@ Anthony Green <green@moxielogic.com> @VERSION@-1
+- Created.
+
View
78 scripts/moxie-rtems-gdb.spec.in
@@ -0,0 +1,78 @@
+Name: moxie-rtems-gdb
+Version: @VERSION@
+Release: 0.@BUILDNUM@
+Summary: The GNU gdb for the moxie core
+
+Group: Development/Tools
+License: GPL
+URL: http://moxielogic.com/blog
+Source0: moxie-gdb.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: texinfo ncurses-devel zlib-devel flex bison dtc
+
+%description
+The GNU Debugger, GDB, for the moxie core.
+
+%package sim
+Summary: GNU simulator for the moxie core
+Group: Development
+
+%description sim
+GNU simulator for the moxie core.
+
+%prep
+%setup -q -n src
+
+%build
+CFLAGS="%optflags" ./configure \
+ %_target_platform \
+ --prefix=%_prefix \
+ --exec-prefix=%_exec_prefix \
+ --bindir=%_bindir \
+ --sbindir=%_sbindir \
+ --sysconfdir=%_sysconfdir \
+ --datadir=%_datadir \
+ --includedir=%_includedir \
+ --libdir=%_libdir \
+ --libexecdir=%_libexecdir \
+ --localstatedir=%_localstatedir \
+ --sharedstatedir=%_sharedstatedir \
+ --mandir=%_mandir \
+ --infodir=%_infodir \
+ --enable-shared \
+ --disable-gdbtk \
+ --with-gdb-datadir=%_datadir/%{name}-%{version} \
+ --target=moxie-rtems
+%__make tooldir=%_prefix all
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT%_datadir/locale
+rm -rf $RPM_BUILD_ROOT%_infodir
+rm -rf $RPM_BUILD_ROOT%_libdir/*.a
+rm -rf $RPM_BUILD_ROOT%_prefix/*-linux-gnu
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%_datadir/%{name}-%{version}
+%{_bindir}/*
+%exclude %{_bindir}/moxie-rtems-run
+%{_mandir}/man1/*
+%{_datadir}/%{name}-%{version}/syscalls
+%{_datadir}/%{name}-%{version}/python
+%doc COPYING*
+
+%files sim
+%defattr(-,root,root,-)
+%{_bindir}/moxie-rtems-run
+%{_datadir}/%{name}-%{version}/dtb
+%doc COPYING*
+
+%changelog
+* @DATE@ Anthony Green <green@moxielogic.com> @VERSION@-1
+- Created.
View
89 scripts/moxie-rtems-newlib.spec.in
@@ -0,0 +1,89 @@
+%define _binaries_in_noarch_packages_terminate_build 0
+
+Name: moxie-rtems-newlib
+Version: @VERSION@
+Release: 0.@BUILDNUM@
+Summary: An embedded C runtime library
+
+Group: Development/Tools
+License: BSD
+URL: http://moxielogic.org
+Source0: moxie-newlib.tar.gz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: moxie-rtems-binutils moxie-elf-gcc
+
+BuildArch: noarch
+
+%description
+Newlib is a C library intended for use on embedded systems. It is a
+conglomeration of several library parts, all under free software
+licenses that make them easily usable on embedded products.
+
+%prep
+%setup -q -n src
+
+# Extract %%__os_install_post into os_install_post~
+cat << \EOF > os_install_post~
+%__os_install_post
+EOF
+
+# Generate customized brp-*scripts
+cat os_install_post~ | while read a x y; do
+case $a in
+# Prevent brp-strip* from trying to handle foreign binaries
+*/brp-strip*)
+ b=$(basename $a)
+ sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
+ chmod a+x $b
+ ;;
+esac
+done
+
+sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
+< os_install_post~ > os_install_post
+
+%build
+cat > moxie-rtems-gcc-wrapper <<EOF
+#!/bin/sh
+
+moxie-elf-gcc "\$@" -D__rtems__ -D_rtems_ -Tsim.ld
+EOF
+chmod +x moxie-rtems-gcc-wrapper
+`pwd`/configure --prefix=%_prefix \
+ --exec-prefix=%_exec_prefix \
+ --bindir=%_bindir \
+ --sbindir=%_sbindir \
+ --sysconfdir=%_sysconfdir \
+ --datadir=%_datadir \
+ --includedir=%_includedir \
+ --libdir=%_libdir \
+ --libexecdir=%_libexecdir \
+ --localstatedir=%_localstatedir \
+ --sharedstatedir=%_sharedstatedir \
+ --mandir=%_mandir \
+ --infodir=%_infodir \
+ --target=moxie-rtems
+
+make all-target-newlib all-target-libgloss CC_FOR_TARGET=`pwd`/moxie-rtems-gcc-wrapper
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/moxie-rtems/lib
+make install-target-libgloss install-target-newlib DESTDIR=$RPM_BUILD_ROOT
+
+%define __os_install_post . ./os_install_post
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_prefix}/moxie-rtems
+%doc COPYING* newlib/MAINTAINERS newlib/NEWS newlib/README
+
+%changelog
+* @DATE@ Anthony Green <green@moxielogic.com> @VERSION@-1
+- Created.
View
100 scripts/moxie-rtems.spec.in
@@ -0,0 +1,100 @@
+%define debug_package %{nil}
+%define __debug_install_post {true;}
+%define _use_internal_dependency_generator 0
+
+Name: moxie-rtems
+Version: @VERSION@
+Release: 0.@BUILDNUM@
+Summary: RTEMS port for the moxie processor core
+
+Group: Development/Tools
+License: GPL
+URL: http://moxielogic.org
+Source0: rtems.tar.gz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+Requires: moxie-rtems-gcc
+BuildRequires: moxie-rtems-gcc
+
+%description
+RTEMS is a real-time embedded operating system. This is a port of RTEMS to the moxie core.
+
+%prep
+%setup -q -n rtems
+
+# Extract %%__os_install_post into os_install_post~
+cat << \EOF > os_install_post~
+%__os_install_post
+EOF
+
+# Generate customized brp-*scripts
+cat os_install_post~ | while read a x y; do
+case $a in
+# Prevent brp-strip* from trying to handle foreign binaries
+*/brp-strip*)
+ b=$(basename $a)
+ sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
+ chmod a+x $b
+ ;;
+esac
+done
+
+sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
+< os_install_post~ > os_install_post
+
+%build
+mkdir moxie-build
+cd moxie-build
+`pwd`/../configure --prefix=%_prefix \
+ --exec-prefix=%_exec_prefix \
+ --bindir=%_bindir \
+ --sbindir=%_sbindir \
+ --sysconfdir=%_sysconfdir \
+ --datadir=%_datadir \
+ --includedir=%_includedir \
+ --libdir=%_libdir \
+ --libexecdir=%_libexecdir \
+ --localstatedir=%_localstatedir \
+ --sharedstatedir=%_sharedstatedir \
+ --mandir=%_mandir \
+ --infodir=%_infodir \
+ --target=moxie-rtems \
+ --enable-testsuites=samples
+
+make RTEMS_BSP=moxiesim
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+#mkdir -p $RPM_BUILD_ROOT/usr/moxie-rtems/lib
+(cd moxie-build;
+make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT RTEMS_BSP=moxiesim)
+
+# Move pkgconfig file to correct directory.
+mkdir -p $RPM_BUILD_ROOT%{_libdir}
+mv $RPM_BUILD_ROOT%{_prefix}/lib/pkgconfig $RPM_BUILD_ROOT%{_libdir}
+
+# Move man pages.
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/doc/moxie-rtems
+mv $RPM_BUILD_ROOT/usr/share/man $RPM_BUILD_ROOT/%{_datadir}/doc/moxie-rtems
+
+%define __os_install_post . ./os_install_post
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING LICENSE* MAINTAINERS README* SUPPORT VERSION
+%dir %{_prefix}/make
+%{_prefix}/moxie-rtems
+%{_bindir}/*
+%{_libdir}/pkgconfig/moxie-rtems-moxiesim.pc
+%{_prefix}/make/*
+%{_datadir}/doc/moxie-rtems/*
+%{_prefix}/share/rtems4.11
+
+%changelog
+* @DATE@ Anthony Green <green@moxielogic.com> @VERSION@-1
+- Created.
View
2 src/sim/moxie/Makefile.in
@@ -17,7 +17,7 @@
## COMMON_PRE_CONFIG_FRAG
-dtbdir = @datadir@/gdb-`sed q ${srcdir}/../../gdb/version.in`/dtb
+dtbdir = @datadir@/moxie-elf-gdb-`sed q ${srcdir}/../../gdb/version.in | sed -e "s/-//"`/dtb
SIM_OBJS = interp.o sim-load.o sim-io.o sim-config.o sim-utils.o \
sim-options.o sim-module.o sim-core.o sim-endian.o sim-trace.o \

0 comments on commit a7ad179

Please sign in to comment.
Something went wrong with that request. Please try again.