castxml/castxml.spec
2023-11-14 10:53:30 +08:00

74 lines
2.0 KiB
RPMSpec

%undefine __cmake_in_source_build
Name: castxml
Version: 0.6.2
Release: 1
Summary: C-family abstract syntax tree XML output tool
License: Apache-2.0
URL: https://github.com/CastXML/CastXML
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: make
BuildRequires: gcc-c++
BuildRequires: llvm-devel >= 3.6.0
BuildRequires: clang-devel >= 3.6.0
BuildRequires: libedit-devel
BuildRequires: zlib-devel
BuildRequires: python3-sphinx
BuildRequires: llvm-test
BuildRequires: clang-tools-extra
BuildRequires: clang
Obsoletes: gccxml < 0.9.0-0.28
%description
Parse C-family source files and optionally write a subset of the
Abstract Syntax Tree (AST) to a representation in XML.
Source files are parsed as complete translation units using the clang
compiler. XML output is enabled by the --castxml-gccxml option and
produces a format close to that of gccxml. Future versions of castxml
may support alternative output formats.
%prep
%setup -q -n CastXML-%{version}
%build
%cmake -DCastXML_INSTALL_DOC_DIR:STRING=share/doc/%{name} \
-DCastXML_INSTALL_MAN_DIR:STRING=share/man \
-DCLANG_RESOURCE_DIR:PATH=$(clang -print-file-name=include)/.. \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DCLANG_LINK_CLANG_DYLIB:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DSPHINX_MAN:BOOL=ON
%make_build
%install
%make_install
rm %{buildroot}%{_pkgdocdir}/LICENSE
rm %{buildroot}%{_pkgdocdir}/NOTICE
%check
ctest -v
%files
%{_bindir}/castxml
%doc %{_mandir}/man1/castxml.1*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/clang
%{_datadir}/%{name}/detect_vs.c
%{_datadir}/%{name}/detect_vs.cpp
%{_datadir}/%{name}/empty.c
%{_datadir}/%{name}/empty.cpp
%license LICENSE NOTICE
%changelog
* Tue Nov 14 2023 wangqia <wangqia@uniontech.com> - 0.6.2-1
- Upgrade to 0.6.2
* Thu Aug 17 2023 leeffo <liweiganga@uniontech.com> - 0.6.1-2
- fix compile fail
* Fri Apr 28 2023 liweiganga <liweiganga@uniontech.com> - 0.6.1-1
- Init packaging for openEuler