Initial import.

This commit is contained in:
Jerry James 2020-01-14 08:06:11 -07:00
parent cd00e87e88
commit 9505cd6cc4
3 changed files with 104 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/fpath-*.tar.gz

102
ocaml-fpath.spec Normal file
View File

@ -0,0 +1,102 @@
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname fpath
Name: ocaml-%{srcname}
Version: 0.7.2
Release: 1%{?dist}
Summary: File paths for OCaml
License: ISC
URL: https://erratique.ch/software/fpath
Source0: https://github.com/dbuenzli/fpath/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildRequires: ocaml >= 4.01.0
BuildRequires: ocaml-astring-devel
BuildRequires: ocaml-findlib
BuildRequires: ocaml-ocamlbuild
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-result-devel
BuildRequires: ocaml-topkg-devel >= 0.9.0
%description
Fpath is an OCaml module for handling file system paths with POSIX or
Windows conventions. Fpath processes paths without accessing the file
system and is independent from any system library.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: ocaml-astring-devel%{?_isa}
Requires: ocaml-result-devel%{?_isa}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%autosetup -n %{srcname}-%{version}
# Topkg does watermark replacements only if run inside a git checkout. Github
# tarballs do not come with a .git directory. Therefore, we do the watermark
# replacement manually.
for fil in $(find . -type f); do
sed -e 's,%%%%NAME%%%%,%{srcname},' \
-e 's,%%%%PKG_HOMEPAGE%%%%,%{url},' \
-e 's,%%%%VERSION%%%%,v%{version},' \
-e 's,%%%%VERSION_NUM%%%%,%{version},' \
-i.orig $fil
touch -r $fil.orig $fil
rm $fil.orig
done
%build
# Build the library and the tests
ocaml pkg/pkg.ml build --tests true
# Build the documentation
mkdir html
ocamldoc -html -d html -I +astring -I +result -I _build/src _build/src/fpath.mli
%install
# Install the library
mkdir -p %{buildroot}%{_libdir}/ocaml/fpath
cp -p _build/{opam,pkg/META} %{buildroot}%{_libdir}/ocaml/fpath
%ifarch %{ocaml_native_compiler}
cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \
%{buildroot}%{_libdir}/ocaml/fpath
%else
cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{_libdir}/ocaml/fpath
%endif
%check
ocaml pkg/pkg.ml test
%files
%doc CHANGES.md README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/%{srcname}/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cma
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxs
%endif
%files devel
%doc html/*
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.a
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmx
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmt
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmti
%{_libdir}/ocaml/%{srcname}/%{srcname}*.mli
%changelog
* Thu Jan 9 2020 Jerry James <loganjerry@gmail.com> - 0.7.2-1
- Initial RPM

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (fpath-0.7.2.tar.gz) = e05bc22c07fb5521024bb468f82e58cd7d84f762428e28bac7efa90fbec136f280ee079dfa0fcd4424991d8b3b1074d871cf762fd6fcb7afc6e40fe18edc1e51