Blob Blame History Raw
Name:       csmock
Version:    1.1.1
Release:    1%{?dist}
Summary:    A mock wrapper for Static Analysis tools

Group:      Development/Tools
License:    GPLv3+
URL:        https://git.fedorahosted.org/cgit/csmock.git
Source0:    https://git.fedorahosted.org/cgit/csmock.git/snapshot/csmock-%{version}.tar.xz

BuildRequires: help2man
BuildRequires: python

Requires: csmock-plugin-clang
Requires: csmock-plugin-cppcheck
Requires: rpm-build

BuildArch: noarch

%description
This package contains cov-mockbuild and cov-diffbuild tools that allow to scan
SRPMs by Static Analysis tools in a fully automated way.

%package -n csmock-ng
Summary: Preview of a new major version of the csmock package
Requires: csdiff
Requires: csmock
Requires: cswrap
Requires: mock

%description -n csmock-ng
Hihgly experimental, currently suitable only for development of csmock itself.

%package -n csmock-plugin-clang
Summary: csmock plug-in providing the support for Clang
Requires: csmock-ng

%description -n csmock-plugin-clang
Hihgly experimental, currently suitable only for development of csmock itself.

%package -n csmock-plugin-cppcheck
Summary: csmock plug-in providing the support for Cppcheck
Requires: cscppc
Requires: csmock-ng

%description -n csmock-plugin-cppcheck
Hihgly experimental, currently suitable only for development of csmock itself.

%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%prep
%setup -q

%build
mkdir -p bin man

# ebmed VERSION and PLUGIN_DIR version into the scripts
install -p -m0755 cov-{diff,mock}build bin/
sed -e 's/rpm -qf .SELF/echo %{version}/' -i bin/cov-{diff,mock}build
sed -e 's/@VERSION@/%{name}-%{version}-%{release}/' \
    -e 's|@PLUGIN_DIR@|%{python_sitearch}/csmock/plugins|' \
    -i py/csmock

help2man --no-info --section 1 --name \
    "run static analysis of the given SRPM using mock" \
    bin/cov-mockbuild > man/cov-mockbuild.1

help2man --no-info --section 1 --name \
    "run static analysis of the given the patches in the given SRPM using cov-mockbuild" \
    bin/cov-diffbuild > man/cov-diffbuild.1

help2man --no-info --section 1 --name \
    "run static analysis of the given SRPM using mock" \
    py/csmock > man/csmock.1

%install
install -m0755 -d \
    "$RPM_BUILD_ROOT%{_bindir}" \
    "$RPM_BUILD_ROOT%{_mandir}/man1" \
    "$RPM_BUILD_ROOT%{_datadir}/csmock" \
    "$RPM_BUILD_ROOT%{_datadir}/csmock/bashrc" \
    "$RPM_BUILD_ROOT%{_datadir}/csmock/scripts" \
    "$RPM_BUILD_ROOT%{python_sitearch}/" \
    "$RPM_BUILD_ROOT%{python_sitearch}/csmock" \
    "$RPM_BUILD_ROOT%{python_sitearch}/csmock/plugins"

install -p -m0755 \
    cov-{diff,mock}build cov-dump-err rpmbuild-rawbuild py/csmock \
    "$RPM_BUILD_ROOT%{_bindir}"

install -p -m0644 man/{csmock,cov-{diff,mock}build}.1 "$RPM_BUILD_ROOT%{_mandir}/man1/"

install -p -m0644 build.bashrc        "$RPM_BUILD_ROOT%{_datadir}/csmock/bashrc/build"
install -p -m0644 prep.bashrc         "$RPM_BUILD_ROOT%{_datadir}/csmock/bashrc/prep"
install -p -m0644 cov_checker_map.txt "$RPM_BUILD_ROOT%{_datadir}/csmock/cwe-map.csv"

install -p -m0644 py/plugins/*.py \
    "$RPM_BUILD_ROOT%{python_sitearch}/csmock/plugins"

install -p -m0755 scripts/*.sh \
    "$RPM_BUILD_ROOT%{_datadir}/csmock/scripts"

%files
%{_bindir}/cov-dump-err
%{_bindir}/cov-diffbuild
%{_bindir}/cov-mockbuild
%{_bindir}/rpmbuild-rawbuild
%{_mandir}/man1/cov-diffbuild.1*
%{_mandir}/man1/cov-mockbuild.1*
%{_datadir}/csmock
%doc COPYING

%files -n csmock-ng
%{_bindir}/csmock
%{_datadir}/csmock/scripts/patch-rawbuild.sh
%{_mandir}/man1/csmock.1*
%{python_sitearch}/csmock/plugins/gcc.py*

%files -n csmock-plugin-clang
%{_datadir}/csmock/scripts/fixups-clang.sh
%{python_sitearch}/csmock/plugins/clang.py*

%files -n csmock-plugin-cppcheck
%{python_sitearch}/csmock/plugins/cppcheck.py*

%changelog
* Thu Jun 19 2014 Kamil Dudka <kdudka@redhat.com> 1.1.1-1
- update to latest upstream

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Apr 16 2014 Kamil Dudka <kdudka@redhat.com> 1.0.7-1
- update to latest upstream

* Tue Feb 25 2014 Kamil Dudka <kdudka@redhat.com> 1.0.3-2
- further spec file improvements per Fedora Review Request (#1066029)

* Mon Feb 24 2014 Kamil Dudka <kdudka@redhat.com> 1.0.3-1
- update to new upstream release
- abandon RHEL-5 compatibility per Fedora Review Request (#1066029)

* Wed Feb 19 2014 Kamil Dudka <kdudka@redhat.com> 1.0.2-1
- packaged for Fedora