diff --git a/csmock.spec b/csmock.spec index 2ca8d45..68bd2f4 100644 --- a/csmock.spec +++ b/csmock.spec @@ -1,5 +1,5 @@ Name: csmock -Version: 1.2.3 +Version: 1.4.1 Release: 1%{?dist} Summary: A mock wrapper for Static Analysis tools @@ -9,44 +9,51 @@ 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 +BuildRequires: python-devel %if !(0%{?fedora} >= 19 || 0%{?rhel} >= 7) BuildRequires: python-argparse %endif -Requires: csdiff -Requires: cswrap -Requires: mock -Requires: rpm-build - -# TODO: make these sub-packages optional +Requires: csmock-common Requires: csmock-plugin-clang Requires: csmock-plugin-cppcheck -Obsoletes: csmock-ng <= 1.1.1 - 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. +This is a metapackage pulling in csmock-common and basic csmock plug-ins. + +%package -n csmock-common +Summary: Core of csmock (a mock wrapper for Static Analysis tools) +Requires: csdiff +Requires: cswrap >= 1.0.4 +Requires: mock +Requires: rpm-build + +%description -n csmock-common +This package contains the csmock tool that allows to scan SRPMs by Static +Analysis tools in a fully automated way. %package -n csmock-plugin-clang Summary: csmock plug-in providing the support for Clang -Requires: csmock +Requires: csclng +Requires: csmock-common %description -n csmock-plugin-clang -Hihgly experimental, currently suitable only for development of csmock itself. +This package contains the clang plug-in for csmock. %package -n csmock-plugin-cppcheck Summary: csmock plug-in providing the support for Cppcheck -Requires: cscppc -Requires: csmock +Requires: cscppc >= 1.0.4 +Requires: csmock-common %description -n csmock-plugin-cppcheck -Hihgly experimental, currently suitable only for development of csmock itself. +This package contains the cppcheck plug-in for csmock. -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%endif %prep %setup -q @@ -54,23 +61,22 @@ Hihgly experimental, currently suitable only for development of csmock itself. %build mkdir -p bin man -# ebmed VERSION and PLUGIN_DIR version into the scripts +# embed 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|' \ + -e 's|@PLUGIN_DIR@|%{python2_sitelib}/csmock/plugins|' \ -i py/csmock help2man --no-info --section 1 --name \ - "run static analysis of the given SRPM using mock" \ + "DEPRECATED - please use csmock instead!" \ 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" \ + "DEPRECATED - please use 'csmock --diff-patches' instead!" \ bin/cov-diffbuild > man/cov-diffbuild.1 -help2man --no-info --section 1 --name \ - "run static analysis of the given SRPM using mock" \ +help2man --no-info --section 1 --include doc/csmock.h2m \ py/csmock > man/csmock.1 %install @@ -79,26 +85,28 @@ install -m0755 -d \ "$RPM_BUILD_ROOT%{_mandir}/man1" \ "$RPM_BUILD_ROOT%{_datadir}/csmock" \ "$RPM_BUILD_ROOT%{_datadir}/csmock/scripts" \ - "$RPM_BUILD_ROOT%{python_sitearch}/" \ - "$RPM_BUILD_ROOT%{python_sitearch}/csmock" \ - "$RPM_BUILD_ROOT%{python_sitearch}/csmock/plugins" + "$RPM_BUILD_ROOT%{python2_sitelib}/" \ + "$RPM_BUILD_ROOT%{python2_sitelib}/csmock" \ + "$RPM_BUILD_ROOT%{python2_sitelib}/csmock/plugins" install -p -m0755 \ - cov-{diff,mock}build cov-dump-err rpmbuild-rawbuild py/csmock \ + cov-{diff,mock}build 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 cov_checker_map.txt "$RPM_BUILD_ROOT%{_datadir}/csmock/cwe-map.csv" +install -p -m0644 cwe-map.csv "$RPM_BUILD_ROOT%{_datadir}/csmock/" install -p -m0644 py/plugins/*.py \ - "$RPM_BUILD_ROOT%{python_sitearch}/csmock/plugins" + "$RPM_BUILD_ROOT%{python2_sitelib}/csmock/plugins" install -p -m0755 scripts/*.sh \ "$RPM_BUILD_ROOT%{_datadir}/csmock/scripts" +# needed to create the csmock RPM %files -%{_bindir}/cov-dump-err + +%files -n csmock-common %{_bindir}/cov-diffbuild %{_bindir}/cov-mockbuild %{_bindir}/csmock @@ -108,17 +116,19 @@ install -p -m0755 scripts/*.sh \ %{_mandir}/man1/csmock.1* %{_datadir}/csmock/cwe-map.csv %{_datadir}/csmock/scripts/patch-rawbuild.sh -%{python_sitearch}/csmock/plugins/gcc.py* +%{python2_sitelib}/csmock/plugins/gcc.py* %doc COPYING %files -n csmock-plugin-clang -%{_datadir}/csmock/scripts/fixups-clang.sh -%{python_sitearch}/csmock/plugins/clang.py* +%{python2_sitelib}/csmock/plugins/clang.py* %files -n csmock-plugin-cppcheck -%{python_sitearch}/csmock/plugins/cppcheck.py* +%{python2_sitelib}/csmock/plugins/cppcheck.py* %changelog +* Wed Sep 10 2014 Kamil Dudka 1.4.1-1 +- update to latest upstream + * Thu Jul 17 2014 Kamil Dudka 1.2.3-1 - update to latest upstream diff --git a/sources b/sources index a990a2b..252cc56 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1176c8ea1a3325e5536b9d9231f5ea75 csmock-1.2.3.tar.xz +efae0f0fe8bcfeb66b49628b21b207d6 csmock-1.4.1.tar.xz