%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: A semantic grep for the C language Name: coccigrep Version: 1.6 Release: 1 License: GPLv3+ Group: Applications/Text URL: http://home.regit.org/software/coccigrep/ Source0: http://home.regit.org/wp-content/uploads/2011/08/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: coccinelle python BuildArch: noarch %description grep is a semantic grep for the C language based on coccinelle. It can be used to find where a given structure is used in code files. Coccigrep depends on the spatch program which comes with coccinelle. %prep %setup -q %build python ./setup.py build %install rm -rf $RPM_BUILD_ROOT python ./setup.py install --root=%{buildroot} --install-lib=%{python_sitelib} mkdir -p %{buildroot}%{_mandir}/man1/ install coccigrep.1 %{buildroot}%{_mandir}/man1/ %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc LICENSE README.rst editors/* %attr(0755,root,root) %{_bindir}/coccigrep %dir %{python_sitelib}/%{name} %{python_sitelib}/%{name}/* %{python_sitelib}/%{name}*.egg-info %attr(0644,root,root) %{_mandir}/man1/* %changelog * Mon Nov 14 2011 Steve Grubb 1.6-1 - Initial package