From 41e849e3ccd9d73a696e8f321df32f734476963f Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: May 20 2016 16:53:05 +0000 Subject: update to latest upstream --- diff --git a/csmock.spec b/csmock.spec index 937850c..d9164b6 100644 --- a/csmock.spec +++ b/csmock.spec @@ -1,5 +1,5 @@ Name: csmock -Version: 1.9.2 +Version: 2.0.0 Release: 1%{?dist} Summary: A mock wrapper for Static Analysis tools @@ -16,6 +16,22 @@ BuildRequires: python-devel BuildRequires: python-argparse %endif +# force using Python 3 Fedora 23+ +%global force_py3 ((7 < 0%{?rhel}) || (22 < 0%{?fedora})) +%if %{force_py3} +BuildRequires: python3-GitPython +BuildRequires: python3-devel +%global csmock_python_executable %{__python3} +%global csmock_python_sitelib %{python3_sitelib} +%else +%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 +%global csmock_python_executable %{__python2} +%global csmock_python_sitelib %{python2_sitelib} +%endif + Requires: csmock-common >= %{version}-%{release} Requires: csmock-plugin-clang >= %{version}-%{release} Requires: csmock-plugin-cppcheck >= %{version}-%{release} @@ -29,7 +45,12 @@ This is a metapackage pulling in csmock-common and basic csmock plug-ins. %package -n csbuild Summary: Tool for plugging static analyzers into the build process +%if %{force_py3} +Requires: csmock-common(python3) +Requires: python3-GitPython +%else Requires: GitPython +%endif Requires: cscppc Requires: csclng Requires: csdiff >= 1.2.1 @@ -47,6 +68,9 @@ Requires: mock %if !(0%{?fedora} >= 19 || 0%{?rhel} >= 7) Requires: python-argparse %endif +%if %{force_py3} +Provides: csmock-common(python3) = %{version}-%{release} +%endif %description -n csmock-common This package contains the csmock tool that allows to scan SRPMs by Static @@ -56,6 +80,9 @@ Analysis tools in a fully automated way. Summary: csmock plug-in providing the support for Clang Requires: csclng Requires: csmock-common >= 1.7.1 +%if %{force_py3} +Requires: csmock-common(python3) +%endif %description -n csmock-plugin-clang This package contains the clang plug-in for csmock. @@ -64,6 +91,9 @@ This package contains the clang plug-in for csmock. Summary: csmock plug-in providing the support for Cppcheck Requires: cscppc >= 1.0.4 Requires: csmock-common +%if %{force_py3} +Requires: csmock-common(python3) +%endif %description -n csmock-plugin-cppcheck This package contains the cppcheck plug-in for csmock. @@ -71,6 +101,9 @@ This package contains the cppcheck plug-in for csmock. %package -n csmock-plugin-pylint Summary: csmock plug-in providing the support for Pylint. Requires: csmock-common >= 1.8.0 +%if %{force_py3} +Requires: csmock-common(python3) +%endif %description -n csmock-plugin-pylint This package contains the pylint plug-in for csmock. @@ -78,22 +111,28 @@ This package contains the pylint plug-in for csmock. %package -n csmock-plugin-shellcheck Summary: csmock plug-in providing the support for ShellCheck. Requires: csmock-common >= 1.8.0 +%if %{force_py3} +Requires: csmock-common(python3) +%endif %description -n csmock-plugin-shellcheck This package contains the shellcheck plug-in for csmock. -%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 +# force using Python 3 Fedora 23+ +%if %{force_py3} +sed -e '1s/python$/python3/' -i py/cs{build,mock} +%endif + %build mkdir csmock_build cd csmock_build -%cmake '-DVERSION=%{name}-%{version}-%{release}' .. +%cmake \ + -DVERSION='%{name}-%{version}-%{release}' \ + -DPYTHON_EXECUTABLE='%{csmock_python_executable}' \ + .. make %{?_smp_mflags} VERBOSE=yes %install @@ -112,32 +151,51 @@ make install DESTDIR="$RPM_BUILD_ROOT" %files -n csmock-common %dir %{_datadir}/csmock %dir %{_datadir}/csmock/scripts -%dir %{python2_sitelib}/csmock -%dir %{python2_sitelib}/csmock/plugins +%dir %{csmock_python_sitelib}/csmock +%dir %{csmock_python_sitelib}/csmock/plugins %{_bindir}/csmock %{_mandir}/man1/csmock.1* %{_datadir}/csmock/cwe-map.csv %{_datadir}/csmock/scripts/patch-rawbuild.sh -%{python2_sitelib}/csmock/__init__.py* -%{python2_sitelib}/csmock/common -%{python2_sitelib}/csmock/plugins/gcc.py* +%{csmock_python_sitelib}/csmock/__init__.py* +%{csmock_python_sitelib}/csmock/common +%{csmock_python_sitelib}/csmock/plugins/gcc.py* +%if %{force_py3} +%{csmock_python_sitelib}/csmock/__pycache__/__init__.* +%{csmock_python_sitelib}/csmock/plugins/__pycache__/gcc.* +%endif %doc COPYING README %files -n csmock-plugin-clang -%{python2_sitelib}/csmock/plugins/clang.py* +%{csmock_python_sitelib}/csmock/plugins/clang.py* +%if %{force_py3} +%{csmock_python_sitelib}/csmock/plugins/__pycache__/clang.* +%endif %files -n csmock-plugin-cppcheck -%{python2_sitelib}/csmock/plugins/cppcheck.py* +%{csmock_python_sitelib}/csmock/plugins/cppcheck.py* +%if %{force_py3} +%{csmock_python_sitelib}/csmock/plugins/__pycache__/cppcheck.* +%endif %files -n csmock-plugin-pylint %{_datadir}/csmock/scripts/run-pylint.sh -%{python2_sitelib}/csmock/plugins/pylint.py* +%{csmock_python_sitelib}/csmock/plugins/pylint.py* +%if %{force_py3} +%{csmock_python_sitelib}/csmock/plugins/__pycache__/pylint.* +%endif %files -n csmock-plugin-shellcheck %{_datadir}/csmock/scripts/run-shellcheck.sh -%{python2_sitelib}/csmock/plugins/shellcheck.py* +%{csmock_python_sitelib}/csmock/plugins/shellcheck.py* +%if %{force_py3} +%{csmock_python_sitelib}/csmock/plugins/__pycache__/shellcheck.* +%endif %changelog +* Fri May 20 2016 Kamil Dudka 2.0.0-1 +- update to latest upstream + * Thu Apr 28 2016 Kamil Dudka 1.9.2-1 - update to latest upstream diff --git a/sources b/sources index edcf106..ba7d49b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c097918aefbcc1b702c6b001e024fcbe csmock-1.9.2.tar.xz +2504d86d5eb1f025007f63fcddfb11d8 csmock-2.0.0.tar.xz