Plasma GitLab Archive
Projects Blog Knowledge

%define toolname xstr

Summary: OCAML XSTR regular expression library
Name: ocaml-%{toolname}
Version: 0.1.2
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
Requires: fileutils, ocaml

%define dir_sitelib  usr/lib/ocaml/site-lib
%define files_doc    LICENSE README
BuildRoot: /tmp/root-%{name}

%description
Thread-safe implementation of string searching, replacing, splitting,
and matching, using an important subset of regular expressions.
Xstr is as fast as Str for small strings, and upto half as fast for large strings.

%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

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

%files
%defattr(-,root,root)
%doc %{files_doc}
/%{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