4a6eb83
Name:		clang
19ac9b7
Version:	3.9.1
c027c98
Release:	1%{?dist}
4a6eb83
Summary:	A C language family front-end for LLVM
4a6eb83
4a6eb83
License:	NCSA
4a6eb83
URL:		http://llvm.org
0706e2f
Source0:	http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz
4a6eb83
4a6eb83
Source100:	clang-config.h
4a6eb83
4a6eb83
BuildRequires:	cmake
4a6eb83
BuildRequires:	llvm-devel = %{version}
4a6eb83
BuildRequires:	libxml2-devel
6a62f09
BuildRequires:  llvm-static = %{version}
37c9494
BuildRequires:  perl-generators
c027c98
BuildRequires:  ncurses-devel
4a6eb83
4a6eb83
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
4a6eb83
4a6eb83
# clang requires gcc, clang++ requires libstdc++-devel
4a6eb83
# - https://bugzilla.redhat.com/show_bug.cgi?id=1021645
4a6eb83
# - https://bugzilla.redhat.com/show_bug.cgi?id=1158594
4a6eb83
Requires:	libstdc++-devel
4a6eb83
Requires:	gcc-c++
4a6eb83
4a6eb83
4a6eb83
%description
4a6eb83
clang: noun
4a6eb83
    1. A loud, resonant, metallic sound.
4a6eb83
    2. The strident call of a crane or goose.
4a6eb83
    3. C-language family front-end toolkit.
4a6eb83
4a6eb83
The goal of the Clang project is to create a new C, C++, Objective C
4a6eb83
and Objective C++ front-end for the LLVM compiler. Its tools are built
4a6eb83
as libraries and designed to be loosely-coupled and extensible.
4a6eb83
4a6eb83
%package libs
4a6eb83
Summary: Runtime library for clang
8dde805
Requires: compiler-rt%{?_isa} >= %{version}
4a6eb83
4a6eb83
%description libs
4a6eb83
Runtime library for clang.
4a6eb83
4a6eb83
%package devel
4a6eb83
Summary: Development header files for clang.
4a6eb83
Requires: %{name}%{?_isa} = %{version}-%{release}
4a6eb83
4a6eb83
%description devel
4a6eb83
Development header files for clang.
4a6eb83
4a6eb83
%package analyzer
4a6eb83
Summary:	A source code analysis framework
4a6eb83
License:	NCSA and MIT
4a6eb83
BuildArch:	noarch
4a6eb83
Requires:	%{name} = %{version}-%{release}
4a6eb83
# not picked up automatically since files are currently not installed in
4a6eb83
# standard Python hierarchies yet
4a6eb83
Requires:	python
4a6eb83
4a6eb83
%description analyzer
4a6eb83
The Clang Static Analyzer consists of both a source code analysis
4a6eb83
framework and a standalone tool that finds bugs in C and Objective-C
4a6eb83
programs. The standalone tool is invoked from the command-line, and is
4a6eb83
intended to run in tandem with a build of a project or code base.
4a6eb83
4a6eb83
%prep
0706e2f
%setup -q -n cfe-%{version}.src
4a6eb83
%build
4a6eb83
mkdir -p _build
4a6eb83
cd _build
4a6eb83
%cmake .. \
b486bb1
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
4a6eb83
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
4a6eb83
	-DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
4a6eb83
	\
4a6eb83
	-DCLANG_ENABLE_ARCMT:BOOL=ON \
4a6eb83
	-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
4a6eb83
	-DCLANG_INCLUDE_DOCS:BOOL=ON \
4a6eb83
	-DCLANG_INCLUDE_TESTS:BOOL=ON \
4a6eb83
	-DCLANG_PLUGIN_SUPPORT:BOOL=ON \
4a6eb83
	\
6a62f09
	-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
6a62f09
	-DLIB_SUFFIX=
4a6eb83
4a6eb83
make %{?_smp_mflags}
4a6eb83
4a6eb83
%install
4a6eb83
cd _build
4a6eb83
make install DESTDIR=%{buildroot}
4a6eb83
4a6eb83
# multilib fix
4a6eb83
mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
4a6eb83
install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/clang/Config/config.h
4a6eb83
4a6eb83
# remove git integration
4a6eb83
rm -vf %{buildroot}%{_bindir}/git-clang-format
4a6eb83
# remove editor integrations (bbedit, sublime, emacs, vim)
4a6eb83
rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
4a6eb83
rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
4a6eb83
rm -vf %{buildroot}%{_datadir}/clang/clang-format.el
4a6eb83
rm -vf %{buildroot}%{_datadir}/clang/clang-format.py*
4a6eb83
# remove diff reformatter
4a6eb83
rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
4a6eb83
4a6eb83
%check
4a6eb83
# requires lit.py from LLVM utilities
4a6eb83
#cd _build
4a6eb83
#make check-all
4a6eb83
4a6eb83
%files
0700b77
%{_libdir}/clang/
4a6eb83
%{_bindir}/clang*
6a62f09
%{_bindir}/c-index-test
4a6eb83
4a6eb83
%files libs
4a6eb83
%{_libdir}/*.so.*
086d270
%{_libdir}/*.so
4a6eb83
4a6eb83
%files devel
4a6eb83
%{_includedir}/clang/
4a6eb83
%{_includedir}/clang-c/
4a6eb83
%dir %{_datadir}/clang/
4a6eb83
%{_datadir}/clang/cmake/
4a6eb83
4a6eb83
%files analyzer
4a6eb83
%{_bindir}/scan-view
4a6eb83
%{_bindir}/scan-build
6a62f09
%{_bindir}/scan-build
6a62f09
%{_libexecdir}/ccc-analyzer
6a62f09
%{_libexecdir}/c++-analyzer
6a62f09
%{_datadir}/scan-view/
6a62f09
%{_datadir}/scan-build/
4a6eb83
%{_mandir}/man1/scan-build.1.*
4a6eb83
4a6eb83
%changelog
19ac9b7
* Thu Mar 02 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-1
19ac9b7
- clang 3.9.1
19ac9b7
c027c98
* Tue Jan 17 2017 Michael Cronenworth <mike@cchtml.com> - 3.8.1-1
c027c98
- clang 3.8.1
c027c98
8dde805
* Mon Nov 14 2016 Nathaniel McCallum <npmccallum@redhat.com> - 3.8.0-3
8dde805
- Add Requires: compiler-rt to clang-libs.
8dde805
- Without this, compiling with certain CFLAGS breaks.
8dde805
fd63610
* Fri Jul 01 2016 Stephan Bergmann <sbergman@redhat.com> - 3.8.0-2
fd63610
- Resolves: rhbz#1282645 add GCC abi_tag support
fd63610
0706e2f
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
0706e2f
- clang 3.8.0 final release
0706e2f
679f934
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.4
679f934
- clang 3.8.0rc3
679f934
086d270
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.3
086d270
- package all libs into clang-libs.
086d270
b486bb1
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
b486bb1
- enable dynamic linking of clang against llvm
b486bb1
6a62f09
* Thu Feb 18 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.1
6a62f09
- clang 3.8.0rc2
6a62f09
61789e8
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
61789e8
- rebuild against latest llvm packages
650e4fe
- add BuildRequires llvm-static
61789e8
f615040
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-3
f615040
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f615040
7e4861f
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-2
7e4861f
- just accept clang includes moving to /usr/lib64, upstream don't let much else happen
7e4861f
7e4861f
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-1
7e4861f
- initial build in Fedora.
7e4861f
4a6eb83
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
4a6eb83
- initial version using cmake build system