Sophie

Sophie

distrib > Mageia > 6 > x86_64 > by-pkgid > 806e7e5c9183b29927e92558a4689d3e > files > 2

coccinelle-1.0.4-3.mga6.src.rpm

%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil}
%define version 1.0.4

%if !%opt
# Prevent RPM from stripping bytecode /usr/bin/spatch.
%define __strip /bin/true
%endif

Name:           coccinelle
Version:        %{version}
Release:        %mkrel 3
Summary:        Semantic patching for Linux (spatch)
Group:          Development/C
License:        GPLv2
URL:            http://coccinelle.lip6.fr/
Source0:        http://coccinelle.lip6.fr/distrib/%{name}-%{version}.tgz
BuildRequires:  ocaml >= 3.10.0
BuildRequires:  ocaml-findlib-devel
BuildRequires:  ocaml-compiler-libs
BuildRequires:  ocaml-camlp4-devel
BuildRequires:  ocaml-pcre-devel
BuildRequires:  ocaml-doc
BUildRequires:	ncurses-devel
BuildRequires:  python-devel
BuildRequires:  texlive-fontsextra
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
BuildRequires:  chrpath

%global __ocaml_requires_opts -i Ast_c -i Token_c -i Type_cocci -i Ast_cocci -i Common -i Oassocb -i ANSITerminal -i Oseti -i Sexplib -i Oassoch -i Setb -i Oassoc_buffer -i Ograph2way -i SetPt -i Mapb -i Dumper -i Osetb -i Flag -i Regexp -i Visitor_c -i Token_annot -i Seti -i Pretty_print_c -i Parser_c -i Oset -i Ograph_extended -i Ocollection -i Objet -i Oassoc -i Lib_parsing_c -i Lexer_c -i Iteration -i Externalanalysis -i Exposed_modules -i Control_flow_c -i Config -i Commands -i Ast0_cocci

%description
Coccinelle is a tool to utilize semantic patches for manipulating C
code. It was originally designed to ease maintenance of device
drivers in the Linux kernel.

%package doc
Summary:        Documentation for %{name}
Group:          Development/C
Requires:       %{name} = %{version}-%{release}

%description doc
The %{name}-doc package contains documentation for %{name}.

%package examples
Summary:        Examples for %{name}
Group:          Development/C
Requires:       %{name} = %{version}-%{release}

%description examples
The %{name}-examples package contains examples for %{name}.

%prep
%setup -q

# Remove .cvsignore files.
find -name .cvsignore -delete

# Convert a few files to UTF-8 encoding.
for f in demos/demo_rule9/sym53c8xx.res demos/demo_rule9/sym53c8xx.c; do
  mv $f $f.orig
  iconv -f iso-8859-1 -t utf-8 < $f.orig > $f
  rm $f.orig
done


%build
./configure --enable-release=yes
%{__sed} -i \
  -e 's,BINDIR=.*,BINDIR=%{_bindir},' \
  -e 's,LIBDIR=.*,LIBDIR=%{_libdir},' \
  -e 's,MANDIR=.*,MANDIR=%{_mandir},' \
  -e 's,SHAREDIR=.*,SHAREDIR=%{_libdir}/%{name},' \
  -e 's,DYNLINKDIR=.*,DYNLINKDIR=%{_libdir}/ocaml,' \
  Makefile.config

%if !%opt
%make byte EXTLIBDIR=`ocamlc -where`/extlib
%else
%make world EXTLIBDIR=`ocamlc -where`/extlib
%endif


%install
%make DESTDIR=$RPM_BUILD_ROOT install

# Remove these (they are just wrapper scripts).
rm -f $RPM_BUILD_ROOT%{_bindir}/spatch.byte
rm -f $RPM_BUILD_ROOT%{_bindir}/spatch.opt

# Move the libdir stuff into a subdirectory.
pushd $RPM_BUILD_ROOT%{_libdir}
mkdir coccinelle
for f in standard.h standard.iso spatch spatch.byte spatch.opt; do
  if [ -f $f ]; then
    mv $f coccinelle/$f
  fi
done
popd

# Move Python libraries to python lib directory.
mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
mv $RPM_BUILD_ROOT%{_libdir}/python/coccilib \
  $RPM_BUILD_ROOT%{python_sitelib}

rmdir $RPM_BUILD_ROOT%{_libdir}/python

# Move OCaml libraries.
pushd $RPM_BUILD_ROOT%{_libdir}
rm ocaml/*.cmi
mkdir ocaml/stublibs
mv dllpycaml_stubs.so ocaml/stublibs
popd


%check
LD_LIBRARY_PATH=. \
./spatch.opt -cocci_file demos/simple.cocci demos/simple.c


%files
%doc authors.txt bugs.txt changes.txt copyright.txt
%doc credits.txt install.txt license.txt readme.txt
%{_bindir}/spatch
%{_bindir}/pycocci
%{_libdir}/%{name}
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3*
%{python_sitelib}/coccilib/
%{_libdir}/ocaml/stublibs/*.so
%if !%opt
%config(noreplace) /etc/prelink.conf.d/%{name}.conf
%endif


%files doc
%doc docs


%files examples
%doc demos




%changelog
* Sun Sep 25 2016 pterjan <pterjan> 1.0.4-3.mga6
+ Revision: 1056204
- Rebuild for fix in ocaml

* Thu Feb 04 2016 umeabot <umeabot> 1.0.4-2.mga6
+ Revision: 935628
- Mageia 6 Mass Rebuild

* Wed Feb 03 2016 guillomovitch <guillomovitch> 1.0.4-1.mga6
+ Revision: 934171
- new version 1.0.4

* Wed Oct 15 2014 umeabot <umeabot> 1.0.0-0.rc16.8.mga5
+ Revision: 747797
- Second Mageia 5 Mass Rebuild

* Tue Sep 23 2014 malo <malo> 1.0.0-0.rc16.7.mga5
+ Revision: 722691
- fix auto requires

* Thu Sep 18 2014 umeabot <umeabot> 1.0.0-0.rc16.6.mga5
+ Revision: 693651
- Rebuild to fix library dependencies

* Tue Sep 16 2014 umeabot <umeabot> 1.0.0-0.rc16.5.mga5
+ Revision: 678460
- Mageia 5 Mass Rebuild

* Sat May 31 2014 pterjan <pterjan> 1.0.0-0.rc16.4.mga5
+ Revision: 628138
- Rebuild for new Python

* Fri Oct 18 2013 umeabot <umeabot> 1.0.0-0.rc16.3.mga4
+ Revision: 503407
- Mageia 4 Mass Rebuild

* Fri Jan 11 2013 umeabot <umeabot> 1.0.0-0.rc16.2.mga3
+ Revision: 347962
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Mon Dec 17 2012 neoclust <neoclust> 1.0.0-0.rc16.1.mga3
+ Revision: 332117
+ rebuild (emptylog)

* Mon Dec 17 2012 neoclust <neoclust> 1.0.0.rc16-1.mga3
+ Revision: 332106
- imported package coccinelle


* Mon Sep 19 2011 Alexandre Lissy <alissy@mandriva.com> 1.0.0.rc7-1
+ Revision: 700362
- Updating to 1.0.0-rc7
  Removing %%make in favor of make

* Fri Aug 12 2011 Alexandre Lissy <alissy@mandriva.com> 1.0.0.rc5-1
+ Revision: 694208
- Updating coccinelle to latest 1.0.0-rc5 release

* Mon Aug 01 2011 Alexandre Lissy <alissy@mandriva.com> 1.0.0.rc4-1
+ Revision: 692680
- Update sources with rc4
- .spec cleanup
- Use %%make macro
- Updating to rc4

* Fri Jun 24 2011 Alexandre Lissy <alissy@mandriva.com> 1.0.0.rc3-1
+ Revision: 686882
- Missing man page
- Updating coccinelle to 1.0.0 rc3

* Mon May 30 2011 Alexandre Lissy <alissy@mandriva.com> 1.0.0.rc2-1
+ Revision: 681850
- fix: Setting Group to Development/C for all packages built
- fix: Adding missing BuildRequires on ncurses-devel
- Changing group to Development/C
- Introducing coccinelle, a program matching and tranformation for C source code.
  Package imported from Fedora.
  Some adjustments to Mandriva.
  Updating Coccinelle to 1.0.0-rc2
- Created package structure for coccinelle.