Plasma GitLab Archive
Projects Blog Knowledge

%define toolname  pxp

Summary: OCAML PXP XML library
Name: ocaml-%{toolname}
Version: 1.0
Release: 1
Copyright: GPL-like
Group: Development/Languages
Source: http://www.ocaml-programming.de/packages/%{toolname}-%{version}.tar.gz
Vendor:  Gerd Stolpmann
Url: http://www.ocaml-programming.de/packages/documentation/%{toolname}/
Prereq: fileutils, ocaml, ocaml-findlib, ocaml-netstring
Requires: fileutils, ocaml, ocaml-netstring

%define dir_sitelib  usr/lib/ocaml/site-lib
%define files_doc    LICENSE README INSTALL SPEC EXTENSIONS

BuildRoot: /tmp/root-%{name}

%description
PXP is a validating parser for XML-1.0 written entirely in Objective Caml. 
PXP stands for Polymorphic XML parser, emphasizes its most useful property: 
the API is polymorphic and can be configured such that different objects are 
used to store different types of elements. 
PXP was formerly known as "Markup". 

%prep
%setup -n %{toolname}
make clean

%build
make all
make opt

%install
# Install binary, libs, manuals

DIR_INSTALL="${RPM_BUILD_ROOT}/%{dir_sitelib}/%{toolname}"
install -m 755 -d   "${DIR_INSTALL}"
# Install in non-standard directory
# replace "$(OCAMLFIND) install" or "ocamlfind install"
cat Makefile | sed "s#[_A-Za-z\(\)\$]* install \$(NAME)#\$(TRICK)#" > Makefile.trick
# Ugly trick: replace "findlib" by "cp"
make -f Makefile.trick install "TRICK=cp -f --target-directory=${DIR_INSTALL}"

# Move doc files to root, if needed
for F in %{files_doc} ; do test -f "./doc/${F}" && mv -f "./doc/${F}" . ; done

# HTML manual
if test -d doc/manual/html ; then mv doc/manual/html htmlman; else mkdir htmlman ; fi


# Create a symbolic link to version-specific HTML manual 
%post
cd /usr/doc/HTML/
if test -L "%{name}" ; then rm -f "%{name}" ; fi
if test ! -e "%{name}" ; then ln -s "../%{name}-%{version}/htmlman" "%{name}" ; fi

%postun
cd /usr/doc/HTML/
if test "$1" = "0" -a -L %{name} ; then rm -f %{name} ; fi

%clean
if test `dirname "${RPM_BUILD_ROOT}"` != "/" ; then rm -rf "${RPM_BUILD_ROOT}" ; fi

%files
%defattr(-,root,root)
%doc %{files_doc} htmlman examples
/%{dir_sitelib}/%{toolname}

%changelog
* Fri Sep  1 2000 Olivier Montanuy <Olivier.Montanuy@wanadoo.fr> 
- created and tested package

This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml