apron/apron.spec

294 lines
10 KiB
RPMSpec
Raw Normal View History

2011-11-07 16:32:49 +00:00
# Testing note: The makefile in test is broken in version 0.9.10. After
# repairing it, compilation of ctest1.c fails due to too few arguments to
# ap_pkgrid_manager_alloc(). Try to create a %%check section again later.
Name: apron
Version: 0.9.10
Release: 17%{?dist}
2011-11-07 16:32:49 +00:00
Summary: Numerical abstract domain library
# The entire package is LGPLv2+ except newpolka/mf_qsort.c and ppl/*, all of
# which are GPLv2+. This means that libpolkaMPQ.so.*, libpolkaRll.so.*, and
# libap_ppl.so.* are GPLv2+, and the other libraries are all LGPLv2+.
License: LGPLv2+ and GPLv2+
URL: http://apron.cri.ensmp.fr/library/
Source0: http://apron.cri.ensmp.fr/library/%{name}-%{version}.tgz
# This patch has not been sent upstream as it is GCC-specific. Certain
# symbols are defined in both libpolkaMPQ and libpolkaRll, with different
# implementations. This patch makes references to those symbols in
# libap_pkgrid be weak references, since that library can be combined with
# either of the 2 implementations.
Patch0: %{name}-weak.patch
2012-05-10 16:01:00 +00:00
# Sent upstream 10 May 2012. This patch adapts to mlgmpidl 1.2.
Patch1: %{name}-mlgmpidl12.patch
2012-07-25 21:07:01 +00:00
# Not yet sent upstream. Fix the tests for GCC 4.7.1.
Patch2: %{name}-test.patch
# Not yet sent upstream. Adapt to PPL 1.0 + GMP 5.1.0
Patch3: %{name}-ppl1.patch
2013-11-20 16:36:05 +00:00
# Alreay applied upstream. Fix a -Werror=format-security failure.
Patch4: %{name}-format-security.patch
2011-11-07 16:32:49 +00:00
BuildRequires: mpfr-devel
BuildRequires: ppl-devel
BuildRequires: ocaml
BuildRequires: ocaml-camlidl-devel
BuildRequires: ocaml-mlgmpidl-devel
BuildRequires: ocaml-ocamldoc
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
2013-11-20 16:36:05 +00:00
%global sover %(cut -d. -f 1 <<< %{version})
2011-11-07 16:32:49 +00:00
%description
The APRON library is dedicated to the static analysis of the numerical
variables of a program by Abstract Interpretation. The aim of such an
analysis is to infer invariants about these variables, like 1<=x+y<=z,
which holds during any execution of the program.
The APRON library is intended to be a common interface to various
underlying libraries/abstract domains and to provide additional services
that can be implemented independently from the underlying
library/abstract domain.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: gmp-devel%{?_isa}
Requires: mpfr-devel%{?_isa}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%package -n ocaml-%{name}
Summary: Ocaml interface to APRON
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n ocaml-%{name}
Ocaml interface to the APRON library.
%package -n ocaml-%{name}-devel
Summary: Development files for the Ocaml interface to APRON
Requires: ocaml-%{name}%{?_isa} = %{version}-%{release}
Requires: ocaml-camlidl-devel%{?_isa}
2011-11-07 16:32:49 +00:00
Requires: ocaml-mlgmpidl-devel%{?_isa}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description -n ocaml-%{name}-devel
Development files for the Ocaml interface to the APRON library.
%prep
%setup -q
%patch0
2012-05-10 16:01:00 +00:00
%patch1
2012-07-25 21:07:01 +00:00
%patch2
%patch3
2013-11-20 16:36:05 +00:00
%patch4
2011-11-07 16:32:49 +00:00
# Set the configuration values
sed -e "s|^# HAS_CPP.*|HAS_CPP = 1|" \
-e "s|^# HAS_PPL.*|HAS_PPL = 1|" \
-e "s|^# HAS_LONG_DOUBLE.*|HAS_LONG_DOUBLE = 1|" \
-e "s|^APRON_PREFIX =.*|APRON_PREFIX=%{_prefix}|" \
2012-05-10 16:01:00 +00:00
-e "s|^MLGMPIDL_PREFIX =.*|MLGMPIDL_PREFIX=%{_libdir}/ocaml/gmp|" \
2011-11-07 16:32:49 +00:00
-e "s|^PPL_PREFIX =.*|PPL_PREFIX=%{_prefix}|" \
-e "s|^-fPIC -O3 -DNDEBUG|$RPM_OPT_FLAGS -fPIC -DNDEBUG -Wl,--as-needed|" \
2012-07-25 21:07:01 +00:00
-e "s|^-fPIC -g -O0|$RPM_OPT_FLAGS -fPIC -Wl,--as-needed|" \
-e "s|-std=c99|-std=gnu99 -D_GNU_SOURCE|" \
2011-11-07 16:32:49 +00:00
%if !%opt
-e "s|^HAS_OCAMLOPT.*|# HAS_OCAMLOPT = 1|" \
-e "s|\.opt||" \
%endif
Makefile.config.model > Makefile.config
# Fix library paths
sed -e "s|\$(CAMLIDL_PREFIX)/lib/ocaml|%{_libdir}/ocaml|g" \
-e "s|\$(MLGMPIDL_PREFIX)/include|\$(MLGMPIDL_PREFIX)|g" \
-e "s|\$(MLGMPIDL_PREFIX)/lib|\$(MLGMPIDL_PREFIX)|g" \
-e "s|-std=c99|-std=gnu99 -D_GNU_SOURCE|" \
2011-11-07 16:32:49 +00:00
-i Makefile box/Makefile examples/Makefile mlapronidl/Makefile \
newpolka/Makefile octagons/Makefile ppl/Makefile products/Makefile \
test/Makefile
# Remove rpaths
for f in `find . -name Makefile`; do
sed -r -e 's| ?-L\$\(APRON_PREFIX\)/lib||' \
-e 's| ?-L\$\(GMP_PREFIX\)/lib||' \
-e 's| ?-L\$\(MPFR_PREFIX\)/lib||' \
-e 's| ?-L\$\(PPL_PREFIX\)/lib||' \
-i $f
done
2011-11-07 16:32:49 +00:00
# Fix the install location for libraries
if [ %{__isa_bits} = "64" ]; then
sed -e "s|\$(APRON_PREFIX)/lib|\$(APRON_PREFIX)/lib64|g" \
-e "s|\$(PREFIX)/lib|\$(PREFIX)/lib64|g" \
-i apron/Makefile apronxx/Makefile box/Makefile examples/Makefile \
itv/Makefile mlapronidl/Makefile newpolka/Makefile octagons/Makefile \
ppl/Makefile products/Makefile test/Makefile
fi
# Add sonames
sed -i -e "s|-shared|-shared -Wl,-soname=\$@.%{sover}|" apron/Makefile
sed -r -e "s|(-shared -o \\\$@ \\\$\^ \\\$\(LIBS.*\))|\1 -Wl,-soname=\$@.%{sover}|" \
-i apronxx/Makefile box/Makefile newpolka/Makefile octagons/Makefile \
ppl/Makefile products/Makefile
# Fix submakes
sed -i "s|make|\$(MAKE)|g" Makefile
# Fix encodings
iconv -f iso8859-1 -t utf-8 Changes > Changes.utf8
touch -r Changes Changes.utf8
mv -f Changes.utf8 Changes
%build
# FIXME: Cannot use %%{?_smp_mflags} due to missing Makefile dependencies
make
%install
mkdir -p $RPM_BUILD_ROOT%{_prefix}
make install APRON_PREFIX=$RPM_BUILD_ROOT%{_prefix}
# We don't really want the test binaries
rm -fr $RPM_BUILD_ROOT%{_bindir}
# Move the header files into a subdirectory
mkdir $RPM_BUILD_ROOT%{_includedir}/%{name}
mv $RPM_BUILD_ROOT%{_includedir}/*.h $RPM_BUILD_ROOT%{_includedir}/apronxx \
$RPM_BUILD_ROOT%{_includedir}/oct $RPM_BUILD_ROOT%{_includedir}/%{name}
# Most files in _libdir are ocaml files, and so are in the wrong place.
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}
mv $RPM_BUILD_ROOT%{_libdir}/*.{a,cma,cmi,cmx,cmxa,idl,ml,mli} \
$RPM_BUILD_ROOT%{_libdir}/*_caml.so \
$RPM_BUILD_ROOT%{_libdir}/*_caml_debug.so \
$RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}
# Remove extraneous executable bits
chmod a-x $RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}/*.{a,cma,cmi,cmx*,idl,ml,mli}
find $RPM_BUILD_ROOT%{_includedir} \( -name \*.h -o -name \*.hh \) \
-perm /0111 | xargs chmod a-x
# Make duplicate files be symbolic links instead of copies
for f in ap_ppl apron boxD boxMPFR boxMPQ octD octMPQ polkaGrid polkaMPQ \
polkaRll; do
rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}/dll${f}_caml.so
ln -s lib${f}_caml.so \
$RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}/dll${f}_caml.so
rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}/dll${f}_caml_debug.so
ln -s lib${f}_caml_debug.so \
$RPM_BUILD_ROOT%{_libdir}/ocaml/%{name}/dll${f}_caml_debug.so
done
# Fix up the shared library names
cd $RPM_BUILD_ROOT%{_libdir}
for f in lib*.so; do
mv $f $f.%{version}
ln -s $f.%{sover} $f
ln -s $f.%{version} $f.%{sover}
done
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc AUTHORS Changes COPYING README apron/apron.pdf
%{_libdir}/*.so.*
%exclude %{_libdir}/*_debug.so*
%files devel
%doc apron/html/*
%{_libdir}/*.so
%exclude %{_libdir}/*_debug.so
%{_includedir}/%{name}
%exclude %{_includedir}/%{name}/apron_caml.h
%files -n ocaml-%{name}
%doc mlapronidl/mlapronidl.pdf
%{_libdir}/ocaml/%{name}
%exclude %{_libdir}/ocaml/%{name}/*_debug.so
%if %opt
%exclude %{_libdir}/ocaml/%{name}/*.a
%exclude %{_libdir}/ocaml/%{name}/*.cmxa
%exclude %{_libdir}/ocaml/%{name}/*.cmx
%endif
%exclude %{_libdir}/ocaml/%{name}/*.ml
%exclude %{_libdir}/ocaml/%{name}/*.mli
%files -n ocaml-%{name}-devel
%doc mlapronidl/html/*
%{_includedir}/%{name}/apron_caml.h
%if %opt
%{_libdir}/ocaml/%{name}/*.a
%exclude %{_libdir}/ocaml/%{name}/*_debug.a
%{_libdir}/ocaml/%{name}/*.cmxa
%{_libdir}/ocaml/%{name}/*.cmx
%endif
%{_libdir}/ocaml/%{name}/*.ml
%{_libdir}/ocaml/%{name}/*.mli
%changelog
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2014-04-30 13:52:14 +00:00
* Wed Apr 30 2014 Jerry James <loganjerry@gmail.com> - 0.9.10-16
- Rebuild for ppl 1.1
* Fri Apr 18 2014 Jerry James <loganjerry@gmail.com> - 0.9.10-15
- Ensure GNU extensions are enabled to fix build failure
* Tue Apr 15 2014 Richard W.M. Jones <rjones@redhat.com> - 0.9.10-15
- Remove ocaml_arches macro (RHBZ#1087794).
2013-11-20 16:36:05 +00:00
* Wed Nov 20 2013 Jerry James <loganjerry@gmail.com> - 0.9.10-14
- Add -format-security patch
2013-09-14 13:15:25 +00:00
* Sat Sep 14 2013 Richard W.M. Jones <rjones@redhat.com> - 0.9.10-13
2013-09-19 14:27:25 +00:00
- Rebuild for OCaml 4.01.0.
2013-09-14 13:15:25 +00:00
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Jerry James <loganjerry@gmail.com> - 0.9.10-11
- Add -ppl1 patch to adapt to PPL 1.0 + GMP 5.1.0
- Update -mlgmpidl12 patch to fix more problems
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2012-11-30 20:15:51 +00:00
* Fri Nov 30 2012 Tom Callaway <spot@fedoraproject.org> - 0.9.10-10
- rebuild for ppl
2012-10-17 23:20:08 +00:00
* Wed Oct 17 2012 Jerry James <loganjerry@gmail.com> - 0.9.10-9
- Rebuild for OCaml 4.00.1
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2012-06-10 01:44:24 +00:00
* Sat Jun 9 2012 Jerry James <loganjerry@gmail.com> - 0.9.10-7
- Rebuild for OCaml 4.00.0
2012-05-09 21:51:13 +00:00
* Wed May 9 2012 Jerry James <loganjerry@gmail.com> - 0.9.10-6
- Rebuild for new ocaml-mlgmpidl
2012-01-06 22:13:41 +00:00
* Fri Jan 6 2012 Jerry James <loganjerry@gmail.com> - 0.9.10-5
- Rebuild for GCC 4.7 and Ocaml 3.12.1
* Tue Nov 8 2011 Jerry James <loganjerry@gmail.com> - 0.9.10-4
- -devel also needs ocaml-camlidl-devel
- Pass --as-needed to the linker to fix unused shared library dependencies
2011-11-07 16:32:49 +00:00
* Fri Nov 4 2011 Jerry James <loganjerry@gmail.com> - 0.9.10-3
- Comment on license situation
- Drop debug libraries altogether
* Wed Aug 24 2011 Jerry James <loganjerry@gmail.com> - 0.9.10-2
- Correct license
- Build C and C++ interfaces even when the ocaml interface cannot be built
- Move debug libraries to separate packages
* Fri Jul 8 2011 Jerry James <loganjerry@gmail.com> - 0.9.10-1
- Initial RPM