%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) # From other of my spec files: # It appears as though ALL of these are necessary to prevent unwanted # stripping %define __os_install_post /usr/lib/rpm/brp-compress %{nil} %define _enable_debug_package 0 %define debug_package %{nil} Name: apron Version: 0.9.10_pr Release: 1%{?dist} Summary: Abstract numerical domain library Group: Development/Libraries License: LGPLv2 URL: http://apron.cri.ensmp.fr/library/ Source0: http://apron.cri.ensmp.fr/library/apron-%{version}.tgz Patch0: apron-Makefiles-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # BuildRequires described in manual explicitly BuildRequires: ocaml >= 3.09, ocaml-camlidl-devel = 1.05, gmp-devel >= 4.2, mpfr-devel >= 2.2 # Other discovered BuildRequires BuildRequires: ocaml-mlgmpidl-devel, m4, ppl-devel >= 0.10 # Documentation BuildRequires BuildRequires: texlive-latex, texinfo-tex, ocaml-ocamldoc, ghostscript # Extra BuildRequire to prevent stripping of ocaml "-custom" executable BuildRequires: prelink %description APRON is a library of functions that allows the definition and analysis of abstract numerical domains. APRON allows for different types of numerical coefficients, both arbitrary precision floating-point and rational, and different types of domain structures like intervals and polyhedra. It allows for variable assignments and constraints involving domains, and operations on these variables like comparisons, existential quantification, substitution, meet and join. %package devel Group: Development/Libraries Summary: Development files for ocaml-%{name} Requires: %{name} %description devel The %{name}-devel package contains libraries and signature files for developing applications that use the C bindings for the APRON library. %package -n ocaml-%{name} Group: Development/Libraries Summary: OCaml bindings for the APRON library Requires: %{name} %description -n ocaml-%{name} The ocaml-%{name} package contains OCaml bindings for the APRON library. %package -n ocaml-%{name}-devel Group: Development/Libraries Summary: Development files for ocaml-%{name} Requires: ocaml-%{name} = %{version}-%{release} %description -n ocaml-%{name}-devel The ocaml-%{name}-devel package contains libraries and signature files for developing applications that use the OCaml bindings for the APRON library. %prep %setup -q -n apron # Patch 0 reconfigures their makefiles to allow installs according to the # bindir, includedir, libdir variables # I have mentioned that changes were necessary to package this to # upstream, and will continue to push for their adoption (or, better # yet, the adoption of the standard "configure, make, make install" # process %patch0 %build # For now, ensure this isn't used mv mlgmpidl mlgmpidl-dontuse cp Makefile.config.model Makefile.config make rebuild all \ OCAMLDIR=%{_libdir}/ocaml \ APRON_BINDIR=%{_bindir} APRON_INCLUDEDIR=%{_includedir} \ APRON_LIBDIR=%{_libdir} APRON_CAML_LIBDIR=%{_libdir}/ocaml/apron \ GMP_INCLUDEDIR=%{_includedir} GMP_LIBDIR=%{_libdir} \ MPFR_INCLUDEDIR=%{_includedir} PPL_LIBDIR=%{_libdir} \ CAML_BINDIR=%{_bindir} \ CAMLIDL_BINDIR=%{_bindir} CAMLIDL_LIBDIR=%{_libdir} \ OPT=%{opt} # The runtimes can be stripped, but the custom toplevels cannot strip apronrun apronpplrun ppl/pplrun cd apron && make apron.pdf && cd .. cd mlapronidl && make mlapronidl.pdf MLGMPIDL_LIBDIR=%{_libdir}/ocaml/mlgmpidl && cd .. # Necessary for doc macro to work mv apron/apron.pdf mlapronidl/mlapronidl.pdf . %check cd test make -r EXTRACFLAGS='-I../products -I../newpolka -I../box -I../octagons -L../products -L../newpolka -L../box -L../octagons' \ APRON_INCLUDEDIR=../apron APRON_LIBDIR=../apron \ PPL_LIBDIR=../ppl PPL_INCLUDEDIR=../ppl MPFR_LIBDIR=%{_libdir} GMP_LIBDIR=%{_libdir} ./ctest1 | grep 'all tests passed' cd ../ppl ./ap_ppl_test | grep 'all tests passed' %install rm -rf %{buildroot} make install OCAMLDIR=%{_libdir}/ocaml \ APRON_BINDIR=%{buildroot}%{_bindir} APRON_INCLUDEDIR=%{buildroot}%{_includedir} \ APRON_LIBDIR=%{buildroot}%{_libdir} APRON_CAML_LIBDIR=%{buildroot}%{_libdir}/ocaml/apron \ GMP_INCLUDEDIR=%{_includedir} GMP_LIBDIR=%{_libdir} \ MPFR_INCLUDEDIR=%{_includedir} PPL_LIBDIR=%{_libdir} \ CAML_BINDIR=%{_bindir} \ CAMLIDL_BINDIR=%{_bindir} CAMLIDL_LIBDIR=%{_libdir} \ OPT=%{opt} # We don't need this test program rm %{buildroot}%{_bindir}/ap_ppl_test # Nor do we want sources installed rm %{buildroot}%{_libdir}/ocaml/apron/*.ml # Make sure that prelink does not foul up our bytecode executables by # stripping them with a cron job. This is done in install to ensure # that exactly the files that are eventually installed are in the # list, not all of the files in the bin directory of the build %define prelinkfilename %{name}-prelink.conf cd %{buildroot}%{_bindir} for f in *; do file $f | grep "not stripped" | sed -e 's/:.*//' -e 's!^!-b %{_bindir}/!' >> %{prelinkfilename} done %define prelinkconfdir %{_sysconfdir}/prelink.conf.d mkdir -p %{buildroot}%{prelinkconfdir} mv %{prelinkfilename} %{buildroot}%{prelinkconfdir} mkdir -p %{buildroot}%{_docdir} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc COPYING AUTHORS Changes README %attr(644,root,root) %{_libdir}/* %config %{prelinkconfdir}/%{prelinkfilename} %exclude %{_libdir}/ocaml %files devel %defattr(-,root,root,-) %doc apron.pdf %attr(644,root,root) %{_includedir}/*.h %dir %{_includedir}/oct %attr(644,root,root) %{_includedir}/oct/*.h %files -n ocaml-%{name} %defattr(-,root,root,-) %{_bindir}/* %dir %{_libdir}/ocaml/apron %attr(644, root, root) %{_libdir}/ocaml/apron/* %exclude %{_libdir}/ocaml/apron/*.a %exclude %{_libdir}/ocaml/apron/*.cmx* %exclude %{_libdir}/ocaml/apron/*.mli %exclude %{_libdir}/ocaml/apron/*.idl %files -n ocaml-%{name}-devel %defattr(-,root,root,-) %doc mlapronidl.pdf %attr(644,root,root) %{_libdir}/ocaml/apron/*.a %attr(644,root,root) %{_libdir}/ocaml/apron/*.cmx* %attr(644,root,root) %{_libdir}/ocaml/apron/*.mli %attr(644,root,root) %{_libdir}/ocaml/apron/*.idl %changelog * Fri May 01 2009 Alan Dunn 0.9.10_pr-1 - Initial Fedora RPM.