Name: cscppc
Version: 1.3.2
Release: 1%{?dist}
Summary: A compiler wrapper that runs cppcheck in background
Group: Development/Tools
License: GPLv3+
URL: https://github.com/kdudka/%{name}
Source0: https://github.com/kdudka/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.xz
BuildRequires: asciidoc
BuildRequires: cmake
# The test-suite runs automatically trough valgrind if valgrind is available
# on the system. By not installing valgrind into mock's chroot, we disable
# this feature for production builds on architectures where valgrind is known
# to be less reliable, in order to avoid unnecessary build failures (see RHBZ
# #810992, #816175, and #886891). Nevertheless developers are free to install
# valgrind manually to improve test coverage on any architecture.
%ifarch %{ix86} x86_64
BuildRequires: valgrind
%endif
# csmock copies the resulting cscppc binary into mock chroot, which may contain
# an older (e.g. RHEL-5) version of glibc, and it would not dynamically link
# against the old version of glibc if it was built against a newer one.
# Therefor we link glibc statically.
%if (0%{?fedora} >= 12 || 0%{?rhel} >= 6)
BuildRequires: glibc-static
%endif
# the --include option was introduced in 1.58
Requires: cppcheck >= 1.58
%description
This package contains the cscppc compiler wrapper that runs cppcheck in
background fully transparently.
%package -n csclng
Summary: A compiler wrapper that runs Clang in background
Requires: clang
Conflicts: csmock-plugin-clang < 1.5.0
%description -n csclng
This package contains the csclng compiler wrapper that runs the Clang analyzer
in background fully transparently.
%prep
%setup -q
%build
mkdir cscppc_build
cd cscppc_build
export CFLAGS="$RPM_OPT_FLAGS"' -DPATH_TO_CSCPPC=\"%{_libdir}/cscppc\" -DPATH_TO_CSCLNG=\"%{_libdir}/csclng\"'
export LDFLAGS="$RPM_OPT_FLAGS -static -pthread"
%cmake ..
make %{?_smp_mflags} VERBOSE=yes
%check
cd cscppc_build
ctest %{?_smp_mflags} --output-on-failure
%install
cd cscppc_build
make install DESTDIR="$RPM_BUILD_ROOT"
install -m0755 -d "$RPM_BUILD_ROOT%{_libdir}"{,/cscppc,/csclng}
for i in cc gcc %{_arch}-redhat-linux-gcc
do
ln -s ../../bin/cscppc "$RPM_BUILD_ROOT%{_libdir}/cscppc/$i"
ln -s ../../bin/csclng "$RPM_BUILD_ROOT%{_libdir}/csclng/$i"
done
for i in c++ g++ %{_arch}-redhat-linux-c++ %{_arch}-redhat-linux-g++
do
ln -s ../../bin/cscppc "$RPM_BUILD_ROOT%{_libdir}/cscppc/$i"
ln -s ../../bin/csclng++ "$RPM_BUILD_ROOT%{_libdir}/csclng/$i"
done
%files
%{_bindir}/cscppc
%{_datadir}/cscppc
%{_datadir}/cscppc/default.supp
%{_libdir}/cscppc
%{_mandir}/man1/%{name}.1*
%doc COPYING README
%files -n csclng
%{_bindir}/csclng
%{_bindir}/csclng++
%{_libdir}/csclng
%{_mandir}/man1/csclng.1*
%doc COPYING README
%changelog
* Wed Feb 15 2017 Kamil Dudka <kdudka@redhat.com> 1.3.2-1
- update to latest upstream release
- update project URL and source URL
* Fri Nov 27 2015 Kamil Dudka <kdudka@redhat.com> 1.3.1-1
- update to latest upstream
* Fri Aug 28 2015 Kamil Dudka <kdudka@redhat.com> 1.3.0-1
- update to latest upstream
* Wed Jan 28 2015 Kamil Dudka <kdudka@redhat.com> 1.2.0-2
- add missing dependency of csclng on clang
* Fri Nov 07 2014 Kamil Dudka <kdudka@redhat.com> 1.2.0-1
- update to latest upstream
* Wed Sep 03 2014 Kamil Dudka <kdudka@redhat.com> 1.1.0-1
- update to latest upstream (introduces the csclng subpackage)
* Thu Jul 17 2014 Kamil Dudka <kdudka@redhat.com> 1.0.4-1
- update to latest upstream
* Thu Mar 27 2014 Kamil Dudka <kdudka@redhat.com> 1.0.3-1
- update to latest upstream
* Mon Mar 10 2014 Kamil Dudka <kdudka@redhat.com> 1.0.2-2
- abandon RHEL-5 compatibility (#1066026)
* Wed Feb 19 2014 Kamil Dudka <kdudka@redhat.com> 1.0.2-1
- packaged for Fedora