%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-newt Version: 0.6 Release: 1%{?dist} Summary: OCaml library for using newt text mode window system Group: Development/Libraries License: LGPLv2+ with exceptions URL: http://et.redhat.com/~rjones/ocaml-newt/ Source0: http://et.redhat.com/~rjones/ocaml-newt/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-ocamldoc BuildRequires: chrpath BuildRequires: ocaml-camlidl-devel #BuildRequires: newt-devel > 0.52.7 BuildRequires: newt-devel %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 This is a set of OCaml bindings to newt. The newt windowing system is a terminal-based window and widget library designed for writing applications with a simple, but user-friendly, interface. While newt is not intended to provide the rich feature set advanced applications may require, it has proven to be flexible enough for a wide range of applications (most notably, Red Hat's installation process). %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: newt-devel %description devel The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. %prep %setup -q ./configure --libdir=%{_libdir} %build # Dependencies are broken in the upstream package. make newt_int.mli rm -f .depend make depend make all %if %opt make opt %endif make doc %install rm -rf $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs make install strip $OCAMLFIND_DESTDIR/stublibs/dll*.so chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING.LIB %{_libdir}/ocaml/newt %if %opt %exclude %{_libdir}/ocaml/newt/*.a %exclude %{_libdir}/ocaml/newt/*.cmxa %exclude %{_libdir}/ocaml/newt/*.cmx %endif %exclude %{_libdir}/ocaml/newt/*.mli %{_libdir}/ocaml/stublibs/*.so %{_libdir}/ocaml/stublibs/*.so.owner %files devel %defattr(-,root,root,-) %doc COPYING.LIB README examples/*.ml html %if %opt %{_libdir}/ocaml/newt/*.a %{_libdir}/ocaml/newt/*.cmxa %{_libdir}/ocaml/newt/*.cmx %endif %{_libdir}/ocaml/newt/*.mli %changelog * Fri Mar 14 2008 Richard W.M. Jones - 0.6-1 - New upstream release 0.6. * Thu Mar 13 2008 Richard W.M. Jones - 0.4-1 - Initial RPM release.