summaryrefslogtreecommitdiffstats
path: root/ocaml/ocaml-easy-format.spec
blob: f710cb240e36917c8e7b37e07df9b8d21ca7879a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%global debug_package %{nil}
%global _use_internal_dependency_generator 0
%global __find_requires /usr/lib/rpm/ocaml-find-requires.sh
%global __find_provides /usr/lib/rpm/ocaml-find-provides.sh
%define libname %(echo %{name} | sed -e 's/^ocaml-//')

Name:           ocaml-easy-format
Version:        1.0.2
Release:        1%{?dist}
Summary:        High-level and functional interface to the Format module

License:        BSD
URL:            http://mjambon.com/easy-format.html
Source0:        http://mjambon.com/releases/easy-format/easy-format-1.0.2.tar.gz

BuildRequires:  ocaml >= 3.10.0
BuildRequires:  ocaml-findlib-devel
BuildRequires:  ocaml-ocamldoc
BuildRequires:  chrpath

%description
This module offers a high-level and functional interface to the Format
module of the OCaml standard library. It is a pretty-printing
facility, i.e. it takes as input some code represented as a tree and
formats this code into the most visually satisfying result, breaking
and indenting lines of code where appropriate.

Input data must be first modelled and converted into a tree using 3
kinds of nodes:

    atoms
    lists
    labelled nodes

Atoms represent any text that is guaranteed to be printed as-is. Lists
can model any sequence of items such as arrays of data or lists of
definitions that are labelled with something like "int main", "let x
=" or "x:".


%package        devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.


%prep
%setup -q -n %{libname}-%{version}


%build
make
%if %opt
make opt
%endif


%install
rm -rf $RPM_BUILD_ROOT
# These rules work if the library uses 'ocamlfind install' to install itself.
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
make install

strip $OCAMLFIND_DESTDIR/%{libname}/*.cmxs
#chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so


%files
%doc LICENSE
%{_libdir}/ocaml/%{libname}/
%if %opt
%exclude %{_libdir}/ocaml/*/*.cmx
%endif
%exclude %{_libdir}/ocaml/*/*.mli
%exclude %{_libdir}/ocaml/*/*.o


%files devel
%doc LICENSE README.md Changes
%if %opt
%{_libdir}/ocaml/*/*.cmx
%endif
%{_libdir}/ocaml/*/*.mli
%{_libdir}/ocaml/*/*.o


%changelog
* Mon Jan 20 2014 Michel Salim <salimma@fedoraproject.org> - 1.0.2-1
- Initial package