Initial release for F-8.

This commit is contained in:
Richard W.M. Jones 2007-12-06 17:06:59 +00:00
parent 1f578668f3
commit ce87758314
4 changed files with 295 additions and 0 deletions

View File

@ -0,0 +1 @@
ocamlnet-2.2.9.tar.gz

270
ocaml-ocamlnet.spec Normal file
View File

@ -0,0 +1,270 @@
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil}
Name: ocaml-ocamlnet
Version: 2.2.9
Release: 1%{?dist}
Summary: Network protocols for OCaml
Group: Development/Libraries
License: BSD
URL: http://www.ocaml-programming.de/programming/ocamlnet.html
Source0: http://www.ocaml-programming.de/packages/ocamlnet-%{version}.tar.gz
ExcludeArch: ppc64
Patch0: ocamlnet-ocaml310.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ocaml
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-pcre-devel
BuildRequires: ocaml-ssl-devel
BuildRequires: ocaml-lablgtk-devel
BuildRequires: pcre-devel
BuildRequires: openssl-devel
BuildRequires: tcl-devel
%define _use_internal_dependency_generator 0
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh -i Asttypes -i Outcometree -i Parsetree
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
%description
Ocamlnet is an ongoing effort to collect modules, classes and
functions that are useful to implement network protocols. Since
version 2.2, Ocamlnet incorporates the Equeue, RPC, and Netclient
libraries, so it now really a big player.
In detail, the following features are available:
* netstring is about processing strings that occur in network
context. Features: MIME encoding/decoding, Date/time parsing,
Character encoding conversion, HTML parsing and printing, URL
parsing and printing, OO-representation of channels, and a lot
more.
* netcgi1 and netcgi2 focus on portable web applications. netcgi1 is
the older, backward-compatible version, whereas netcgi2 bases on a
revised design, and is only partly backward-compatible. Supported
are CGI, FastCGI, AJP (mod_jk), and SCGI.
* rpc implements ONCRPC (alias SunRPC), the remote procedure call
technology behind NFS and other Unix services.
* netplex is a generic server framework. It can be used to build
stand-alone server programs from individual components like those
from netcgi2, nethttpd, and rpc.
* netclient implements clients for HTTP (version 1.1, of course), FTP
(currently partially), and Telnet.
* equeue is an event queue used for many protocol implementations. It
makes it possible to run several clients and/or servers in parallel
without having to use multi-threading or multi-processing.
* shell is about calling external commands like a Unix shell does.
* netshm provides shared memory for IPC purposes.
* netsys contains bindings for system functions missing in core O'Caml.
* smtp and pop are two further client implementations for the SMTP
and POP3 protocols.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%package nethttpd
Summary: Ocamlnet HTTP daemon
License: GPLv2+
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description nethttpd
Nethttpd is a web server component (HTTP server implementation). It
can be used for web applications without using an extra web server, or
for serving web services.
%package nethttpd-devel
Summary: Development files for %{name}-nethttpd
License: GPLv2+
Group: Development/Libraries
Requires: %{name}-nethttpd = %{version}-%{release}
%description nethttpd-devel
The %{name}-nethttpd-devel package contains libraries and signature
files for developing applications that use %{name}-nethttpd.
%prep
%setup -q -n ocamlnet-%{version}
pushd src/equeue-gtk1
%patch0 -p2
popd
./configure -enable-tcl -with-nethttpd \
-bindir %{_bindir} \
-datadir %{_datadir}/%{name} \
-prefer-netcgi2 \
-with-nethttpd \
-disable-apache \
-enable-ssl \
-enable-gtk2
# In future:
# -with-rpc-auth-dh (requires cryptgps)
%build
# Bletcherous hack to get that extra include path in camlp4 builds.
echo -e '#!/bin/sh\n%{_bindir}/camlp4 -I %{_libdir}/ocaml/camlp4/Camlp4Parsers "$@"' > camlp4; chmod 0755 camlp4; export PATH=`pwd`:$PATH
make all
%if %opt
make opt
%endif
%install
rm -rf $RPM_BUILD_ROOT
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
mkdir -p $OCAMLFIND_DESTDIR/stublibs
make install
# cgi/META conflicts with mod_caml
rm $RPM_BUILD_ROOT%{_libdir}/ocaml/cgi/META
rmdir $RPM_BUILD_ROOT%{_libdir}/ocaml/cgi
# rpc-generator/dummy.mli is empty and according to Gerd Stolpmann can
# be deleted safely. This avoids an rpmlint warning.
rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/rpc-generator/dummy.mli
# Strip libraries and binaries.
strip $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so
strip $RPM_BUILD_ROOT%{_bindir}/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc ChangeLog RELNOTES
%{_libdir}/ocaml/equeue
%{_libdir}/ocaml/equeue-gtk2
%{_libdir}/ocaml/equeue-ssl
%{_libdir}/ocaml/equeue-tcl
%{_libdir}/ocaml/netcgi1
%{_libdir}/ocaml/netcgi2
%{_libdir}/ocaml/netcgi2-plex
%{_libdir}/ocaml/netclient
%{_libdir}/ocaml/netplex
%{_libdir}/ocaml/netshm
%{_libdir}/ocaml/netstring
%{_libdir}/ocaml/netsys
%{_libdir}/ocaml/pop
%{_libdir}/ocaml/rpc
%{_libdir}/ocaml/rpc-auth-local
%{_libdir}/ocaml/rpc-generator
%{_libdir}/ocaml/rpc-ssl
%{_libdir}/ocaml/shell
%{_libdir}/ocaml/smtp
%if %opt
%exclude %{_libdir}/ocaml/*/*.a
%exclude %{_libdir}/ocaml/*/*.cmxa
%exclude %{_libdir}/ocaml/*/*.cmx
%exclude %{_libdir}/ocaml/*/*.o
%endif
%exclude %{_libdir}/ocaml/*/*.mli
%{_libdir}/ocaml/stublibs/*.so
%{_libdir}/ocaml/stublibs/*.so.owner
%{_datadir}/%{name}/
%{_bindir}/*
%files devel
%defattr(-,root,root,-)
%doc ChangeLog RELNOTES
%if %opt
%{_libdir}/ocaml/*/*.a
%{_libdir}/ocaml/*/*.cmxa
%{_libdir}/ocaml/*/*.cmx
%{_libdir}/ocaml/*/*.o
%endif
%{_libdir}/ocaml/*/*.mli
%files nethttpd
%defattr(-,root,root,-)
%doc ChangeLog RELNOTES
%{_libdir}/ocaml/nethttpd-for-netcgi1
%{_libdir}/ocaml/nethttpd-for-netcgi2
%{_libdir}/ocaml/nethttpd
%if %opt
%exclude %{_libdir}/ocaml/*/*.a
%exclude %{_libdir}/ocaml/*/*.cmxa
%endif
%exclude %{_libdir}/ocaml/*/*.mli
%files nethttpd-devel
%defattr(-,root,root,-)
%doc ChangeLog RELNOTES
%if %opt
%{_libdir}/ocaml/*/*.a
%{_libdir}/ocaml/*/*.cmxa
%endif
%{_libdir}/ocaml/*/*.mli
%changelog
* Wed Nov 7 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.9-1
- New upstream release 2.2.9.
- A more bletcherous, but more working, patch to fix the camlp4
missing path bug. Hopefully this is very temporary.
- Fixes for mock build under F8:
+ BR tcl-devel
* Thu Sep 13 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.8.1-1
- New upstream version 2.2.8.1.
- License of the base package is in fact BSD. Clarified also that
the license of nethttpd is GPLv2+.
- Removed the camlp4 paths patch as it doesn't seem to be necessary.
- Add BRs for camlp4, ocaml-pcre-devel, ocaml-lablgtk-devel,
openssl-devel
- Removed explicit requires, they're not needed.
- Strip binaries and libraries.
- Ignore Parsetree module in deps.
* Thu Aug 2 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-6
- ExcludeArch ppc64
- BR ocaml-pcre-devel
- Fix for camlp4 missing path
* Mon Jun 11 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-5
- Updated to latest packaging guidelines.
* Tue May 29 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-4
- Added support for ocaml-lablgtk2
* Tue May 29 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-3
- Remove empty file rpc-generator/dummy.mli.
* Sat May 26 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-2
- Added support for SSL.
* Sat May 26 2007 Richard W.M. Jones <rjones@redhat.com> - 2.2.7-1
- Initial RPM.

23
ocamlnet-ocaml310.patch Normal file
View File

@ -0,0 +1,23 @@
--- src/equeue-gtk2/uq_gtk.ml.orig 2007-06-11 19:35:10.000000000 +0100
+++ src/equeue-gtk2/uq_gtk.ml 2007-06-11 20:07:54.000000000 +0100
@@ -3,6 +3,11 @@
open Equeue
open Unixqueue
+(* Ugly hack required to compile under OCaml 3.10. This unmarshals
+ * `IN. IN is a reserved word for Camlp4.Macro.
+ *)
+let __in = (Marshal.from_string "\132\149\166\190\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\000\001?\229" 0 : GMain.Io.condition)
+
IFDEF GTK1 THEN
type event_id = GMain.Io.event_source
ELSE
@@ -147,7 +152,7 @@
gtk_event_source_hup = None; } in
( match g.gtk_event_source_in with
None when i ->
- g.gtk_event_source_in <- Some(mk_handler `IN [fd] [] []);
+ g.gtk_event_source_in <- Some(mk_handler __in [fd] [] []);
| Some s when not i ->
dest_handler s;
g.gtk_event_source_in <- None

View File

@ -0,0 +1 @@
3655e3be3bb2806e0a1f48bb7ce16fb3 ocamlnet-2.2.9.tar.gz