Bryan O'Sullivan d291b49
# Build options:
Bryan O'Sullivan d291b49
#
Bryan O'Sullivan d291b49
# --with doxygen
Bryan O'Sullivan d291b49
#   The doxygen docs are HUGE, so they are not built by default.
Bryan O'Sullivan 03bad00
fc7190b
Name:           llvm
216ddcf
Version:        2.7
216ddcf
Release:        0.1.pre1%{?dist}
fc7190b
Summary:        The Low Level Virtual Machine
fc7190b
fc7190b
Group:          Development/Languages
fc7190b
License:        NCSA
fc7190b
URL:            http://llvm.org/
216ddcf
Source0:        http://llvm.org/pre-releases/%{version}/pre-release1/llvm-%{version}.tar.gz
216ddcf
Source1:        http://llvm.org/pre-releases/%{version}/pre-release1/clang-%{version}.tar.gz
c19d461
# Data files should be installed with timestamps preserved
216ddcf
Patch0:         llvm-2.6-timestamp.patch
fc7190b
fc7190b
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
fc7190b
fc7190b
BuildRequires:  bison
fc7190b
BuildRequires:  chrpath
fc7190b
BuildRequires:  flex
fc7190b
BuildRequires:  gcc-c++ >= 3.4
fc7190b
BuildRequires:  groff
fc7190b
BuildRequires:  libtool-ltdl-devel
fc7190b
BuildRequires:  ocaml-ocamldoc
565c64d
# for DejaGNU test suite
48b530b
BuildRequires:  dejagnu tcl-devel python
Bryan O'Sullivan d291b49
%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
fc7190b
BuildRequires:  doxygen graphviz
Bryan O'Sullivan d291b49
%endif
Bryan O'Sullivan d291b49
fc7190b
# LLVM is not supported on PPC64
fc7190b
# http://llvm.org/bugs/show_bug.cgi?id=3729
fc7190b
ExcludeArch:    ppc64
fc7190b
Bryan O'Sullivan d291b49
%description
Bryan O'Sullivan d291b49
LLVM is a compiler infrastructure designed for compile-time,
Bryan O'Sullivan d291b49
link-time, runtime, and idle-time optimization of programs from
Bryan O'Sullivan d291b49
arbitrary programming languages.  The compiler infrastructure includes
Bryan O'Sullivan d291b49
mirror sets of programming tools as well as libraries with equivalent
Bryan O'Sullivan d291b49
functionality.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package devel
fc7190b
Summary:        Libraries and header files for LLVM
fc7190b
Group:          Development/Languages
fc7190b
Requires:       %{name} = %{version}-%{release}
fc7190b
Requires:       libstdc++-devel >= 3.4
1384796
Provides:       llvm-static = %{version}-%{release}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description devel
Bryan O'Sullivan d291b49
This package contains library and header files needed to develop new
Bryan O'Sullivan d291b49
native programs that use the LLVM infrastructure.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package doc
fc7190b
Summary:        Documentation for LLVM
c19d461
Group:          Documentation
719d6b0
Requires:       %{name} = %{version}-%{release}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description doc
Bryan O'Sullivan d291b49
Documentation for the LLVM compiler infrastructure.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
c19d461
%package -n clang
c6833e1
Summary:        A C language family frontend for LLVM
c6833e1
License:        NCSA
fc7190b
Group:          Development/Languages
Bryan O'Sullivan d291b49
c19d461
%description -n clang
c6833e1
clang: noun
c6833e1
    1. A loud, resonant, metallic sound.
c6833e1
    2. The strident call of a crane or goose.
c6833e1
    3. C-language family front-end toolkit.
Bryan O'Sullivan d291b49
c6833e1
The goal of the Clang project is to create a new C, C++, Objective C
c19d461
and Objective C++ front-end for the LLVM compiler. Its tools are built
c6833e1
as libraries and designed to be loosely-coupled and extendable.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
216ddcf
%package -n clang-devel
216ddcf
Summary:        Header files for clang
216ddcf
Group:          Development/Languages
216ddcf
Requires:       clang = %{version}-%{release}
216ddcf
216ddcf
%description -n clang-devel
216ddcf
This package contains header files for the Clang compiler.
216ddcf
216ddcf
c19d461
%package -n clang-analyzer
8f6b35f
Summary:        A source code analysis framework
8f6b35f
License:        NCSA
8f6b35f
Group:          Development/Languages
c19d461
Requires:       clang = %{version}-%{release}
8f6b35f
# not picked up automatically since files are currently not instaled
8f6b35f
# in standard Python hierarchies yet
8f6b35f
Requires:       python
8f6b35f
c19d461
%description -n clang-analyzer
8f6b35f
The Clang Static Analyzer consists of both a source code analysis
8f6b35f
framework and a standalone tool that finds bugs in C and Objective-C
8f6b35f
programs. The standalone tool is invoked from the command-line, and is
8f6b35f
intended to run in tandem with a build of a project or code base.
8f6b35f
8f6b35f
c19d461
%package -n clang-doc
c19d461
Summary:        Documentation for Clang
c19d461
Group:          Documentation
c19d461
Requires:       %{name} = %{version}-%{release}
c19d461
c19d461
%description -n clang-doc
c19d461
Documentation for the Clang compiler front-end.
c19d461
c19d461
Bryan O'Sullivan d291b49
%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
Bryan O'Sullivan d291b49
%package apidoc
fc7190b
Summary:        API documentation for LLVM
fc7190b
Group:          Development/Languages
fc7190b
Requires:       %{name}-docs = %{version}-%{release}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description apidoc
Bryan O'Sullivan d291b49
API documentation for the LLVM compiler infrastructure.
Bryan O'Sullivan d291b49
%endif
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
fc7190b
%package        ocaml
fc7190b
Summary:        OCaml binding for LLVM
fc7190b
Group:          Development/Libraries
Bryan O'Sullivan 03bad00
Requires:       %{name} = %{version}-%{release}
fc7190b
Requires:       ocaml-runtime
Bryan O'Sullivan 03bad00
fc7190b
%description    ocaml
Bryan O'Sullivan 03bad00
OCaml binding for LLVM.
Bryan O'Sullivan 03bad00
Bryan O'Sullivan 03bad00
Bryan O'Sullivan 03bad00
%package        ocaml-devel
fc7190b
Summary:        Development files for %{name}-ocaml
fc7190b
Group:          Development/Libraries
Bryan O'Sullivan 03bad00
Requires:       %{name}-devel = %{version}-%{release}
fc7190b
Requires:       %{name}-ocaml = %{version}-%{release}
160b755
Requires:       ocaml
Bryan O'Sullivan 03bad00
fc7190b
%description    ocaml-devel
Bryan O'Sullivan 03bad00
The %{name}-ocaml-devel package contains libraries and signature files
Bryan O'Sullivan 03bad00
for developing applications that use %{name}-ocaml.
Bryan O'Sullivan 03bad00
Bryan O'Sullivan 03bad00
c6833e1
%package ocaml-doc
c6833e1
Summary:        Documentation for LLVM's OCaml binding
c6833e1
Group:          Documentation
c6833e1
Requires:       %{name}-ocaml = %{version}-%{release}
c6833e1
c6833e1
%description ocaml-doc
c6833e1
HTML documentation for LLVM's OCaml binding.
c6833e1
c6833e1
c6833e1
Bryan O'Sullivan d291b49
%prep
c6833e1
%setup -q -n llvm-%{version} -a1 %{?_with_gcc:-a2}
216ddcf
mv clang-%{version} tools/clang
Bryan O'Sullivan d291b49
216ddcf
%patch0 -p1 -b .timestamp
216ddcf
216ddcf
# Encoding fix
216ddcf
(cd tools/clang/docs && \
216ddcf
    iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
216ddcf
    -o BlockImplementation.txt)
09ee2ab
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%build
565c64d
# Disabling assertions now, rec. by pure and needed for OpenGTL
a02ba10
# no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3239
565c64d
mkdir obj && cd obj
565c64d
../configure \
565c64d
  --prefix=%{_prefix} \
c6833e1
  --libdir=%{_libdir}/%{name} \
565c64d
  --disable-assertions \
Bryan O'Sullivan d291b49
  --enable-debug-runtime \
Bryan O'Sullivan d291b49
  --enable-jit \
d3f05fb
%ifarch %{ix86}
d3f05fb
  --enable-pic=no
1384796
%else
1384796
  --enable-shared
09280fb
%endif
565c64d
c6833e1
# FIXME file this
565c64d
# configure does not properly specify libdir
c6833e1
sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
Bryan O'Sullivan 03bad00
71feaf9
make %{_smp_mflags} \
71feaf9
%ifarch ppc
71feaf9
  OPTIMIZE_OPTION="%{optflags} -fno-var-tracking-assignments"
71feaf9
%else
71feaf9
  OPTIMIZE_OPTION="%{optflags}"
71feaf9
%endif
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
565c64d
%check
160b755
# pre1: some tests fail on PPC
a02ba10
# http://www.nabble.com/LLVM-2.6-pre1%3A-test-failures-on-Fedora-11.91-%28Rawhide%29-ppc-td25334198.html
160b755
# pre2: test failures on x86_64 as well
812c8a8
cd obj
160b755
make check 2>&1 | tee ../llvm-testlog.txt || true
c19d461
# some clang tests still fail, preserve test results
160b755
(cd tools/clang && make test 2>&1) | tee ../clang-testlog.txt || true
565c64d
565c64d
Bryan O'Sullivan d291b49
%install
Bryan O'Sullivan d291b49
rm -rf %{buildroot}
c19d461
pushd obj
Bryan O'Sullivan d291b49
chmod -x examples/Makefile
c6833e1
Bryan O'Sullivan 03bad00
make install DESTDIR=%{buildroot} \
c6833e1
     PROJ_docsdir=/moredocs
c19d461
popd
c6833e1
216ddcf
# Create ld.so.conf.d entry
216ddcf
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
216ddcf
cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{arch}.conf << EOF
216ddcf
%{_libdir}/llvm
216ddcf
EOF
216ddcf
a02ba10
# Static analyzer not installed by default:
a02ba10
# http://clang-analyzer.llvm.org/installation#OtherPlatforms
216ddcf
mkdir -p %{buildroot}%{_libdir}/clang-analyzer
8f6b35f
# create launchers
8f6b35f
for f in scan-{build,view}; do
216ddcf
  ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
8f6b35f
done
8f6b35f
216ddcf
(cd tools/clang/tools && cp -pr scan-{build,view} \
216ddcf
 %{buildroot}%{_libdir}/clang-analyzer/)
8f6b35f
a02ba10
c6833e1
# Move documentation back to build directory
c6833e1
# 
c19d461
mv %{buildroot}/moredocs .
c19d461
rm moredocs/*.tar.gz
c19d461
rm moredocs/ocamldoc/html/*.tar.gz
c19d461
c19d461
# And prepare Clang documentation
c19d461
#
c19d461
mkdir clang-docs
c19d461
for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
c19d461
  ln tools/clang/$f clang-docs/
c19d461
done
c19d461
rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
c19d461
c6833e1
216ddcf
#find %{buildroot} -name .dir -print0 | xargs -0r rm -f
Bryan O'Sullivan d291b49
file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
c6833e1
file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
216ddcf
#chrpath -d %{buildroot}/%{_libexecdir}/clang-cc
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
# Get rid of erroneously installed example files.
c6833e1
rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
Bryan O'Sullivan 03bad00
c6833e1
# FIXME file this bug
c6833e1
sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
Bryan O'Sullivan d291b49
  %{buildroot}%{_bindir}/llvm-config
Bryan O'Sullivan d291b49
2c55a75
chmod -x %{buildroot}%{_libdir}/%{name}/*.a
Bryan O'Sullivan d291b49
719d6b0
# remove documentation makefiles:
719d6b0
# they require the build directory to work
c6833e1
find examples -name 'Makefile' | xargs -0r rm -f
Bryan O'Sullivan d291b49
Bryan O'Sullivan 03bad00
Bryan O'Sullivan d291b49
%clean
Bryan O'Sullivan d291b49
rm -rf %{buildroot}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%post -p /sbin/ldconfig
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%postun -p /sbin/ldconfig
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%files
Bryan O'Sullivan d291b49
%defattr(-,root,root,-)
160b755
%doc CREDITS.TXT LICENSE.TXT README.txt llvm-testlog.txt
Bryan O'Sullivan d291b49
%{_bindir}/bugpoint
Bryan O'Sullivan d291b49
%{_bindir}/llc
Bryan O'Sullivan d291b49
%{_bindir}/lli
216ddcf
%exclude %{_bindir}/llvm-config
Bryan O'Sullivan d291b49
%{_bindir}/llvm*
Bryan O'Sullivan d291b49
%{_bindir}/opt
216ddcf
%conf %{_sysconfdir}/ld.so.conf.d/llvm-%{arch}.conf
216ddcf
%dir %{_libdir}/llvm
216ddcf
%{_libdir}/llvm/*.so
8f6b35f
%exclude %{_mandir}/man1/clang.1.*
216ddcf
%doc %{_mandir}/man1/*.1.*
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%files devel
Bryan O'Sullivan d291b49
%defattr(-,root,root,-)
Bryan O'Sullivan d291b49
%{_bindir}/llvm-config
Bryan O'Sullivan d291b49
%{_includedir}/%{name}
Bryan O'Sullivan d291b49
%{_includedir}/%{name}-c
216ddcf
%{_libdir}/%{name}/*.a
c6833e1
c19d461
%files -n clang
c6833e1
%defattr(-,root,root,-)
160b755
%doc clang-docs/* clang-testlog.txt
c6833e1
%{_bindir}/clang*
c6833e1
%{_bindir}/tblgen
c19d461
%{_prefix}/lib/clang
8f6b35f
%doc %{_mandir}/man1/clang.1.*
8f6b35f
216ddcf
%files -n clang-devel
216ddcf
%defattr(-,root,root,-)
216ddcf
%{_includedir}/clang
216ddcf
%{_includedir}/clang-c
216ddcf
c19d461
%files -n clang-analyzer
8f6b35f
%defattr(-,root,root,-)
8f6b35f
%{_bindir}/scan-build
8f6b35f
%{_bindir}/scan-view
8f6b35f
%{_libdir}/clang-analyzer
c6833e1
c19d461
%files -n clang-doc
c19d461
%defattr(-,root,root,-)
c19d461
%doc tools/clang/docs/*
c19d461
c6833e1
%files doc
c6833e1
%defattr(-,root,root,-)
c6833e1
%doc examples moredocs/html
Bryan O'Sullivan d291b49
Bryan O'Sullivan 03bad00
%files ocaml
Bryan O'Sullivan 03bad00
%defattr(-,root,root,-)
Bryan O'Sullivan 03bad00
%{_libdir}/ocaml/*.cma
Bryan O'Sullivan 03bad00
%{_libdir}/ocaml/*.cmi
Bryan O'Sullivan 03bad00
Bryan O'Sullivan 03bad00
%files ocaml-devel
Bryan O'Sullivan 03bad00
%defattr(-,root,root,-)
Bryan O'Sullivan 03bad00
%{_libdir}/ocaml/*.a
Bryan O'Sullivan 03bad00
%{_libdir}/ocaml/*.cmx*
Bryan O'Sullivan 03bad00
%{_libdir}/ocaml/*.mli
Bryan O'Sullivan 03bad00
c6833e1
%files ocaml-doc
Bryan O'Sullivan d291b49
%defattr(-,root,root,-)
c6833e1
%doc moredocs/ocamldoc/html/*
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
Bryan O'Sullivan d291b49
%files apidoc
Bryan O'Sullivan d291b49
%defattr(-,root,root,-)
Bryan O'Sullivan d291b49
%doc docs/doxygen
Bryan O'Sullivan d291b49
%endif
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%changelog
216ddcf
* Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
216ddcf
- Update to first 2.7 pre-release
216ddcf
1384796
* Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
1384796
- Update to 2.6 pre-release2
1384796
- -devel subpackage now virtually provides -static
1384796
4ff9eca
* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
4ff9eca
- Disable var tracking assignments on PPC
4ff9eca
09ee2ab
* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
c19d461
- Don't adjust clang include dir; files there are noarch (bz#521893)
09ee2ab
- Enable clang unit tests
c19d461
- clang and clang-analyzer renamed; no longer depend on llvm at runtime
09ee2ab
a02ba10
* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
a02ba10
- Package Clang's static analyzer tools
a02ba10
d3f05fb
* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
d3f05fb
- PIC is now enabled by default; explicitly disable on %%{ix86}
d3f05fb
c6833e1
* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
c6833e1
- First 2.6 prerelease
c6833e1
- Enable Clang front-end
c6833e1
- Enable debuginfo generation
c6833e1
c6833e1
* Sat Sep  5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
09ee2ab
- Disable assertions (needed by OpenGTL, bz#521261)
565c64d
- Align spec file with upstream build instructions
565c64d
- Enable unit tests
565c64d
6f2b484
* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
6f2b484
- Only disable PIC on %%ix86; ppc actually needs it
6f2b484
09280fb
* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
09280fb
- Disable use of position-independent code on 32-bit platforms
09280fb
  (buggy in LLVM <= 2.5)
09280fb
b44f18c
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
b44f18c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
b44f18c
719d6b0
* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
719d6b0
- Remove build scripts; they require the build directory to work
719d6b0
fc7190b
* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
fc7190b
- Update to 2.5
fc7190b
- Package build scripts (bug #457881)
9644979
Bryan O'Sullivan 03bad00
* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
Bryan O'Sullivan 03bad00
- Patched build process for the OCaml binding
Bryan O'Sullivan 03bad00
Bryan O'Sullivan 03bad00
* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
Bryan O'Sullivan 03bad00
- Update to 2.4
Bryan O'Sullivan 03bad00
- Package Ocaml binding
Bryan O'Sullivan 03bad00
Bryan O'Sullivan e2fa788
* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
Bryan O'Sullivan e2fa788
- Add dependency on groff
Bryan O'Sullivan e2fa788
Bryan O'Sullivan df8851e
* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
Bryan O'Sullivan df8851e
- LLVM 2.3
Bryan O'Sullivan df8851e
2d471be
* Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
2d471be
- fix license tags
2d471be
Bryan O'Sullivan a2e4a2f
* Wed Mar  5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
Bryan O'Sullivan a2e4a2f
- Fix compilation problems with gcc 4.3
Bryan O'Sullivan a2e4a2f
7889508
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
7889508
- Autorebuild for GCC 4.3
7889508
Bryan O'Sullivan d291b49
* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
Bryan O'Sullivan d291b49
- Fix review comments
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
Bryan O'Sullivan d291b49
- Initial version