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