# The base version of clang being built against %global clang_base_version 3.5 Name: iwyu Version: 0.3 Release: 1%{?dist} Summary: C/C++ source files #include analyzer based on clang License: NCSA URL: https://code.google.com/p/include-what-you-use/ Source0: http://include-what-you-use.com/downloads/include-what-you-use-%{clang_base_version}.src.tar.gz Patch1: iwyu-link_dir.patch BuildRequires: cmake BuildRequires: clang-devel # NOTE: This should probably listed as a dependency for clang-devel but it's # not, so make it explicit here BuildRequires: llvm-devel # Some of the Clang libraries are only available statically and the use of the # static library was approved (see https://fedorahosted.org/fesco/ticket/1370 ) BuildRequires: llvm-static BuildRequires: zlib-devel # Scripts are Python 2 BuildRequires: python2-devel # Virtual provide the long name Provides: include-what-you-use = %{version}-%{release} Provides: include-what-you-use%{?_isa} = %{version}-%{release} %description "Include what you use" means this: for every symbol (type, function, variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc or foo.h should #include a .h file that exports the declaration of that symbol. The include-what-you-use tool is a program that can be built with the clang libraries in order to analyze #includes of source files to find include-what-you-use violations, and suggest fixes for them. %prep %setup -q -n include-what-you-use %patch1 -p1 %build mkdir build cd build %cmake -DLLVM_LIB_PATH=%{_libdir}/llvm .. make %{?_smp_mflags} %install %make_install DESTDIR=%{buildroot} -C build sed -i '1 s|^#!/usr/bin/python\b|#!%{__python2}|' fix_includes.py install -pDm755 fix_includes.py %{buildroot}%{_bindir}/fix_includes cd %{buildroot}%{_bindir} ln -s include-what-you-use iwyu %check cd build PATH=$PWD:$PATH ln -s ../fix_includes.py ln -s ../fix_includes_test.py ln -s ../iwyu_test_util.py ln -s ../run_iwyu_tests.py ln -s ../tests %{__python2} run_iwyu_tests.py %{__python2} fix_includes_test.py %files %{_bindir}/include-what-you-use %{_bindir}/iwyu %{_bindir}/fix_includes %changelog * Tue Jan 27 2015 Dave Johansen - 0.3-1 - Update to 0.3 based on clang 3.5.0 * Fri Apr 25 2014 Dave Johansen - 0.2-1 - Initial RPM release