Compare commits

...

4 Commits
rawhide ... f8

Author SHA1 Message Date
Fedora Release Engineering 460305ac7f dist-git conversion 2010-07-29 04:43:14 +00:00
Bill Nottingham d0fe69c394 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:20:12 +00:00
Richard W.M. Jones 8324a4fc34 Initial CVS import. 2008-03-01 12:37:45 +00:00
Kevin Fenzi 857ad2e004 Initialize branch F-8 for ocaml-cil 2008-02-29 17:04:05 +00:00
5 changed files with 198 additions and 21 deletions

View File

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cil-1.3.6.tar.gz

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: ocaml-cil
# $Id$
NAME := ocaml-cil
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

196
ocaml-cil.spec Normal file
View File

@ -0,0 +1,196 @@
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil}
Name: ocaml-cil
Version: 1.3.6
Release: 4%{?dist}
Summary: CIL - Infrastructure for C Program Analysis and Transformation
Group: Development/Libraries
License: BSD
URL: http://cil.sourceforge.net/
Source0: http://hal.cs.berkeley.edu/cil/distrib/cil-1.3.6.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExcludeArch: ppc64
ExcludeArch: ppc
BuildRequires: ocaml, ocaml-findlib-devel, ocaml-ocamldoc
%define _use_internal_dependency_generator 0
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
%description
CIL (C Intermediate Language) is a high-level representation along
with a set of tools that permit easy analysis and source-to-source
transformation of C programs.
CIL is both lower-level than abstract-syntax trees, by clarifying
ambiguous constructs and removing redundant ones, and also
higher-level than typical intermediate languages designed for
compilation, by maintaining types and a close relationship with the
source program. The main advantage of CIL is that it compiles all
valid C programs into a few core constructs with a very clean
semantics. Also CIL has a syntax-directed type system that makes it
easy to analyze and manipulate C programs. Furthermore, the CIL
front-end is able to process not only ANSI-C programs but also those
using Microsoft C or GNU C extensions. If you do not use CIL and want
instead to use just a C parser and analyze programs expressed as
abstract-syntax trees then your analysis will have to handle a lot of
ugly corners of the language (let alone the fact that parsing C itself
is not a trivial task).
In essence, CIL is a highly-structured, "clean" subset of C. CIL
features a reduced number of syntactic and conceptual forms. For
example, all looping constructs are reduced to a single form, all
function bodies are given explicit return statements, syntactic sugar
like "->" is eliminated and function arguments with array types become
pointers.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description doc
The %{name}-doc package contains documentation for users of %{name}.
%package cilly
Summary: Support programs for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: perl >= 5.8
Provides: perl(CilConfig) = %{version}
%description cilly
The %{name}-cilly package contains the 'cilly' wrapper/replacement
for gcc.
%prep
%setup -q -n cil
./configure --libdir=%{_libdir}
%build
make
make quicktest
cat > META <<EOF
version="%{version}"
description="%{summary}"
archive(byte)="cil.cma"
archive(native)="cil.cmxa"
requires=""
EOF
archos=`ls obj`
rm -f bin/CilConfig.pm
cat > bin/CilConfig.pm <<EOF
\$::archos = "$archos";
\$::cc = "gcc";
\$::cilhome = "%{_libexecdir}/cil";
\$::default_mode = "GNUCC";
EOF
strip obj/$archos/libcil.a
#strip obj/$archos/cilly.byte.exe - NO! It removes the bytecode :-(
%if %opt
strip obj/$archos/cilly.asm.exe
%endif
%install
rm -rf $RPM_BUILD_ROOT
# This sets $archos to something like 'x86_LINUX':
archos=`ls obj`
# This sets $privlib to something like '/usr/lib/perl5/5.8.8':
eval `perl -V:privlib`
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
# CIL's make install rule is totally borked.
mkdir -p $DESTDIR$privlib
install -m 0644 lib/*.pm bin/CilConfig.pm $DESTDIR$privlib
mkdir -p $OCAMLFIND_DESTDIR
ocamlfind install cil META obj/$archos/*.{ml,mli,cmi,cmo,cmx,cma,cmxa,o,a}
mkdir -p $DESTDIR%{_bindir}
install -m 0755 bin/cilly $DESTDIR%{_bindir}
mkdir -p $DESTDIR%{_libexecdir}/cil/obj/$archos
install -m 0755 obj/$archos/cilly.*.exe $DESTDIR%{_libexecdir}/cil/obj/$archos
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README LICENSE
%{_libdir}/ocaml/cil
%if %opt
%exclude %{_libdir}/ocaml/cil/*.a
%exclude %{_libdir}/ocaml/cil/*.cmxa
%exclude %{_libdir}/ocaml/cil/*.cmx
%endif
%exclude %{_libdir}/ocaml/cil/*.mli
%files devel
%defattr(-,root,root,-)
%doc README LICENSE
%if %opt
%{_libdir}/ocaml/cil/*.a
%{_libdir}/ocaml/cil/*.cmxa
%{_libdir}/ocaml/cil/*.cmx
%endif
%{_libdir}/ocaml/cil/*.mli
%files doc
%doc README LICENSE doc/*
%files cilly
%defattr(-,root,root,-)
%doc README LICENSE
/usr/lib/perl5/*/CilConfig.pm
/usr/lib/perl5/*/Cilly.pm
/usr/lib/perl5/*/KeptFile.pm
/usr/lib/perl5/*/OutputFile.pm
/usr/lib/perl5/*/TempFile.pm
%{_bindir}/cilly
%{_libexecdir}/cil
%changelog
* Wed Nov 7 2007 Richard W.M. Jones <rjones@redhat.com> - 1.3.6-4
- ExcludeArch ppc - CIL doesn't build on PPC as it turns out.
* Wed Nov 7 2007 Richard W.M. Jones <rjones@redhat.com> - 1.3.6-3
- Change upstream URL.
- perl(CilConfig) set to package version
- Split out documentation into a separate -doc package.
* Mon Aug 20 2007 Richard W.M. Jones <rjones@redhat.com> - 1.3.6-2
- Initial RPM release.

View File

@ -0,0 +1 @@
112dfbabdd0e1280800d62ba4449ab45 cil-1.3.6.tar.gz