%global pre_tag beta12 Name: jbuilder Version: 1.0 Release: 0.3.%{pre_tag}%{?dist} Summary: A composable build system for OCaml %global libname %(echo %{name} | sed -e 's/^ocaml-//') License: ASL 2.0 URL: https://github.com/janestreet/jbuilder/ Source0: https://github.com/janestreet/%{libname}/archive/%{version}+%{pre_tag}/%{libname}-%{version}.tar.gz BuildRequires: ocaml >= 4.02.3 BuildRequires: ocaml-findlib-devel # Depend on /usr/bin/sphinx-build for python version invariance. BuildRequires: /usr/bin/sphinx-build # Required by tests. BuildRequires: ocaml-menhir # Jbuilder has vendored deps (ugh): # I'm not clear on how to unbundle them. # It seems to be unsupported upstream; the bootstrap process for jbuilder # doesn't seem to be able to detect libraries installed systemwide. # https://github.com/janestreet/jbuilder/issues/220 Provides: bundled(ocaml-opam-file-format) Provides: bundled(ocaml-cmdliner) = 1.0.0 Provides: bundled(ocaml-re) %description Jbuilder is a build system designed for OCaml/Reason projects only. It focuses on providing the user with a consistent experience and takes care of most of the low-level details of OCaml compilation. All you have to do is provide a description of your project and Jbuilder will do the rest. The scheme it implements is inspired from the one used inside Jane Street and adapted to the open source world. It has matured over a long time and is used daily by hundred of developers, which means that it is highly tested and productive. %package doc Summary: HTML documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc HTML documentation for jbuilder, a composable build system for OCaml. %prep %autosetup -n %{libname}-%{version}-%{pre_tag} # The jbuilder build script figures out if the native code compiler is available # and uses it if it is, otherwise it uses the bytecode compiler. Thus I think # we just need to "make" here. %make_build release %make_build doc %install # jbuilder's makefile has a "make install" target. Tragically, it uses opam-install(er) # to install itself. Even more tragically, opam now requires jbuilder to build. # Therefore as a workaround we can just manually install things ourselves-- # jbuilder is *mostly* just a binary, making this easy. mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_libdir}/ocaml/jbuilder/ mkdir -p %{buildroot}%{_mandir}/man1 # The files to install are stored in _build as symlinks; dereference them. cp -aL _build/install/default/bin/jbuilder %{buildroot}%{_bindir}/ cp -aL _build/install/default/lib/jbuilder/* %{buildroot}%{_libdir}/ocaml/jbuilder/ cp -aL _build/install/default/man/man1/* %{buildroot}%{_mandir}/man1 # Install documentation by way of pkgdocdir. mkdir -p %{buildroot}%{_pkgdocdir}/ cp -ar README.md CHANGES.md doc/_build/* %{buildroot}%{_pkgdocdir}/ # Run the unit tests. %check make test %files %license LICENSE.md %doc %{_pkgdocdir}/README.md %doc %{_pkgdocdir}/CHANGES.md %{_libdir}/ocaml/%{libname} %{_bindir}/jbuilder %{_mandir}/man1/jbuilder.1* %{_mandir}/man1/jbuilder-build.1* %{_mandir}/man1/jbuilder-clean.1* %{_mandir}/man1/jbuilder-exec.1* %{_mandir}/man1/jbuilder-external-lib-deps.1* %{_mandir}/man1/jbuilder-install.1* %{_mandir}/man1/jbuilder-installed-libraries.1* %{_mandir}/man1/jbuilder-rules.1* %{_mandir}/man1/jbuilder-runtest.1* %{_mandir}/man1/jbuilder-subst.1* %{_mandir}/man1/jbuilder-uninstall.1* %files doc %exclude %{_pkgdocdir}/README.md %exclude %{_pkgdocdir}/CHANGES.md %doc %{_pkgdocdir}/* %changelog * Mon Aug 28 2017 Ben Rosser 1.0-0.3.beta12 - Update to latest upstream release, beta12. - Fix typo in description. - Use simpler github source URL. - Use make_build macros when compiling. * Tue Aug 15 2017 Ben Rosser 1.0-0.2.beta11 - Update to a git snapshot so opam can be built against. - Modernize ocaml packaging. * Tue Aug 1 2017 Ben Rosser 1.0-0.1.beta11 - Initial package.