Name: iwyu Version: 3.4 Release: 1%{?dist} Summary: A tool for use with clang to analyze #includes in C and C++ source files Group: Development/Languages License: NCSA URL: https://code.google.com/p/include-what-you-use/ Source0: http://include-what-you-use.com/downloads/include-what-you-use-%{version}.src.tar.gz Patch1: iwyu-cmake.patch Patch2: 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 # NOTE: Ideally, this would be linking against the .so files, but in it's # current state it links against the .a files so just go with it BuildRequires: llvm-static %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 %patch2 -p1 %build mkdir build cd build %cmake -DLLVM_LIB_PATH=%{_libdir}/llvm .. make %{?_smp_mflags} %install cd build make install DESTDIR=%{buildroot} cp ../fix_includes.py %{buildroot}%{_bindir} cd %{buildroot}%{_bindir} ln -s include-what-you-use iwyu %check # Isn't working right now and I don't feel like looking into what's wrong #make check-iwyu %files %{_bindir}/include-what-you-use %{_bindir}/iwyu %{_bindir}/fix_includes.py %changelog * Fri Apr 25 2014 Dave Johansen - 3.4-1 - Initial RPM release