Fix GNU toolchain doc files.
[fedora-riscv.git] / stage2-riscv-gnu-toolchain / riscv-gnu-toolchain.spec.in
1 %global debug_package %{nil}
2
3 # Don't rm -rf $RPM_BUILD_ROOT at the top of install rule.
4 %global __spec_install_pre %{___build_pre}
5
6 # Strip breaks the libraries, don't do it.
7 %global __strip /bin/true
8
9 Name:           riscv-gnu-toolchain
10 Version:        0
11 Release:        0.3.git@SHORTCOMMIT@%{?dist}
12 Summary:        RISC-V GNU cross-toolchain, containing binutils and GCC
13 License:        GPLv2+ and LGPLv2+ and BSD
14
15 URL:            https://github.com/riscv/riscv-qemu
16 Source0:        https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz
17
18 Source1:        http://mirrors.kernel.org/gnu/binutils/binutils-@BINUTILS_VERSION@.tar.gz
19 Source2:        http://mirrors.kernel.org/gnu/glibc/glibc-@GLIBC_VERSION@.tar.gz
20 Source3:        http://mirrors.kernel.org/gnu/gcc/gcc-@GCC_VERSION@/gcc-@GCC_VERSION@.tar.gz
21 Source4:        ftp://sourceware.org/pub/newlib/newlib-@NEWLIB_VERSION@.tar.gz
22
23 # XXX These BuildRequires are just culled from the GCC spec
24 # and probably overestimate the real requirements.
25 BuildRequires: binutils
26 BuildRequires: glibc-static
27 BuildRequires: zlib-devel, gettext, bison, flex
28 BuildRequires: texinfo, texinfo-tex, /usr/bin/pod2man
29 BuildRequires: systemtap-sdt-devel
30 BuildRequires: gmp-devel, mpfr-devel, libmpc-devel
31 BuildRequires: hostname, procps
32 BuildRequires: gdb
33 BuildRequires: glibc-devel
34 BuildRequires: elfutils-devel
35 BuildRequires: elfutils-libelf-devel
36 BuildRequires: glibc
37 BuildRequires: glibc-devel
38 BuildRequires: libunwind
39 BuildRequires: isl
40 BuildRequires: isl-devel
41 BuildRequires: doxygen
42 BuildRequires: graphviz, texlive-collection-latex
43
44
45 %description
46 This is the RISC-V fork of the GNU cross-compiler toolchain.  It
47 includes binutils and GCC.
48
49
50 %prep
51 %setup -q -n %{name}-@COMMIT@
52
53
54 %build
55 %configure
56
57 # The ordinary Makefile downloads upstream GNU packages.  Instead we
58 # provide these as local files.  Note this is "DISTDIR" not "DESTDIR".
59 export DISTDIR=%{_sourcedir}
60
61 # Since the Makefile installs as it goes along, set DESTDIR too, and
62 # clean the buildroot now (instead of at the top of install).
63 export DESTDIR=$RPM_BUILD_ROOT
64 rm -rf $RPM_BUILD_ROOT
65 mkdir -p $RPM_BUILD_ROOT
66
67 # We need to use the tools we built as we go along.
68 export PATH=$RPM_BUILD_ROOT%{_bindir}:$PATH
69
70 make
71
72 # The 'make linux' rule builds GCC linked against glibc (instead of
73 # newlib).  However I couldn't make this work, and it's not really
74 # needed anyway.
75 #make linux
76
77
78 %install
79 # Not needed since the make installs as it goes along.
80 #make install DESTDIR=$RPM_BUILD_ROOT
81
82 # Remove some documentation, language files
83 rm -r $RPM_BUILD_ROOT%{_datadir}/info
84 rm -r $RPM_BUILD_ROOT%{_mandir}
85 rm -r $RPM_BUILD_ROOT%{_datadir}/locale
86
87 # Remove this libtool linker file.
88 rm $RPM_BUILD_ROOT%{_libdir}/libcc1.la
89
90
91 %files
92 %doc README.md
93 %{_bindir}/riscv64-unknown-elf-*
94 #%{_bindir}/riscv64-unknown-linux-gnu-*
95 %{_libdir}/libcc1.so
96 %{_libdir}/libcc1.so.0
97 %{_libdir}/libcc1.so.0.0.0
98 %{_libexecdir}/gcc/riscv64-unknown-elf
99 #%{_libexecdir}/gcc/riscv-unknown-linux-gnu
100 %{_prefix}/lib/gcc/riscv64-unknown-elf
101 #%{_prefix}/lib/gcc/riscv64-unknown-linux-gnu
102 %{_prefix}/riscv64-unknown-elf
103 #%{_prefix}/riscv64-unknown-linux-gnu
104 %{_datadir}/gcc-@GCC_VERSION@
105
106
107 %changelog