- initial revision
[packages/camlp5.git] / camlp5.spec
CommitLineData
170a6c18
JR
1Summary: Objective Caml Preprocessor
2Summary(pl.UTF-8): Preprocesor OCamla
3Name: camlp5
4Version: 5.11
5Release: 0.1
6License: distributable
7Group: Development/Languages
8Source0: http://pauillac.inria.fr/~ddr/camlp5/distrib/src/%{name}-%{version}.tgz
9# Source0-md5: 26d69abd669c5fda43dbf35074debc81
10Source1: http://pauillac.inria.fr/~ddr/camlp5/doc/pdf/%{name}-%{version}.pdf
11# Source1-md5: 57cf4eb162568d9b755e8120a1b82d43
12Source2: http://pauillac.inria.fr/~ddr/camlp5/doc/htmlz/%{name}-%{version}.html.tgz
13# Source2-md5: fcf3aa4d88a311aa27ff23e50c6f510f
14URL: http://caml.inria.fr/
15BuildRequires: db-devel >= 4.1
16Requires: %{name} = %{epoch}:%{version}-%{release}
17BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19%description
20Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers
21tools for syntax (grammars) and the ability to modify the concrete
22syntax of the language (quotations, syntax extensions).
23
24Camlp4 can parse normal Ocaml concrete syntax or any other
25user-definable syntax. As an example, an alternative syntax is
26provided, named revised, because it tries to fix some small problems
27of the normal syntax.
28
29Camlp4 can pretty print the normal Ocaml concrete syntax or the
30revised one. It is therefore always possible to have a version of your
31sources compilable by the Objective Caml compiler without
32preprocessing.
33
34%description -l pl.UTF-8
35Camlp4 jest preprocesorem OCamla. Oferuje narzędzia do manipulowania
36składnią (gramatyki) oraz możliwość modyfikowania oryginalnej składni
37języka (cytowania, rozszerzenia).
38
39Camlp4 może sparsować oryginalną składnię Ocamla lub dowolną inną
40definiowalną przez użytkownika. Jako przykład podana jest alternatywna
41składnia (revised syntax), która próbuje poprawić drobne problemy
42występujące w składni oryginalnej.
43
44Camlp4 umie ładnie formatować źródła zarówno w oryginalnej jak i
45poprawionej składni OCamla. Potrafi także tłumaczyć programy z jednej
46składni na drugą.
47
48%package doc-html
49Summary: Objective Caml Preprocessor - HTML documentation
50Summary(pl.UTF-8): Preprocesor OCamla - dokumentacja HTML
51Group: Development/Languages
52
53%description doc-html
54Objective Caml Preprocessor - HTML documentation.
55
56%description doc-html -l pl.UTF-8
57Preprocesor OCamla - dokumentacja HTML.
58
59%prep
60%setup -q
61cp %{SOURCE1} docs/camlp4.pdf
62tar xzf %{SOURCE2}
63
64%build
65cp -f /usr/share/automake/config.sub config/gnu
66./configure \
67 -cc "%{__cc}" \
68 -bindir %{_bindir} \
69 -libdir %{_libdir}/%{name} \
70 -mandir %{_mandir}/man1 \
71 -host %{_host} \
72 %{!?with_tk:-no-tk} \
73 -with-pthread \
74 -x11lib %{_libdir}
75
76%{__make} -j1 world bootstrap opt.opt CFLAGS="%{rpmcflags} -Wall"
77%{__make} -C tools objinfo CFLAGS="%{rpmcflags} -Wall" -j1
78
79# broken build system
80sed -e 's,LIBDIR,%{_libdir},' camlp4/man/camlp4.1.tpl > camlp4/man/camlp4.1
81
82%install
83rm -rf $RPM_BUILD_ROOT
84install -d $RPM_BUILD_ROOT{%{_includedir},%{_infodir},%{_examplesdir}/%{name}-{labltk-,}%{version}}
85install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/site-lib
86
87%{__make} install \
88 BINDIR=$RPM_BUILD_ROOT%{_bindir} \
89 LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{name} \
90 MANDIR=$RPM_BUILD_ROOT%{_mandir}
91
92cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF
93%{_libdir}/%{name}/stublibs
94%{_libdir}/%{name}
95EOF
96
97%if %{with emacs}
98%{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
99 EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
100 else echo xemacs; fi`" \
101 EMACSDIR="$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp"
102%endif
103
104# symlink .opt versions of compilers (if present)
105# warning: don't do that with camlp4 (can't load extensions then)
106for f in ocamlc ocamlopt ocamldoc ocamllex; do
107 if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
108 mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
109 $RPM_BUILD_ROOT%{_bindir}/$f.byte
110 ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
111 fi
112done
113
114# move includes to the proper place
115mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
116# but leave compatibility symlink
117ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml
118
119# compiled sources of compiler, needed by some programs
120for f in {asm,byte}comp parsing typing utils ; do
121 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
122 cp $f/*.{cmi,cmo,cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
123done
124
125# this isn't installed by default, but is useful
126install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
127cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128cp -r otherlibs/labltk/examples* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
129ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
130
131# shutup checkfiles
132rm -rf $RPM_BUILD_ROOT%{_mandir}/man3
133rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/labltk/{labltktop,pp}
134
135# install info pages
136cp -f infoman/*.gz $RPM_BUILD_ROOT%{_infodir}
137
138# broken build system
139install camlp4/man/camlp4.1 $RPM_BUILD_ROOT%{_mandir}/man1
140for f in camlp4o.1 camlp4r.1 mkcamlp4.1 camlp4o.opt.1 camlp4r.opt.1 ; do
141 echo '.so camlp4.1' >$RPM_BUILD_ROOT%{_mandir}/man1/$f
142done
143
144%clean
145rm -rf $RPM_BUILD_ROOT
146
147%files
148%defattr(644,root,root,755)
149%attr(755,root,root) %{_bindir}/camlp4*
150%attr(755,root,root) %{_bindir}/mkcamlp4
151%{_libdir}/%{name}/camlp4
152%{_mandir}/man1/camlp4*.1*
153%{_mandir}/man1/mkcamlp4.1*
154
155%files doc-html
156%defattr(644,root,root,755)
157%doc docs/html/camlp4*
This page took 0.149561 seconds and 4 git commands to generate.