Plasma GitLab Archive
Projects Blog Knowledge

%define toolname  netstring

Summary: OCAML Netstring library
Name: ocaml-%{toolname}
Version: 0.9.3
Release: 2
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 INSTALL
BuildRoot: /tmp/root-%{name}

%description
A collection of string processing functions for Internet protocols
- Parse MIME messages
- Encode/decode Base 64, Quoted Printable, Q, URL-encoding   
- CGI interface that allows users to upload files
- Simple HTML parser 
- URL parsing, printing and processing

%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}"
# Reference to obsolete CGI and BASE64 packages
for CMD in cgi base64 ; do
  cat Makefile | sed "s#[_A-Za-z\(\)\$]* install $CMD #\$(TRICK) #" > Makefile.trick
  DIR="${RPM_BUILD_ROOT}/%{dir_sitelib}/${CMD}"
  install -m 755 -d   "${DIR}"
  make -f Makefile.trick "install-${CMD}"  "TRICK=cp -f --target-directory=${DIR}"
done

# 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}
# Reference to obsolete CGI and BASE64 packages
/%{dir_sitelib}/cgi
/%{dir_sitelib}/base64

%changelog
* Wed Sep  6 2000 Olivier Montanuy <Olivier.Montanuy@wanadoo.fr>
- attempt to install cgi and base64 modules, for obsolete Makefiles

* 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