%global longname include-what-you-use %global owner %{longname} %global commit 7f0b6c304acf69c42bb7f6e03c63f836924cb7e0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %undefine __cmake_in_source_build Name: iwyu Version: 0.19 Release: 1%{?dist} Summary: C/C++ source files #include analyzer based on clang License: LLVM URL: https://github.com/%{owner}/%{longname} Source0: https://github.com/%{owner}/%{longname}/archive/%{commit}.tar.gz#/%{longname}-%{commit}.tar.gz BuildRequires: cmake BuildRequires: git BuildRequires: clang-devel >= 15.0 # NOTE: This should probably listed as a dependency for clang-devel but it's # not, so make it explicit here BuildRequires: llvm-devel BuildRequires: zlib-devel BuildRequires: python3-devel BuildRequires: ncurses-devel BuildRequires: /usr/bin/pathfix.py # 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 %autosetup -n %{longname}-%{commit} pathfix.py -pni "%{__python3} %{py3_shbang_opts}" iwyu_tool.py fix_includes.py %build %cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LTO=ON .. %cmake_build %install %cmake_install cd %{buildroot}%{_bindir} ln -s include-what-you-use iwyu ln -s fix_includes.py fix_includes ln -s iwyu_tool.py iwyu_tool %check # Tests only seem to work on i386 so far %files %{_bindir}/include-what-you-use %{_bindir}/iwyu %{_bindir}/fix_includes %{_bindir}/fix_includes.py %{_bindir}/iwyu_tool %{_bindir}/iwyu_tool.py %{_mandir}/man1/include-what-you-use.1* %dir %{_datadir}/include-what-you-use %{_datadir}/include-what-you-use/*.imp %changelog