]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/ocaml-pxp.spec
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / ocaml-pxp.spec
1 %define toolname  pxp
2
3 Summary: OCAML PXP XML library
4 Name: ocaml-%{toolname}
5 Version: 1.0
6 Release: 1
7 Copyright: GPL-like
8 Group: Development/Languages
9 Source: http://www.ocaml-programming.de/packages/%{toolname}-%{version}.tar.gz
10 Vendor:  Gerd Stolpmann
11 Url: http://www.ocaml-programming.de/packages/documentation/%{toolname}/
12 Prereq: fileutils, ocaml, ocaml-findlib, ocaml-netstring
13 Requires: fileutils, ocaml, ocaml-netstring
14
15 %define dir_sitelib  usr/lib/ocaml/site-lib
16 %define files_doc    LICENSE README INSTALL SPEC EXTENSIONS
17
18 BuildRoot: /tmp/root-%{name}
19
20 %description
21 PXP is a validating parser for XML-1.0 written entirely in Objective Caml. 
22 PXP stands for Polymorphic XML parser, emphasizes its most useful property: 
23 the API is polymorphic and can be configured such that different objects are 
24 used to store different types of elements. 
25 PXP was formerly known as "Markup". 
26
27 %prep
28 %setup -n %{toolname}
29 make clean
30
31 %build
32 make all
33 make opt
34
35 %install
36 # Install binary, libs, manuals
37
38 DIR_INSTALL="${RPM_BUILD_ROOT}/%{dir_sitelib}/%{toolname}"
39 install -m 755 -d   "${DIR_INSTALL}"
40 # Install in non-standard directory
41 # replace "$(OCAMLFIND) install" or "ocamlfind install"
42 cat Makefile | sed "s#[_A-Za-z\(\)\$]* install \$(NAME)#\$(TRICK)#" > Makefile.trick
43 # Ugly trick: replace "findlib" by "cp"
44 make -f Makefile.trick install "TRICK=cp -f --target-directory=${DIR_INSTALL}"
45
46 # Move doc files to root, if needed
47 for F in %{files_doc} ; do test -f "./doc/${F}" && mv -f "./doc/${F}" . ; done
48
49 # HTML manual
50 if test -d doc/manual/html ; then mv doc/manual/html htmlman; else mkdir htmlman ; fi
51
52
53 # Create a symbolic link to version-specific HTML manual 
54 %post
55 cd /usr/doc/HTML/
56 if test -L "%{name}" ; then rm -f "%{name}" ; fi
57 if test ! -e "%{name}" ; then ln -s "../%{name}-%{version}/htmlman" "%{name}" ; fi
58
59 %postun
60 cd /usr/doc/HTML/
61 if test "$1" = "0" -a -L %{name} ; then rm -f %{name} ; fi
62
63 %clean
64 if test `dirname "${RPM_BUILD_ROOT}"` != "/" ; then rm -rf "${RPM_BUILD_ROOT}" ; fi
65
66 %files
67 %defattr(-,root,root)
68 %doc %{files_doc} htmlman examples
69 /%{dir_sitelib}/%{toolname}
70
71 %changelog
72 * Fri Sep  1 2000 Olivier Montanuy <Olivier.Montanuy@wanadoo.fr> 
73 - created and tested package